Package org.glassfish.api.admin
Interface CommandInvocation<T extends Job>
- Type Parameters:
T- ConcreteJobtype 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 Summary
Modifier and TypeMethodDescriptioncreateJob(AdminCommand command) Creates a job to be executed/execute()Executes the command and populate the report with the command execution result.execute(AdminCommand command) Executes the passed command with this context and populates the report with the execution result.voidexecute(AdminCommand command, T job) Executes the passed command with this context and populates the report with the execution result.inbound(Payload.Inbound inbound) Sets the data carried with the request (could be an attachment)booleanoutbound(Payload.Outbound outbound) Sets the data carried with the responseparameters(CommandParameters params) Sets the command parameters as a typed intefaceparameters(ParameterMap params) Sets the command parameters as a ParameterMap.RegisterProgressStatuslistener.report()voidstart(AdminCommand command, T job) Schedules the invocation as an asynchronous job.
-
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 forparameters()
-
isDetached
boolean isDetached()- Returns:
- true to run the command asynchronously. User then can use the
attachcommand to access results.
-
parameters
Sets the command parameters as a typed inteface- Parameters:
params- the parameters- Returns:
- itself
-
parameters
Sets the command parameters as a ParameterMap.- Parameters:
params- the parameters- Returns:
- itself
-
inbound
Sets the data carried with the request (could be an attachment)- Parameters:
inbound- inbound data- Returns:
- itself
-
outbound
Sets the data carried with the response- Parameters:
outbound- outbound data- Returns:
- itself
-
progressStatus
RegisterProgressStatuslistener. 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:
AdminCommandevaluated using its name etc.
-
createJob
Creates a job to be executed/- Parameters:
command-- Returns:
- new job to be executed.
-
start
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:
Jobor null for non existing command.
-
execute
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:
Jobor null for non existing command.
-
execute
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.
-