class 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
- All
Instance Constructors
-
new
CommandService(componentLocation: AkkaLocation)(implicit actorSystem: ActorSystem[_])
- componentLocation
csw.messages.location.AkkaLocation of the component
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
- implicit val actorSystem: ActorSystem[_]
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
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()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
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
-
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
-
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
-
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 usingsubscribe
API.- controlCommand
the csw.messages.commands.ControlCommand payload
- returns
a CommandResponse as a Future value
-
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 usingsubscribe
API.- controlCommands
the set of csw.messages.commands.ControlCommand payloads
- returns
a Source of CommandResponse as a stream of CommandResponses for all commands
-
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
-
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
-
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
-
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 FutureSubmit 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
-
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
-
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
-
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
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )