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