Package csw.command.client
Class CommandResponseManager
- java.lang.Object
-
- csw.command.client.CommandResponseManager
-
public class CommandResponseManager extends java.lang.Object
Wrapper API for interacting with Command Response Manager of a componentparam: commandResponseManagerActor underlying actor managing command responses, completion of command, caching responses for command, etc. param: actorSystem actor system for managing stream resources inside
-
-
Constructor Summary
Constructors Constructor Description CommandResponseManager(akka.actor.typed.ActorRef<CommandResponseManagerMessage> commandResponseManagerActor, akka.actor.typed.ActorSystem<?> actorSystem)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description akka.actor.typed.ActorSystem<?>
actorSystem()
void
addOrUpdateCommand(CommandResponse.SubmitResponse cmdStatus)
Add a new command or update an existing command with the provided statusvoid
addSubCommand(Id parentRunId, Id childRunId)
Add a new sub command against another commandakka.actor.typed.ActorRef<CommandResponseManagerMessage>
commandResponseManagerActor()
java.util.concurrent.CompletableFuture<CommandResponse.QueryResponse>
jQuery(Id runId, akka.util.Timeout timeout)
A helper method for Java to query the current status of a commandjava.util.concurrent.CompletableFuture<CommandResponse.SubmitResponse>
jQueryFinal(Id runId, akka.util.Timeout timeout)
A helper method for java to query the final status of a commandscala.concurrent.Future<CommandResponse.QueryResponse>
query(Id runId, akka.util.Timeout timeout)
Query the current status of a commandscala.concurrent.Future<CommandResponse.SubmitResponse>
queryFinal(Id runId, akka.util.Timeout timeout)
Query the final status of a commandvoid
updateSubCommand(CommandResponse.SubmitResponse cmdStatus)
Update the status of a sub-command which will infer the status of the parent command
-
-
-
Constructor Detail
-
CommandResponseManager
public CommandResponseManager(akka.actor.typed.ActorRef<CommandResponseManagerMessage> commandResponseManagerActor, akka.actor.typed.ActorSystem<?> actorSystem)
-
-
Method Detail
-
actorSystem
public akka.actor.typed.ActorSystem<?> actorSystem()
-
addOrUpdateCommand
public void addOrUpdateCommand(CommandResponse.SubmitResponse cmdStatus)
Add a new command or update an existing command with the provided status- Parameters:
cmdStatus
- status of command asCommandResponse.SubmitResponse
-
addSubCommand
public void addSubCommand(Id parentRunId, Id childRunId)
Add a new sub command against another command- Parameters:
parentRunId
- command identifier of original commandchildRunId
- command identifier of sub command
-
commandResponseManagerActor
public akka.actor.typed.ActorRef<CommandResponseManagerMessage> commandResponseManagerActor()
-
jQuery
public java.util.concurrent.CompletableFuture<CommandResponse.QueryResponse> jQuery(Id runId, akka.util.Timeout timeout)
A helper method for Java to query the current status of a command- Parameters:
runId
- command identifier of commandtimeout
- timeout duration until which this operation is expected to wait for providing a value- Returns:
- a future of CommandResponse
-
jQueryFinal
public java.util.concurrent.CompletableFuture<CommandResponse.SubmitResponse> jQueryFinal(Id runId, akka.util.Timeout timeout)
A helper method for java to query the final status of a command- Parameters:
runId
- command identifier of commandtimeout
- timeout duration until which this operation is expected to wait for providing a value- Returns:
- a CompletableFuture of CommandResponse
-
query
public scala.concurrent.Future<CommandResponse.QueryResponse> query(Id runId, akka.util.Timeout timeout)
Query the current status of a command- Parameters:
runId
- command identifier of commandtimeout
- timeout duration until which this operation is expected to wait for providing a value- Returns:
- a future of CommandResponse
-
queryFinal
public scala.concurrent.Future<CommandResponse.SubmitResponse> queryFinal(Id runId, akka.util.Timeout timeout)
Query the final status of a command- Parameters:
runId
- command identifier of commandtimeout
- timeout duration until which this operation is expected to wait for providing a value- Returns:
- a future of CommandResponse
-
updateSubCommand
public void updateSubCommand(CommandResponse.SubmitResponse cmdStatus)
Update the status of a sub-command which will infer the status of the parent command- Parameters:
cmdStatus
- status of command asCommandResponse.SubmitResponse
-
-