Class ProcessingInstructionUtils
java.lang.Object
org.axonframework.axonserver.connector.util.ProcessingInstructionUtils
Utility class contain helper methods to extract information from
ProcessingInstructions.- Since:
- 4.0
- Author:
- Marc Gathier
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanaxonServerSupportsQueryStreaming(List<io.axoniq.axonserver.grpc.ProcessingInstruction> instructions) Retrieve whether Axon Server supports streaming from the giveninstructions, by searching for the value ofProcessingKey.SERVER_SUPPORTS_STREAMING.static booleanclientSupportsQueryStreaming(List<io.axoniq.axonserver.grpc.ProcessingInstruction> instructions) Retrieve whether Client (query issuer) supports streaming from the giveninstructions, by searching for the value ofProcessingKey.CLIENT_SUPPORTS_STREAMING.static io.axoniq.axonserver.grpc.ProcessingInstruction.BuildercreateProcessingInstruction(io.axoniq.axonserver.grpc.ProcessingKey key, boolean value) Creates a newProcessingInstruction.Builderwith the givenkeyandvalue.static io.axoniq.axonserver.grpc.ProcessingInstruction.BuildercreateProcessingInstruction(io.axoniq.axonserver.grpc.ProcessingKey key, long value) Creates a newProcessingInstruction.Builderwith the givenkeyandvalue.static io.axoniq.axonserver.grpc.ProcessingInstruction.BuildercreateProcessingInstruction(io.axoniq.axonserver.grpc.ProcessingKey key, io.axoniq.axonserver.grpc.MetaDataValue.Builder value) Creates a newProcessingInstruction.Builderwith the givenkeyandvalue.static io.axoniq.axonserver.grpc.ProcessingInstruction.BuildercreateProcessingInstruction(io.axoniq.axonserver.grpc.ProcessingKey key, String value) Creates a newProcessingInstruction.Builderwith the givenkeyandvalue.static longnumberOfResults(List<io.axoniq.axonserver.grpc.ProcessingInstruction> instructions) Retrieve the desired 'number of results' as alongfrom the giveninstructions, by searching for theProcessingInstructionwho's key equals theProcessingKey.NR_OF_RESULTS.static intRetrieve the priority as aintfrom the giveninstructions, by searching for theProcessingInstructionwho's key equals theProcessingKey.PRIORITY.static StringroutingKey(List<io.axoniq.axonserver.grpc.ProcessingInstruction> instructions) Retrieve the routing key as aStringfrom the giveninstructions, by searching for theProcessingInstructionwho's key equals theProcessingKey.ROUTING_KEY.static longRetrieve the desired 'number of results' as alongfrom the giveninstructions, by searching for theProcessingInstructionwho's key equals theProcessingKey.NR_OF_RESULTS.
-
Method Details
-
createProcessingInstruction
public static io.axoniq.axonserver.grpc.ProcessingInstruction.Builder createProcessingInstruction(@Nonnull io.axoniq.axonserver.grpc.ProcessingKey key, @Nonnull io.axoniq.axonserver.grpc.MetaDataValue.Builder value) Creates a newProcessingInstruction.Builderwith the givenkeyandvalue.- Parameters:
key- TheProcessingKeyto set on theProcessingInstruction.Buildervalue- TheMetaDataValue.Builderto set on theProcessingInstruction.Builder.- Returns:
- A
ProcessingInstruction.Builderinitialized with the givenkeyandvalue.
-
createProcessingInstruction
public static io.axoniq.axonserver.grpc.ProcessingInstruction.Builder createProcessingInstruction(@Nonnull io.axoniq.axonserver.grpc.ProcessingKey key, @Nonnull String value) Creates a newProcessingInstruction.Builderwith the givenkeyandvalue.- Parameters:
key- TheProcessingKeyto set on theProcessingInstruction.Builder.value- TheStringvalue to set in theMetaDataValue.Builder, which is then used to initialize theProcessingInstruction.Builder.- Returns:
- A
ProcessingInstruction.Builderinitialized with the providedkeyandvalue. - See Also:
-
createProcessingInstruction
public static io.axoniq.axonserver.grpc.ProcessingInstruction.Builder createProcessingInstruction(@Nonnull io.axoniq.axonserver.grpc.ProcessingKey key, boolean value) Creates a newProcessingInstruction.Builderwith the givenkeyandvalue.- Parameters:
key- TheProcessingKeyto set on theProcessingInstruction.Builder.value- Abooleanvalue used to initialize theMetaDataValue.Builder, which is then set on theProcessingInstruction.Builder.- Returns:
- A
ProcessingInstruction.Builderinitialized with the providedkeyandvalue. - See Also:
-
createProcessingInstruction
public static io.axoniq.axonserver.grpc.ProcessingInstruction.Builder createProcessingInstruction(@Nonnull io.axoniq.axonserver.grpc.ProcessingKey key, long value) Creates a newProcessingInstruction.Builderwith the givenkeyandvalue.- Parameters:
key- TheProcessingKeyto set on theProcessingInstruction.Builder.value- Thelongvalue to set in theMetaDataValue.Builder, which is then used to initialize theProcessingInstruction.Builder.- Returns:
- A
ProcessingInstruction.Builderinitialized with the providedkeyandvalue. - See Also:
-
routingKey
public static String routingKey(@Nonnull List<io.axoniq.axonserver.grpc.ProcessingInstruction> instructions) Retrieve the routing key as aStringfrom the giveninstructions, by searching for theProcessingInstructionwho's key equals theProcessingKey.ROUTING_KEY. -
priority
public static int priority(@Nonnull List<io.axoniq.axonserver.grpc.ProcessingInstruction> instructions) Retrieve the priority as aintfrom the giveninstructions, by searching for theProcessingInstructionwho's key equals theProcessingKey.PRIORITY.- Parameters:
instructions- AListofProcessingInstructions to retrieve theProcessingKey.PRIORITYfrom.- Returns:
- An
intspecifying the priority of a given operation.
-
numberOfResults
public static long numberOfResults(@Nonnull List<io.axoniq.axonserver.grpc.ProcessingInstruction> instructions) Retrieve the desired 'number of results' as alongfrom the giveninstructions, by searching for theProcessingInstructionwho's key equals theProcessingKey.NR_OF_RESULTS.- Parameters:
instructions- AListofProcessingInstructions to retrieve theProcessingKey.NR_OF_RESULTSfrom.- Returns:
- A
longspecifying the desired 'number of results' for a given operation.
-
axonServerSupportsQueryStreaming
public static boolean axonServerSupportsQueryStreaming(@Nonnull List<io.axoniq.axonserver.grpc.ProcessingInstruction> instructions) Retrieve whether Axon Server supports streaming from the giveninstructions, by searching for the value ofProcessingKey.SERVER_SUPPORTS_STREAMING.- Parameters:
instructions- AListofProcessingInstructions to retrieve theProcessingKey.SERVER_SUPPORTS_STREAMINGfrom.- Returns:
trueif Axon Server supports streaming,falseotherwise.
-
clientSupportsQueryStreaming
public static boolean clientSupportsQueryStreaming(@Nonnull List<io.axoniq.axonserver.grpc.ProcessingInstruction> instructions) Retrieve whether Client (query issuer) supports streaming from the giveninstructions, by searching for the value ofProcessingKey.CLIENT_SUPPORTS_STREAMING.- Parameters:
instructions- AListofProcessingInstructions to retrieve theProcessingKey.CLIENT_SUPPORTS_STREAMINGfrom.- Returns:
trueif Client supports streaming,falseotherwise.
-
timeout
public static long timeout(@Nonnull List<io.axoniq.axonserver.grpc.ProcessingInstruction> instructions) Retrieve the desired 'number of results' as alongfrom the giveninstructions, by searching for theProcessingInstructionwho's key equals theProcessingKey.NR_OF_RESULTS.- Parameters:
instructions- AListofProcessingInstructions to retrieve theProcessingKey.NR_OF_RESULTSfrom.- Returns:
- a
longspecifying the desired 'number of results' for a given operation
-