Class SmallRyeContext

  • All Implemented Interfaces:
    Context

    public class SmallRyeContext
    extends Object
    implements Context
    Implements the Context from MicroProfile API. WARNING: This class has to be used as semi-immutable. When propagating this to a new execution, it has to be cloned. A clone is a deep copy WITH THE EXCEPTION OF: - Added extensions - ExecutionResult - DataFetchingEnvironment (this actually should be rewritten after cloning for each new fetcher) These above things get shared between all clones to enable applications to write their own data into them.
    Author:
    Phillip Kruger (phillip.kruger@redhat.com)
    • Constructor Detail

      • SmallRyeContext

        public SmallRyeContext​(String createdBy)
    • Method Detail

      • addExtension

        public void addExtension​(String key,
                                 Object value)
        Adds single instance of user created extension into the context.
        Parameters:
        key - The key (identification) of the extension.
        value - The value of extension.
      • getRequest

        public jakarta.json.JsonObject getRequest()
        Specified by:
        getRequest in interface Context
      • setRequest

        public void setRequest​(jakarta.json.JsonObject request)
      • setExecutionId

        public void setExecutionId​(String executionId)
      • setFieldName

        public void setFieldName​(String fieldName)
      • getField

        public Field getField()
      • setField

        public void setField​(Field field)
      • setArguments

        public <A> void setArguments​(Map<String,​A> arguments)
      • getSource

        public <S> S getSource()
        Specified by:
        getSource in interface Context
      • setSource

        public <S> void setSource​(S source)
      • setPath

        public void setPath​(String path)
      • getSelectedFields

        public jakarta.json.JsonArray getSelectedFields()
        Specified by:
        getSelectedFields in interface Context
      • setSelectedFields

        public void setSelectedFields​(jakarta.json.JsonArray selectedFields)
      • setSelectedAndSourceFields

        public void setSelectedAndSourceFields​(jakarta.json.JsonArray selectedAndSourceFields)
      • setOperationType

        public void setOperationType​(String operationType)
      • setRequestedOperationTypes

        public void setRequestedOperationTypes​(List<String> requestedOperationTypes)
      • setParentTypeName

        public void setParentTypeName​(String parentTypeName)
      • setOperationName

        public void setOperationName​(String operationName)
      • getDataFetchingEnvironment

        public graphql.schema.DataFetchingEnvironment getDataFetchingEnvironment()
      • setDataFetchingEnvironment

        public void setDataFetchingEnvironment​(graphql.schema.DataFetchingEnvironment dataFetchingEnvironment)
      • getExecutionInput

        public graphql.ExecutionInput getExecutionInput()
      • setExecutionInput

        public void setExecutionInput​(graphql.ExecutionInput executionInput)
      • getQueryCache

        public QueryCache getQueryCache()
      • setQueryCache

        public void setQueryCache​(QueryCache queryCache)
      • setDocumentSupplier

        public void setDocumentSupplier​(DocumentSupplier documentSupplier)
      • setExecutionResult

        public void setExecutionResult​(graphql.ExecutionResult executionResult)
      • unwrap

        public <T> T unwrap​(Class<T> wrappedType)
        Specified by:
        unwrap in interface Context