Packages

  • package root
    Definition Classes
    root
  • package csw
    Definition Classes
    root
  • package services
    Definition Classes
    csw
  • package command

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

    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-prod/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-prod/framework/handling-lifecycle.html#handling-commands

    Important classes in this project are:

    - csw.services.command.CommandResponseManager

    This class wraps CommandResponseManagerActor and provides helpers to interact with actor which is responsible for adding/updating/querying command result. Component writers will get handle to CommandResponseManager in their handlers.

    - csw.services.command.internal.CommandResponseManagerBehavior maintains two states:

    • csw.messages.commands.CommandResponseManagerState: It maintains csw.messages.params.models.Id of Commands and their corresponding csw.messages.commands.CommandState.
    • csw.messages.commands.CommandCorrelation : It maintains commands csw.messages.params.models.Id correlation between parent to child and child to parent.

    - csw.services.command.scaladsl.CommandService

    This class wraps the csw.messages.location.AkkaLocation 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.

    - csw.services.command.scaladsl.CommandDistributor

    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-prod/command.html

    Definition Classes
    services
  • package scaladsl
    Definition Classes
    command
  • CommandDistributor
  • CommandResponseSubscription
  • CommandService
  • CurrentStateSubscription
c

csw.services.command.scaladsl

CommandService

class CommandService extends AnyRef

A Command Service API of a csw component. This model provides method based APIs for command interactions with a component.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. CommandService
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new CommandService(componentLocation: AkkaLocation)(implicit actorSystem: ActorSystem[_])

    componentLocation

    csw.messages.location.AkkaLocation of the component

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. implicit val actorSystem: ActorSystem[_]
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  12. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  13. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  15. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  16. def oneway(controlCommand: ControlCommand)(implicit timeout: Timeout): Future[CommandResponse]

    Send a command as a Oneway and get a csw.messages.commands.CommandResponse as a Future.

    Send a command as a Oneway and get a csw.messages.commands.CommandResponse as a Future. The CommandResponse can be a response of validation (Accepted, Invalid) or a final Response.

    controlCommand

    the csw.messages.commands.ControlCommand payload

    returns

    a CommandResponse as a Future value

  17. def onewayAndMatch(controlCommand: ControlCommand, stateMatcher: StateMatcher)(implicit timeout: Timeout): Future[CommandResponse]

    Submit a command and match the published state from the component using a csw.messages.commands.matchers.StateMatcher.

    Submit a command and match the published state from the component using a csw.messages.commands.matchers.StateMatcher. If the match is successful a Completed response is provided as a future. In case of a failure or unmatched state, Error CommandResponse is provided as a Future.

    controlCommand

    the csw.messages.commands.ControlCommand payload

    stateMatcher

    the StateMatcher implementation for matching received state against a demand state

    returns

    a CommandResponse as a Future value

  18. def query(commandRunId: Id)(implicit timeout: Timeout): Future[CommandResponse]

    Query for the result of a long running command which was sent as Submit to get a csw.messages.commands.CommandResponse as a Future

    Query for the result of a long running command which was sent as Submit to get a csw.messages.commands.CommandResponse as a Future

    commandRunId

    the runId of the command for which response is required

    returns

    a CommandResponse as a Future value

  19. def submit(controlCommand: ControlCommand)(implicit timeout: Timeout): Future[CommandResponse]

    Submit a command and get a csw.messages.commands.CommandResponse as a Future.

    Submit a command and get a csw.messages.commands.CommandResponse as a Future. The CommandResponse can be a response of validation (Accepted, Invalid) or a final Response. In case of response as Accepted, final CommandResponse can be obtained by using subscribe API.

    controlCommand

    the csw.messages.commands.ControlCommand payload

    returns

    a CommandResponse as a Future value

  20. def submitAll(controlCommands: Set[ControlCommand])(implicit timeout: Timeout): Source[CommandResponse, NotUsed]

    Submit multiple commands and get a Source of csw.messages.commands.CommandResponse for all commands.

    Submit multiple commands and get a Source of csw.messages.commands.CommandResponse for all commands. The CommandResponse can be a response of validation (Accepted, Invalid) or a final Response. In case of response as Accepted, final CommandResponse can be obtained by using subscribe API.

    controlCommands

    the set of csw.messages.commands.ControlCommand payloads

    returns

    a Source of CommandResponse as a stream of CommandResponses for all commands

  21. def submitAllAndGetFinalResponse(controlCommands: Set[ControlCommand])(implicit timeout: Timeout): Future[CommandResponse]

    Submit multiple commands and get final CommandResponse for all as one CommandResponse.

    Submit multiple commands and get final CommandResponse for all as one CommandResponse. If all the commands were successful, a CommandResponse as csw.messages.commands.CommandResponse.Completed will be returned. If any one of the command fails, an csw.messages.commands.CommandResponse.Error will be returned. For long running commands, it will subscribe for the result of those which were successfully validated as Accepted and get the final CommandResponse.

    controlCommands

    the csw.messages.commands.ControlCommand payload

    returns

    a CommandResponse as a Future value

  22. def submitAllAndGetResponse(controlCommands: Set[ControlCommand])(implicit timeout: Timeout): Future[CommandResponse]

    Submit multiple commands and get one CommandResponse as a Future of csw.messages.commands.CommandResponse for all commands.

    Submit multiple commands and get one CommandResponse as a Future of csw.messages.commands.CommandResponse for all commands. If all the commands were successful, a CommandResponse as csw.messages.commands.CommandResponse.Completed will be returned. If any one of the command fails, an csw.messages.commands.CommandResponse.Error will be returned.

    controlCommands

    the set of csw.messages.commands.ControlCommand payloads

    returns

    csw.messages.commands.CommandResponse.Accepted or csw.messages.commands.CommandResponse.Error CommandResponse as a Future

  23. def submitAllAndSubscribe(controlCommands: Set[ControlCommand])(implicit timeout: Timeout): Source[CommandResponse, NotUsed]

    Submit multiple commands and get final CommandResponse for all as a stream of CommandResponse.

    Submit multiple commands and get final CommandResponse for all as a stream of CommandResponse. For long running commands, it will subscribe for the result of those which were successfully validated as Accepted and get the final CommandResponse.

    controlCommands

    the csw.messages.commands.ControlCommand payload

    returns

    a Source of CommandResponse as a stream of CommandResponses for all commands

  24. def submitAndSubscribe(controlCommand: ControlCommand)(implicit timeout: Timeout): Future[CommandResponse]

    Submit a command and Subscribe for the result if it was successfully validated as Accepted to get a final csw.messages.commands.CommandResponse as a Future

    Submit a command and Subscribe for the result if it was successfully validated as Accepted to get a final csw.messages.commands.CommandResponse as a Future

    controlCommand

    the csw.messages.commands.ControlCommand payload

    returns

    a CommandResponse as a Future value

  25. def subscribe(commandRunId: Id)(implicit timeout: Timeout): Future[CommandResponse]

    Subscribe for the result of a long running command which was sent as Submit to get a csw.messages.commands.CommandResponse as a Future

    Subscribe for the result of a long running command which was sent as Submit to get a csw.messages.commands.CommandResponse as a Future

    commandRunId

    the runId of the command for which response is required

    returns

    a CommandResponse as a Future value

  26. def subscribeCurrentState(callback: (CurrentState) ⇒ Unit): CurrentStateSubscription

    Subscribe to the current state of a component corresponding to the csw.messages.location.AkkaLocation of the component

    Subscribe to the current state of a component corresponding to the csw.messages.location.AkkaLocation of the component

    callback

    the action to be applied on the CurrentState element received as a result of subscription

    returns

    a CurrentStateSubscription to stop the subscription

  27. def subscribeOnlyCurrentState(names: Set[StateName], callback: (CurrentState) ⇒ Unit): CurrentStateSubscription

    Subscribe to the current state of a component corresponding to the csw.messages.location.AkkaLocation of the component

    Subscribe to the current state of a component corresponding to the csw.messages.location.AkkaLocation of the component

    names

    subscribe to only those states which have any of the the provided value for name

    callback

    the action to be applied on the CurrentState element received as a result of subscription

    returns

    a CurrentStateSubscription to stop the subscription

  28. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  29. def toString(): String
    Definition Classes
    AnyRef → Any
  30. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped