trait CommandService extends AnyRef
A Command Service API of a csw component. This model provides method based APIs for command interactions with a component.
- Alphabetic
- By Inheritance
- CommandService
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def oneway(controlCommand: ControlCommand): Future[OnewayResponse]
Send a command as a Oneway and get a csw.params.commands.CommandResponse.OnewayResponse as a Future.
Send a command as a Oneway and get a csw.params.commands.CommandResponse.OnewayResponse as a Future. The OnewayResponse can be a response of validation (Accepted, Invalid) or Locked. The use of oneway is the highest performance command interaction. It is used when completion, if needed at all, is provided through CurrentState or status values and Event Service. See also onewayAndMatch
- controlCommand
the csw.params.commands.ControlCommand payload
- returns
a OnewayResponse as a Future value
- abstract def onewayAndMatch(controlCommand: ControlCommand, stateMatcher: StateMatcher): Future[MatchingResponse]
Submit a command and match the published state from the component using a csw.command.api.StateMatcher.
Submit a command and match the published state from the component using a csw.command.api.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.params.commands.ControlCommand payload
- stateMatcher
the StateMatcher implementation for matching received state against a demand state
- returns
a MatchingResponse as a Future value
- abstract def query(commandRunId: Id): Future[SubmitResponse]
Query for the result of a long running command which was sent as Submit to get a csw.params.commands.CommandResponse.SubmitResponse as a Future.
Query for the result of a long running command which was sent as Submit to get a csw.params.commands.CommandResponse.SubmitResponse as a Future. Query allows checking to see if a long-running command is completed without waiting as with queryFinal.
- commandRunId
the runId of the command for which response is required
- returns
a SubmitResponse as a Future value
- abstract def queryFinal(commandRunId: Id)(implicit timeout: Timeout): Future[SubmitResponse]
Query for the final result of a long running command which was sent as Submit to get a csw.params.commands.CommandResponse.SubmitResponse as a Future
Query for the final result of a long running command which was sent as Submit to get a csw.params.commands.CommandResponse.SubmitResponse as a Future
- commandRunId
the runId of the command for which response is required
- timeout
max-time to wait for a final response
- returns
a SubmitResponse as a Future value
- abstract def submit(controlCommand: ControlCommand): Future[SubmitResponse]
Submit given command and returns csw.params.commands.CommandResponse.SubmitResponse as a Future
Submit given command and returns csw.params.commands.CommandResponse.SubmitResponse as a Future
- controlCommand
the csw.params.commands.ControlCommand payload
- returns
a SubmitResponse as a Future value
- abstract def submitAllAndWait(submitCommands: List[ControlCommand])(implicit timeout: Timeout): Future[List[SubmitResponse]]
Submit multiple commands and get a List of csw.params.commands.CommandResponse.SubmitResponse for all commands.
Submit multiple commands and get a List of csw.params.commands.CommandResponse.SubmitResponse 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 usingsubscribe
API.- submitCommands
the set of csw.params.commands.ControlCommand payloads
- timeout
max-time to wait for a final response
- returns
a future list of SubmitResponse, one for each command
- abstract def submitAndWait(controlCommand: ControlCommand)(implicit timeout: Timeout): Future[SubmitResponse]
Submit a command and Subscribe for the result if it was successfully validated as
Started
to get a final csw.params.commands.CommandResponse.SubmitResponse as a FutureSubmit a command and Subscribe for the result if it was successfully validated as
Started
to get a final csw.params.commands.CommandResponse.SubmitResponse as a Future- controlCommand
the csw.params.commands.ControlCommand payload
- timeout
max-time to wait for a final response
- returns
a SubmitResponse as a Future value
- abstract def subscribeCurrentState(names: Set[StateName], callback: (CurrentState) => Unit): Subscription
Subscribe to the current state of a component corresponding to the csw.location.api.models.AkkaLocation of the component
Subscribe to the current state of a component corresponding to the csw.location.api.models.AkkaLocation of the component
- names
subscribe to only those states which have any of the provided value for name
- callback
the action to be applied on the CurrentState element received as a result of subscription
- returns
a Subscription to stop the subscription
- Note
Callbacks are not thread-safe on the JVM. If you are doing side effects/mutations inside the callback, you should ensure that it is done in a thread-safe way inside an actor.
- abstract def subscribeCurrentState(callback: (CurrentState) => Unit): Subscription
Subscribe to the current state of a component corresponding to the csw.location.api.models.AkkaLocation of the component
Subscribe to the current state of a component corresponding to the csw.location.api.models.AkkaLocation of the component
- callback
the action to be applied on the CurrentState element received as a result of subscription
- returns
a Subscription to stop the subscription
- Note
Callbacks are not thread-safe on the JVM. If you are doing side effects/mutations inside the callback, you should ensure that it is done in a thread-safe way inside an actor.
- abstract def subscribeCurrentState(names: Set[StateName] = Set.empty): Source[CurrentState, Subscription]
Subscribe to the current state of a component corresponding to the csw.location.api.models.AkkaLocation of the component
Subscribe to the current state of a component corresponding to the csw.location.api.models.AkkaLocation of the component
- names
subscribe to states which have any of the provided value for name. If no states are provided, all the current states will be received.
- returns
a stream of current states with CurrentStateSubscription as the materialized value which can be used to stop the subscription
- abstract def validate(controlCommand: ControlCommand): Future[ValidateResponse]
Send a Validate command and get ValidateResponse as a Future.
Send a Validate command and get ValidateResponse as a Future. The ValidateResponse can be of type Accepted, Invalid or Locked.
- controlCommand
the csw.params.commands.ControlCommand payload
- returns
a ValidateResponse as a Future value
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])