Package io.cloudstate.javasupport
Interface ClientActionContext
-
- All Superinterfaces:
Context
- All Known Subinterfaces:
CommandContext,CommandContext,StreamedCommandContext<Output>,SubscriptionContext
public interface ClientActionContext extends Context
Context that provides client actions, which include failing and forwarding.These contexts are typically made available in response to commands.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.RuntimeExceptionfail(java.lang.String errorMessage)Fail the command with the given message.voidforward(ServiceCall to)Instruct the proxy to forward handling of this command to another entity served by this stateful function.-
Methods inherited from interface io.cloudstate.javasupport.Context
serviceCallFactory
-
-
-
-
Method Detail
-
fail
java.lang.RuntimeException fail(java.lang.String errorMessage)
Fail the command with the given message.- Parameters:
errorMessage- The error message to send to the client.
-
forward
void forward(ServiceCall to)
Instruct the proxy to forward handling of this command to another entity served by this stateful function.The command will be forwarded after successful completion of handling this command, including any persistence that this command does.
ServiceCallinstances can be created using theServiceCallFactoryobtained from any (including this) contextsContext.serviceCallFactory()method.- Parameters:
to- The service call to forward command processing to.
-
-