@PublicApi public class ChainedInstrumentation extends java.lang.Object implements Instrumentation
Instrumentation
implementations
and run them in sequence. The list order of instrumentation objects is always guaranteed to be followed and
the InstrumentationState
objects they create will be passed back to the originating
implementation.Instrumentation
Modifier and Type | Field and Description |
---|---|
protected com.google.common.collect.ImmutableList<Instrumentation> |
instrumentations |
Constructor and Description |
---|
ChainedInstrumentation(Instrumentation... instrumentations) |
ChainedInstrumentation(java.util.List<Instrumentation> instrumentations) |
Modifier and Type | Method and Description |
---|---|
@NotNull InstrumentationContext<ExecutionResult> |
beginExecuteOperation(InstrumentationExecuteOperationParameters parameters)
This is called just before the execution of the query operation is started.
|
InstrumentationContext<ExecutionResult> |
beginExecuteOperation(InstrumentationExecuteOperationParameters parameters,
InstrumentationState state)
This is called just before the execution of the query operation is started.
|
@NotNull InstrumentationContext<ExecutionResult> |
beginExecution(InstrumentationExecutionParameters parameters)
This is called right at the start of query execution, and it's the first step in the instrumentation chain.
|
InstrumentationContext<ExecutionResult> |
beginExecution(InstrumentationExecutionParameters parameters,
InstrumentationState state)
This is called right at the start of query execution, and it's the first step in the instrumentation chain.
|
@NotNull ExecutionStrategyInstrumentationContext |
beginExecutionStrategy(InstrumentationExecutionStrategyParameters parameters)
This is called each time an
ExecutionStrategy is invoked, which may be multiple times
per query as the engine recursively descends down over the query. |
ExecutionStrategyInstrumentationContext |
beginExecutionStrategy(InstrumentationExecutionStrategyParameters parameters,
InstrumentationState state)
This is called each time an
ExecutionStrategy is invoked, which may be multiple times
per query as the engine recursively descends down over the query. |
@NotNull InstrumentationContext<ExecutionResult> |
beginField(InstrumentationFieldParameters parameters)
This is called just before a field is resolved into a value.
|
InstrumentationContext<ExecutionResult> |
beginField(InstrumentationFieldParameters parameters,
InstrumentationState state)
This is called just before a field is resolved into a value.
|
@NotNull InstrumentationContext<ExecutionResult> |
beginFieldComplete(InstrumentationFieldCompleteParameters parameters)
This is called just before the complete field is started.
|
InstrumentationContext<ExecutionResult> |
beginFieldComplete(InstrumentationFieldCompleteParameters parameters,
InstrumentationState state)
This is called just before the complete field is started.
|
@NotNull InstrumentationContext<java.lang.Object> |
beginFieldFetch(InstrumentationFieldFetchParameters parameters)
This is called just before a field
DataFetcher is invoked. |
InstrumentationContext<java.lang.Object> |
beginFieldFetch(InstrumentationFieldFetchParameters parameters,
InstrumentationState state)
This is called just before a field
DataFetcher is invoked. |
@NotNull InstrumentationContext<ExecutionResult> |
beginFieldListComplete(InstrumentationFieldCompleteParameters parameters)
This is called just before the complete field list is started.
|
InstrumentationContext<ExecutionResult> |
beginFieldListComplete(InstrumentationFieldCompleteParameters parameters,
InstrumentationState state)
This is called just before the complete field list is started.
|
@NotNull InstrumentationContext<Document> |
beginParse(InstrumentationExecutionParameters parameters)
This is called just before a query is parsed.
|
InstrumentationContext<Document> |
beginParse(InstrumentationExecutionParameters parameters,
InstrumentationState state)
This is called just before a query is parsed.
|
@NotNull InstrumentationContext<ExecutionResult> |
beginSubscribedFieldEvent(InstrumentationFieldParameters parameters)
This is called each time a subscription field produces a new reactive stream event value and it needs to be mapped over via the graphql field subselection.
|
InstrumentationContext<ExecutionResult> |
beginSubscribedFieldEvent(InstrumentationFieldParameters parameters,
InstrumentationState state)
This is called each time a subscription field produces a new reactive stream event value and it needs to be mapped over via the graphql field subselection.
|
@NotNull InstrumentationContext<java.util.List<ValidationError>> |
beginValidation(InstrumentationValidationParameters parameters)
This is called just before the parsed query document is validated.
|
InstrumentationContext<java.util.List<ValidationError>> |
beginValidation(InstrumentationValidationParameters parameters,
InstrumentationState state)
This is called just before the parsed query document is validated.
|
InstrumentationState |
createState(InstrumentationCreateStateParameters parameters)
This will be called just before execution to create an object that is given back to all instrumentation methods
to allow them to have per execution request state
|
java.util.List<Instrumentation> |
getInstrumentations() |
protected InstrumentationState |
getSpecificState(Instrumentation instrumentation,
InstrumentationState parametersInstrumentationState) |
@NotNull DataFetcher<?> |
instrumentDataFetcher(DataFetcher<?> dataFetcher,
InstrumentationFieldFetchParameters parameters)
This is called to instrument a
DataFetcher just before it is used to fetch a field, allowing you
to adjust what information is passed back or record information about specific data fetches. |
@NotNull DataFetcher<?> |
instrumentDataFetcher(DataFetcher<?> dataFetcher,
InstrumentationFieldFetchParameters parameters,
InstrumentationState state)
This is called to instrument a
DataFetcher just before it is used to fetch a field, allowing you
to adjust what information is passed back or record information about specific data fetches. |
@NotNull DocumentAndVariables |
instrumentDocumentAndVariables(DocumentAndVariables documentAndVariables,
InstrumentationExecutionParameters parameters)
This is called to instrument a
Document and variables before it is used allowing you to adjust the query AST if you so desire |
@NotNull DocumentAndVariables |
instrumentDocumentAndVariables(DocumentAndVariables documentAndVariables,
InstrumentationExecutionParameters parameters,
InstrumentationState state)
This is called to instrument a
Document and variables before it is used allowing you to adjust the query AST if you so desire |
@NotNull ExecutionContext |
instrumentExecutionContext(ExecutionContext executionContext,
InstrumentationExecutionParameters parameters)
This is called to instrument a
ExecutionContext before it is used to execute a query,
allowing you to adjust the base data used. |
@NotNull ExecutionContext |
instrumentExecutionContext(ExecutionContext executionContext,
InstrumentationExecutionParameters parameters,
InstrumentationState state)
This is called to instrument a
ExecutionContext before it is used to execute a query,
allowing you to adjust the base data used. |
@NotNull ExecutionInput |
instrumentExecutionInput(ExecutionInput executionInput,
InstrumentationExecutionParameters parameters)
This is called to instrument a
ExecutionInput before it is used to parse, validate
and execute a query, allowing you to adjust what query input parameters are used |
@NotNull ExecutionInput |
instrumentExecutionInput(ExecutionInput executionInput,
InstrumentationExecutionParameters parameters,
InstrumentationState state)
This is called to instrument a
ExecutionInput before it is used to parse, validate
and execute a query, allowing you to adjust what query input parameters are used |
@NotNull java.util.concurrent.CompletableFuture<ExecutionResult> |
instrumentExecutionResult(ExecutionResult executionResult,
InstrumentationExecutionParameters parameters)
This is called to allow instrumentation to instrument the execution result in some way
|
@NotNull java.util.concurrent.CompletableFuture<ExecutionResult> |
instrumentExecutionResult(ExecutionResult executionResult,
InstrumentationExecutionParameters parameters,
InstrumentationState state)
This is called to allow instrumentation to instrument the execution result in some way
|
@NotNull GraphQLSchema |
instrumentSchema(GraphQLSchema schema,
InstrumentationExecutionParameters parameters)
This is called to instrument a
GraphQLSchema before it is used to parse, validate
and execute a query, allowing you to adjust what types are used. |
@NotNull GraphQLSchema |
instrumentSchema(GraphQLSchema schema,
InstrumentationExecutionParameters parameters,
InstrumentationState state)
This is called to instrument a
GraphQLSchema before it is used to parse, validate
and execute a query, allowing you to adjust what types are used. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createState
protected final com.google.common.collect.ImmutableList<Instrumentation> instrumentations
public ChainedInstrumentation(java.util.List<Instrumentation> instrumentations)
public ChainedInstrumentation(Instrumentation... instrumentations)
public java.util.List<Instrumentation> getInstrumentations()
protected InstrumentationState getSpecificState(Instrumentation instrumentation, InstrumentationState parametersInstrumentationState)
public InstrumentationState createState(InstrumentationCreateStateParameters parameters)
Instrumentation
createState
in interface Instrumentation
parameters
- the parameters to this step@NotNull public @NotNull InstrumentationContext<ExecutionResult> beginExecution(InstrumentationExecutionParameters parameters)
Instrumentation
beginExecution
in interface Instrumentation
parameters
- the parameters to this stepInstrumentationContext
object that will be called back when the step endspublic InstrumentationContext<ExecutionResult> beginExecution(InstrumentationExecutionParameters parameters, InstrumentationState state)
Instrumentation
beginExecution
in interface Instrumentation
parameters
- the parameters to this stepstate
- the state created during the call to Instrumentation.createState(InstrumentationCreateStateParameters)
InstrumentationContext
object that will be called back when the step ends (assuming it's not null)@NotNull public @NotNull InstrumentationContext<Document> beginParse(InstrumentationExecutionParameters parameters)
Instrumentation
beginParse
in interface Instrumentation
parameters
- the parameters to this stepInstrumentationContext
object that will be called back when the step endspublic InstrumentationContext<Document> beginParse(InstrumentationExecutionParameters parameters, InstrumentationState state)
Instrumentation
beginParse
in interface Instrumentation
parameters
- the parameters to this stepstate
- the state created during the call to Instrumentation.createState(InstrumentationCreateStateParameters)
InstrumentationContext
object that will be called back when the step ends (assuming it's not null)@NotNull public @NotNull InstrumentationContext<java.util.List<ValidationError>> beginValidation(InstrumentationValidationParameters parameters)
Instrumentation
beginValidation
in interface Instrumentation
parameters
- the parameters to this stepInstrumentationContext
object that will be called back when the step endspublic InstrumentationContext<java.util.List<ValidationError>> beginValidation(InstrumentationValidationParameters parameters, InstrumentationState state)
Instrumentation
beginValidation
in interface Instrumentation
parameters
- the parameters to this stepstate
- the state created during the call to Instrumentation.createState(InstrumentationCreateStateParameters)
InstrumentationContext
object that will be called back when the step ends (assuming it's not null)@NotNull public @NotNull InstrumentationContext<ExecutionResult> beginExecuteOperation(InstrumentationExecuteOperationParameters parameters)
Instrumentation
beginExecuteOperation
in interface Instrumentation
parameters
- the parameters to this stepInstrumentationContext
object that will be called back when the step endspublic InstrumentationContext<ExecutionResult> beginExecuteOperation(InstrumentationExecuteOperationParameters parameters, InstrumentationState state)
Instrumentation
beginExecuteOperation
in interface Instrumentation
parameters
- the parameters to this stepstate
- the state created during the call to Instrumentation.createState(InstrumentationCreateStateParameters)
InstrumentationContext
object that will be called back when the step ends (assuming it's not null)@NotNull public @NotNull ExecutionStrategyInstrumentationContext beginExecutionStrategy(InstrumentationExecutionStrategyParameters parameters)
Instrumentation
ExecutionStrategy
is invoked, which may be multiple times
per query as the engine recursively descends down over the query.beginExecutionStrategy
in interface Instrumentation
parameters
- the parameters to this stepExecutionStrategyInstrumentationContext
object that will be called back when the step endspublic ExecutionStrategyInstrumentationContext beginExecutionStrategy(InstrumentationExecutionStrategyParameters parameters, InstrumentationState state)
Instrumentation
ExecutionStrategy
is invoked, which may be multiple times
per query as the engine recursively descends down over the query.beginExecutionStrategy
in interface Instrumentation
parameters
- the parameters to this stepstate
- the state created during the call to Instrumentation.createState(InstrumentationCreateStateParameters)
ExecutionStrategyInstrumentationContext
object that will be called back when the step ends (assuming it's not null)@NotNull public @NotNull InstrumentationContext<ExecutionResult> beginSubscribedFieldEvent(InstrumentationFieldParameters parameters)
Instrumentation
beginSubscribedFieldEvent
in interface Instrumentation
parameters
- the parameters to this stepInstrumentationContext
object that will be called back when the step endspublic InstrumentationContext<ExecutionResult> beginSubscribedFieldEvent(InstrumentationFieldParameters parameters, InstrumentationState state)
Instrumentation
beginSubscribedFieldEvent
in interface Instrumentation
parameters
- the parameters to this stepstate
- the state created during the call to Instrumentation.createState(InstrumentationCreateStateParameters)
InstrumentationContext
object that will be called back when the step ends (assuming it's not null)@NotNull public @NotNull InstrumentationContext<ExecutionResult> beginField(InstrumentationFieldParameters parameters)
Instrumentation
beginField
in interface Instrumentation
parameters
- the parameters to this stepInstrumentationContext
object that will be called back when the step endspublic InstrumentationContext<ExecutionResult> beginField(InstrumentationFieldParameters parameters, InstrumentationState state)
Instrumentation
beginField
in interface Instrumentation
parameters
- the parameters to this stepstate
- the state created during the call to Instrumentation.createState(InstrumentationCreateStateParameters)
InstrumentationContext
object that will be called back when the step ends (assuming it's not null)@NotNull public @NotNull InstrumentationContext<java.lang.Object> beginFieldFetch(InstrumentationFieldFetchParameters parameters)
Instrumentation
DataFetcher
is invoked.beginFieldFetch
in interface Instrumentation
parameters
- the parameters to this stepInstrumentationContext
object that will be called back when the step endspublic InstrumentationContext<java.lang.Object> beginFieldFetch(InstrumentationFieldFetchParameters parameters, InstrumentationState state)
Instrumentation
DataFetcher
is invoked.beginFieldFetch
in interface Instrumentation
parameters
- the parameters to this stepstate
- the state created during the call to Instrumentation.createState(InstrumentationCreateStateParameters)
InstrumentationContext
object that will be called back when the step ends (assuming it's not null)@NotNull public @NotNull InstrumentationContext<ExecutionResult> beginFieldComplete(InstrumentationFieldCompleteParameters parameters)
Instrumentation
beginFieldComplete
in interface Instrumentation
parameters
- the parameters to this stepInstrumentationContext
object that will be called back when the step endspublic InstrumentationContext<ExecutionResult> beginFieldComplete(InstrumentationFieldCompleteParameters parameters, InstrumentationState state)
Instrumentation
beginFieldComplete
in interface Instrumentation
parameters
- the parameters to this stepstate
- the state created during the call to Instrumentation.createState(InstrumentationCreateStateParameters)
InstrumentationContext
object that will be called back when the step ends (assuming it's not null)@NotNull public @NotNull InstrumentationContext<ExecutionResult> beginFieldListComplete(InstrumentationFieldCompleteParameters parameters)
Instrumentation
beginFieldListComplete
in interface Instrumentation
parameters
- the parameters to this stepInstrumentationContext
object that will be called back when the step endspublic InstrumentationContext<ExecutionResult> beginFieldListComplete(InstrumentationFieldCompleteParameters parameters, InstrumentationState state)
Instrumentation
beginFieldListComplete
in interface Instrumentation
parameters
- the parameters to this stepstate
- the state created during the call to Instrumentation.createState(InstrumentationCreateStateParameters)
InstrumentationContext
object that will be called back when the step ends (assuming it's not null)@NotNull public @NotNull ExecutionInput instrumentExecutionInput(ExecutionInput executionInput, InstrumentationExecutionParameters parameters)
Instrumentation
ExecutionInput
before it is used to parse, validate
and execute a query, allowing you to adjust what query input parameters are usedinstrumentExecutionInput
in interface Instrumentation
executionInput
- the execution input to be usedparameters
- the parameters describing the field to be fetched@NotNull public @NotNull ExecutionInput instrumentExecutionInput(ExecutionInput executionInput, InstrumentationExecutionParameters parameters, InstrumentationState state)
Instrumentation
ExecutionInput
before it is used to parse, validate
and execute a query, allowing you to adjust what query input parameters are usedinstrumentExecutionInput
in interface Instrumentation
executionInput
- the execution input to be usedparameters
- the parameters describing the field to be fetchedstate
- the state created during the call to Instrumentation.createState(InstrumentationCreateStateParameters)
@NotNull public @NotNull DocumentAndVariables instrumentDocumentAndVariables(DocumentAndVariables documentAndVariables, InstrumentationExecutionParameters parameters)
Instrumentation
Document
and variables before it is used allowing you to adjust the query AST if you so desireinstrumentDocumentAndVariables
in interface Instrumentation
documentAndVariables
- the document and variables to be usedparameters
- the parameters describing the execution@NotNull public @NotNull DocumentAndVariables instrumentDocumentAndVariables(DocumentAndVariables documentAndVariables, InstrumentationExecutionParameters parameters, InstrumentationState state)
Instrumentation
Document
and variables before it is used allowing you to adjust the query AST if you so desireinstrumentDocumentAndVariables
in interface Instrumentation
documentAndVariables
- the document and variables to be usedparameters
- the parameters describing the executionstate
- the state created during the call to Instrumentation.createState(InstrumentationCreateStateParameters)
@NotNull public @NotNull GraphQLSchema instrumentSchema(GraphQLSchema schema, InstrumentationExecutionParameters parameters)
Instrumentation
GraphQLSchema
before it is used to parse, validate
and execute a query, allowing you to adjust what types are used.instrumentSchema
in interface Instrumentation
schema
- the schema to be usedparameters
- the parameters describing the field to be fetched@NotNull public @NotNull GraphQLSchema instrumentSchema(GraphQLSchema schema, InstrumentationExecutionParameters parameters, InstrumentationState state)
Instrumentation
GraphQLSchema
before it is used to parse, validate
and execute a query, allowing you to adjust what types are used.instrumentSchema
in interface Instrumentation
schema
- the schema to be usedparameters
- the parameters describing the field to be fetchedstate
- the state created during the call to Instrumentation.createState(InstrumentationCreateStateParameters)
@NotNull public @NotNull ExecutionContext instrumentExecutionContext(ExecutionContext executionContext, InstrumentationExecutionParameters parameters)
Instrumentation
ExecutionContext
before it is used to execute a query,
allowing you to adjust the base data used.instrumentExecutionContext
in interface Instrumentation
executionContext
- the execution context to be usedparameters
- the parameters describing the field to be fetched@NotNull public @NotNull ExecutionContext instrumentExecutionContext(ExecutionContext executionContext, InstrumentationExecutionParameters parameters, InstrumentationState state)
Instrumentation
ExecutionContext
before it is used to execute a query,
allowing you to adjust the base data used.instrumentExecutionContext
in interface Instrumentation
executionContext
- the execution context to be usedparameters
- the parameters describing the field to be fetchedstate
- the state created during the call to Instrumentation.createState(InstrumentationCreateStateParameters)
@NotNull public @NotNull DataFetcher<?> instrumentDataFetcher(DataFetcher<?> dataFetcher, InstrumentationFieldFetchParameters parameters)
Instrumentation
DataFetcher
just before it is used to fetch a field, allowing you
to adjust what information is passed back or record information about specific data fetches. Note
the same data fetcher instance maybe presented to you many times and that data fetcher
implementations widely vary.instrumentDataFetcher
in interface Instrumentation
dataFetcher
- the data fetcher about to be usedparameters
- the parameters describing the field to be fetched@NotNull public @NotNull DataFetcher<?> instrumentDataFetcher(DataFetcher<?> dataFetcher, InstrumentationFieldFetchParameters parameters, InstrumentationState state)
Instrumentation
DataFetcher
just before it is used to fetch a field, allowing you
to adjust what information is passed back or record information about specific data fetches. Note
the same data fetcher instance maybe presented to you many times and that data fetcher
implementations widely vary.instrumentDataFetcher
in interface Instrumentation
dataFetcher
- the data fetcher about to be usedparameters
- the parameters describing the field to be fetchedstate
- the state created during the call to Instrumentation.createState(InstrumentationCreateStateParameters)
@NotNull public @NotNull java.util.concurrent.CompletableFuture<ExecutionResult> instrumentExecutionResult(ExecutionResult executionResult, InstrumentationExecutionParameters parameters)
Instrumentation
instrumentExecutionResult
in interface Instrumentation
executionResult
- CompletableFuture
of the result to instrumentparameters
- the parameters to this step@NotNull public @NotNull java.util.concurrent.CompletableFuture<ExecutionResult> instrumentExecutionResult(ExecutionResult executionResult, InstrumentationExecutionParameters parameters, InstrumentationState state)
Instrumentation
instrumentExecutionResult
in interface Instrumentation
executionResult
- CompletableFuture
of the result to instrumentparameters
- the parameters to this stepstate
- the state created during the call to Instrumentation.createState(InstrumentationCreateStateParameters)