ICommandService

csw.command.api.javadsl.ICommandService

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

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def oneway(controlCommand: ControlCommand): CompletableFuture[OnewayResponse]

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

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

Value parameters

controlCommand

the csw.params.commands.ControlCommand payload

Attributes

Returns

a CommandResponse as a Future value

def onewayAndMatch(controlCommand: ControlCommand, stateMatcher: StateMatcher): CompletableFuture[MatchingResponse]

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.

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.

Value parameters

controlCommand

the csw.params.commands.ControlCommand payload

stateMatcher

the StateMatcher implementation for matching received state against a demand state

Attributes

Returns

a MatchingResponse as a Future value

def query(commandRunId: Id): CompletableFuture[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

Value parameters

commandRunId

the runId of the command for which response is required

Attributes

Returns

a CommandResponse as a Future value

def queryFinal(commandRunId: Id, timeout: Timeout): CompletableFuture[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

Value parameters

commandRunId

the runId of the command for which response is required

Attributes

Returns

a CommandResponse as a Future value

def submit(controlCommand: ControlCommand): CompletableFuture[SubmitResponse]

Submit a command and return after first phase. If it returns as Started get a final csw.params.commands.CommandResponse.SubmitResponse as a Future with queryFinal.

Submit a command and return after first phase. If it returns as Started get a final csw.params.commands.CommandResponse.SubmitResponse as a Future with queryFinal.

Value parameters

controlCommand

the csw.params.commands.ControlCommand payload

Attributes

Returns

a CommandResponse as a Future value

def submitAllAndWait(submitCommands: List[ControlCommand], timeout: Timeout): CompletableFuture[List[SubmitResponse]]

Submit multiple commands and get a Source 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 using subscribe API.

Submit multiple commands and get a Source 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 using subscribe API.

Value parameters

submitCommands

the set of csw.params.commands.ControlCommand payloads

Attributes

Returns

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

def submitAndWait(controlCommand: ControlCommand, timeout: Timeout): CompletableFuture[SubmitResponse]

Submit a command and wait for the final result if it was successfully validated as Started to get a final csw.params.commands.CommandResponse.SubmitResponse as a Future

Submit a command and wait for the final result if it was successfully validated as Started to get a final csw.params.commands.CommandResponse.SubmitResponse as a Future

Value parameters

controlCommand

the csw.params.commands.ControlCommand payload

Attributes

Returns

a CommandResponse as a Future value

def subscribeCurrentState(): Source[CurrentState, Subscription]

Subscribe to all the current states of a component corresponding to the csw.location.api.models.PekkoLocation of the component

Subscribe to all the current states of a component corresponding to the csw.location.api.models.PekkoLocation of the component

Attributes

Returns

a stream of current states with Subscription as the materialized value which can be used to stop the subscription

def subscribeCurrentState(names: Set[StateName]): Source[CurrentState, Subscription]

Subscribe to the current state of a component corresponding to the csw.location.api.models.PekkoLocation of the component

Subscribe to the current state of a component corresponding to the csw.location.api.models.PekkoLocation of the component

Value parameters

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.

Attributes

Returns

a stream of current states with Subscription as the materialized value which can be used to stop the subscription

def subscribeCurrentState(callback: Consumer[CurrentState]): Subscription

Subscribe to the current state of a component corresponding to the csw.location.api.models.PekkoLocation of the component

Subscribe to the current state of a component corresponding to the csw.location.api.models.PekkoLocation of the component

Note that 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.

Value parameters

callback

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

Attributes

Returns

a Subscription to stop the subscription

def subscribeCurrentState(names: Set[StateName], callback: Consumer[CurrentState]): Subscription

Subscribe to the current state of a component corresponding to the csw.location.api.models.PekkoLocation of the component

Subscribe to the current state of a component corresponding to the csw.location.api.models.PekkoLocation of the component

Note that 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.

Value parameters

callback

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

names

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

Attributes

Returns

a Subscription to stop the subscription

def validate(controlCommand: ControlCommand): CompletableFuture[ValidateResponse]

Send a Validate command and get ValidateResponse as a Future. The ValidateResponse can be of type Accepted, Invalid or Locked.

Send a Validate command and get ValidateResponse as a Future. The ValidateResponse can be of type Accepted, Invalid or Locked.

Value parameters

controlCommand

the csw.params.commands.ControlCommand payload

Attributes

Returns

a ValidateResponse as a Future value