csw.command.client

== Command Service ==

This project defines the basic classes and traits for the ''Command Service''.

Related projects are:

  • '''csw-messages''':

  • This defines the types of command (Oneway/Submit etc.) and types of ''configurations'' (Setup/Observe/Wait etc.)

  • Complete usage of Messages is available at: https://tmtsoftware.github.io/csw/services/messages.html

  • '''framework''':

  • This defines the Hcd and Assembly handlers, lifecycle manager and supervisor for components.

  • Framework allows component writer to override onValidation, onSubmit and onOneway handlers. (Note it allows overriding other handlers as well.)

  • On every command received by component, onValidation handler gets invoked where received command gets validated and validation response is returned.

  • Based on validation response and command type, onSubmit/onOneway hooks gets invoked where command gets processed.

  • Complete details of handling commands can be found here : https://tmtsoftware.github.io/csw/framework/handling-lifecycle.html#handling-commands

Important classes in this project are:

This class wraps the csw.location.api.models.PekkoLocation and provides helpers to send commands to component actor extracted from provided location. Normal component writers workflow would be to first resolve component using location service and then create CommandService instance using resolved location.

Using this instance, you can Submit Command/Commands to other component or query for command result or subscribe for long running command result.

When you have multiple commands targeted to multiple components then you can use ConfigDistributor. Using CommandDistributor utility you can send all these commands in one go and get aggregated response.

Complete guide of usage of different API's provided by CommandService is available at: https://tmtsoftware.github.io/csw/command.html

Attributes

Members list

Type members

Classlikes

class CommandResponseManager(val commandResponseManagerActor: ActorRef[CRMMessage])(implicit val actorSystem: ActorSystem[_])

Wrapper API for interacting with Command Response Manager of a component

Wrapper API for interacting with Command Response Manager of a component

Value parameters

actorSystem

actor system for allowing sending messages in API

commandResponseManagerActor

underlying actor managing command responses for started commands

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
object MiniCRM

miniCRM is described here. miniCRM is designed to be a limited commandResponseManager, which encapsulates commands sent to one Assembly or HCD. A miniCRM supports the two CommandService methods called query and queryFinal. It keeps three list types: StartedList, ResponseList, and WaiterList StartedList: This is a list of commands that have returned Started by the handlers. They are still executing, having returned Started ResponseList: This is a list of SubmitResponses published by the component. This is called by the handlers when they publish the final SubmitResponse for a started command WaiterList: This is a list of queryFinal callers. The list contains tuples of (id, ActorRef[SubmitResponse]). Each entry is an actor waiting for the final response for the command with the given id.

miniCRM is described here. miniCRM is designed to be a limited commandResponseManager, which encapsulates commands sent to one Assembly or HCD. A miniCRM supports the two CommandService methods called query and queryFinal. It keeps three list types: StartedList, ResponseList, and WaiterList StartedList: This is a list of commands that have returned Started by the handlers. They are still executing, having returned Started ResponseList: This is a list of SubmitResponses published by the component. This is called by the handlers when they publish the final SubmitResponse for a started command WaiterList: This is a list of queryFinal callers. The list contains tuples of (id, ActorRef[SubmitResponse]). Each entry is an actor waiting for the final response for the command with the given id.

miniCRM is written in the "immutable" style so all state is passed between calls to new Behaviors

The ComponentBehavior only submits Started commands to the miniCRM when a Started is returned from a submit handler. When a Started SubmitResponse is received, miniCRM receives an AddStarted call from ComponentBehavior. Whenever the component publishes the final completion message, it calls AddResponse, which triggers calls to any waiters associated with the runId.

Query and QueryFinal are used by the CommandService to provide the status of a command. Both of these methods look within the three lists above for their responses. Note that miniCRM does not handle any other commands besides ones that return Started.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
MiniCRM.type
class SequencerCommandServiceImpl(sequencerLocation: PekkoLocation)(implicit actorSystem: ActorSystem[_]) extends SequencerCommandService

Create a SequencerCommandService for sending commands to sequencer

Create a SequencerCommandService for sending commands to sequencer

Value parameters

actorSystem

required for sending sequence commands or querying the sequencer

sequencerLocation

the destination sequencer location to which sequence needs to be sent

Attributes

Supertypes
class Object
trait Matchable
class Any