Interface CommandInvocation<T extends Job>

Type Parameters:
T - Concrete Job type managed by this invocation.

public interface CommandInvocation<T extends Job>
CommandInvocation defines a command excecution context like the requested name of the command to execute, the parameters of the command, etc...
  • Method Details

    • getCommandName

      String getCommandName()
      Returns:
      the command name. For the life of this invocation it never changes.
    • parameters

      ParameterMap parameters()
      Returns:
      ParameterMap, never null, but may be empty
    • typedParams

      CommandParameters typedParams()
      Returns:
      CommandParameters, usually null, it can be used as an alternative for parameters()
    • isDetached

      boolean isDetached()
      Returns:
      true to run the command asynchronously. User then can use the attach command to access results.
    • parameters

      CommandInvocation<T> parameters(CommandParameters params)
      Sets the command parameters as a typed inteface
      Parameters:
      params - the parameters
      Returns:
      itself
    • parameters

      CommandInvocation<T> parameters(ParameterMap params)
      Sets the command parameters as a ParameterMap.
      Parameters:
      params - the parameters
      Returns:
      itself
    • inbound

      CommandInvocation<T> inbound(Payload.Inbound inbound)
      Sets the data carried with the request (could be an attachment)
      Parameters:
      inbound - inbound data
      Returns:
      itself
    • outbound

      CommandInvocation<T> outbound(Payload.Outbound outbound)
      Sets the data carried with the response
      Parameters:
      outbound - outbound data
      Returns:
      itself
    • progressStatus

      CommandInvocation<T> progressStatus(ProgressStatus ps)
      Register ProgressStatus listener. Usable for command from command execution.
      Parameters:
      ps -
      Returns:
      this
    • inboundPayload

      Payload.Inbound inboundPayload()
    • outboundPayload

      Payload.Outbound outboundPayload()
    • progressStatus

      ProgressStatus progressStatus()
    • report

      ActionReport report()
      Returns:
      Current report. After command execution report can be changed by command
    • evaluateCommand

      AdminCommand evaluateCommand()
      Returns:
      AdminCommand evaluated using its name etc.
    • createJob

      T createJob(AdminCommand command)
      Creates a job to be executed/
      Parameters:
      command -
      Returns:
      new job to be executed.
    • start

      void start(AdminCommand command, T job)
      Schedules the invocation as an asynchronous job.
    • execute

      T execute()
      Executes the command and populate the report with the command execution result. Parameters must have been set before invoking this method.

      Command is evaluated using HK2 and command name.

      Returns:
      Job or null for non existing command.
    • execute

      T execute(AdminCommand command)
      Executes the passed command with this context and populates the report with the execution result. Parameters must be set before invoking this command.
      Parameters:
      command - command implementation to execute. Cannot be null.
      Returns:
      Job or null for non existing command.
    • execute

      void execute(AdminCommand command, T job)
      Executes the passed command with this context and populates the report with the execution result. Parameters must be set before invoking this command.
      Parameters:
      command - command implementation to execute. Cannot be null.
      job - Job, cannot be null.