Package io.cloudstate.javasupport.crdt
Interface CommandContext
-
- All Superinterfaces:
ClientActionContext,Context,CrdtContext,CrdtFactory,EffectContext,EntityContext
- All Known Subinterfaces:
StreamedCommandContext<Output>
public interface CommandContext extends CrdtContext, CrdtFactory, EffectContext, ClientActionContext
Context for handling a command.This may be passed to any
CommandHandlerannotated element.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description longcommandId()The id of the command.java.lang.StringcommandName()The name of the command.voiddelete()Delete the CRDT.-
Methods inherited from interface io.cloudstate.javasupport.ClientActionContext
fail, forward
-
Methods inherited from interface io.cloudstate.javasupport.Context
serviceCallFactory
-
Methods inherited from interface io.cloudstate.javasupport.crdt.CrdtContext
state
-
Methods inherited from interface io.cloudstate.javasupport.crdt.CrdtFactory
newFlag, newGCounter, newGSet, newLWWRegister, newORMap, newORSet, newPNCounter, newVote
-
Methods inherited from interface io.cloudstate.javasupport.EffectContext
effect, effect
-
Methods inherited from interface io.cloudstate.javasupport.EntityContext
entityId
-
-
-
-
Method Detail
-
commandId
long commandId()
The id of the command. This is an internal ID generated by the proxy, and is unique to a given entity stream. It may be used for debugging purposes.- Returns:
- The ID of the command.
-
commandName
java.lang.String commandName()
The name of the command.Corresponds to the name of the rpc call in the protobuf definition.
- Returns:
- The name of the command.
-
delete
void delete()
Delete the CRDT.When a CRDT is deleted, it may not be created again. Additionally, CRDT deletion results in tombstones that get accumulated for the life of the cluster. If you expect to delete CRDTs frequently, it's recommended that you store them in a single or sharded
ORMap, rather than individual CRDTs.
-
-