Class CommandProcessorImpl<T extends UnifiedRecordValue>
java.lang.Object
io.camunda.zeebe.engine.processing.streamprocessor.CommandProcessorImpl<T>
- Type Parameters:
T- the record value type
- All Implemented Interfaces:
CommandProcessor.CommandControl<T>,TypedRecordProcessor<T>
public final class CommandProcessorImpl<T extends UnifiedRecordValue>
extends Object
implements TypedRecordProcessor<T>, CommandProcessor.CommandControl<T>
Decorates a command processor with simple accept and reject logic.
On accept it writes the state corresponding to successfully processing the command (e.g. process instance creation: CREATE => CREATED); and responds if it was a client command that should be responded to.
On reject it writes a command rejection
-
Constructor Summary
ConstructorsConstructorDescriptionCommandProcessorImpl(CommandProcessor<T> commandProcessor, KeyGenerator keyGenerator, Writers writers) -
Method Summary
Modifier and TypeMethodDescriptionlongvoidprocessRecord(TypedRecord<T> command, LegacyTypedResponseWriter responseWriter, LegacyTypedStreamWriter streamWriter, Consumer<SideEffectProducer> sideEffect) voidreject(RejectionType type, String reason) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.camunda.zeebe.engine.processing.streamprocessor.TypedRecordProcessor
processRecord, processRecord, processRecord
-
Constructor Details
-
CommandProcessorImpl
public CommandProcessorImpl(CommandProcessor<T> commandProcessor, KeyGenerator keyGenerator, Writers writers)
-
-
Method Details
-
processRecord
public void processRecord(TypedRecord<T> command, LegacyTypedResponseWriter responseWriter, LegacyTypedStreamWriter streamWriter, Consumer<SideEffectProducer> sideEffect) - Specified by:
processRecordin interfaceTypedRecordProcessor<T extends UnifiedRecordValue>- See Also:
-
accept
- Specified by:
acceptin interfaceCommandProcessor.CommandControl<T extends UnifiedRecordValue>- Returns:
- the key of the entity
-
reject
- Specified by:
rejectin interfaceCommandProcessor.CommandControl<T extends UnifiedRecordValue>
-