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>
,StreamProcessorLifecycleAware
,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
ConstructorDescriptionCommandProcessorImpl
(CommandProcessor<T> commandProcessor, KeyGenerator keyGenerator, Writers writers) -
Method Summary
Modifier and TypeMethodDescriptionlong
void
processRecord
(TypedRecord<T> command, TypedResponseWriter responseWriter, TypedStreamWriter streamWriter, Consumer<SideEffectProducer> sideEffect) void
reject
(RejectionType type, String reason) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.camunda.zeebe.engine.processing.streamprocessor.StreamProcessorLifecycleAware
onClose, onFailed, onPaused, onRecovered, onResumed
Methods inherited from interface io.camunda.zeebe.engine.processing.streamprocessor.TypedRecordProcessor
processRecord, processRecord
-
Constructor Details
-
CommandProcessorImpl
public CommandProcessorImpl(CommandProcessor<T> commandProcessor, KeyGenerator keyGenerator, Writers writers)
-
-
Method Details
-
processRecord
public void processRecord(TypedRecord<T> command, TypedResponseWriter responseWriter, TypedStreamWriter streamWriter, Consumer<SideEffectProducer> sideEffect) - Specified by:
processRecord
in interfaceTypedRecordProcessor<T extends UnifiedRecordValue>
- See Also:
-
accept
- Specified by:
accept
in interfaceCommandProcessor.CommandControl<T extends UnifiedRecordValue>
- Returns:
- the key of the entity
-
reject
- Specified by:
reject
in interfaceCommandProcessor.CommandControl<T extends UnifiedRecordValue>
-