Package com.ibm.wsspi.collective.plugins
Interface TaskStorage
public interface TaskStorage
A storage service that is used by the
CollectiveExecutor and
can be exploited by other services as well.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringTimestamp (long) for the completion of a task.static final StringThe hostname (String) of the Collective Controller.static final StringThe https port (as a String) of the Collective Controller.static final StringTimestamp (long) for the creation of a task.static final StringKept for backwards compatibility.static final StringA Map<String,String> of environment variables to be set into the remote session.static final StringThe absolute location (String) of the file to be deleted.static final StringA boolean flag indicating if the upload source needs to be deleted after uploaded.static final StringThe raw postTransferAction string from the request header.static final StringThe postTransferActions array is the array of actions to perform, as specified by the postTransferAction header.static final StringThe raw postTransferActionOptions string from the request header.static final StringThe postTransferActionOptions array is the array of action options, as specified by the postTransferActionOption header.static final StringThe preTransferActions array is the array of actions to perform, as specified by the preTransferAction header.static final StringThe preTransferActionOptions array is the array of action options, as specified by the preTransferActionOption header.static final StringA boolean flag indicating if the delete operation of the task should be recursive.static final StringThe current status (String) of the task.static final StringTransfer credentials is a Map<String,String> with attributes from the CollectiveRegistrationMBean.static final StringThe name (String) of the uploaded + expanded archive.static final StringAn absolute location (String) of the source file that will be uploaded.static final StringAn absolute location (String) of the target upload directory.static final StringThe current user (String) of the task.static final StringThe completion status of a task or a host is failedstatic final StringThe status of a task or host is in progressstatic final StringThe status of a task or host has some successful and failed stepsstatic final StringThe initial status of a task or a hoststatic final StringThe successful completion status of a task or a host -
Method Summary
Modifier and TypeMethodDescriptionvoidaddHostResult(String token, String hostName, CommandResult commandResult) Add a result record to the specified task and hostcreateTask(String[] hostNames, Map<String, Object> properties) Create a new task in the task storagegetHostResult(String token, String hostName) Get a list of CommandResult object from a given task and hostgetHostStatus(String token, String hostName) Get the overall status of a host.String[]getTaskHostNames(String token) Get all the host names of a given taskgetTaskPropertyKeys(String token) Get all the property keys of a given taskgetTaskPropertyValue(String token, String key) Get the property value of a given task and keygetTaskStatus(String token) Get the overall status of a task.Get all task identifiers in the task storagevoidstartWorking(String token, String hostName) Declare the start of work for a given task and host.voidstopWorking(String token, String hostName) Signal the completion of the work for a given task and host.voidstopWorking(String token, String hostName, String status) Signal the completion of the work for a given task and host.
-
Field Details
-
STATUS_PENDING
The initial status of a task or a host- See Also:
-
STATUS_SUCCEEDED
The successful completion status of a task or a host- See Also:
-
STATUS_FAILED
The completion status of a task or a host is failed- See Also:
-
STATUS_IN_PROGRESS
The status of a task or host is in progress- See Also:
-
STATUS_PARTIAL_SUCCEEDED
The status of a task or host has some successful and failed steps- See Also:
-
KEY_TRANSFER_CREDENTIALS
Transfer credentials is a Map<String,String> with attributes from the CollectiveRegistrationMBean. Only credentials (user name, password, keys) are defined. The host and port attributes are not supported. Value could benull.- See Also:
-
KEY_ENV_VARS
A Map<String,String> of environment variables to be set into the remote session.- See Also:
-
KEY_POST_TRANSFER_ACTION
The raw postTransferAction string from the request header.- See Also:
-
KEY_PRE_TRANSFER_ACTION_ARRAY
The preTransferActions array is the array of actions to perform, as specified by the preTransferAction header. The array is the already parsed set of actions to perform. Value will be a non-null array, but may be empty.- See Also:
-
KEY_POST_TRANSFER_ACTION_ARRAY
The postTransferActions array is the array of actions to perform, as specified by the postTransferAction header. The array is the already parsed set of actions to perform. Value will be a non-null array, but may be empty.- See Also:
-
KEY_POST_TRANSFER_ACTION_OPTIONS
The raw postTransferActionOptions string from the request header.- See Also:
-
KEY_PRE_TRANSFER_ACTION_OPTIONS_ARRAY
The preTransferActionOptions array is the array of action options, as specified by the preTransferActionOption header. The array is the already parsed set of action options to perform. If there were no options specified, the value will benull. If options are specified, the length will be validated.- See Also:
-
KEY_POST_TRANSFER_ACTION_OPTIONS_ARRAY
The postTransferActionOptions array is the array of action options, as specified by the postTransferActionOption header. The array is the already parsed set of action options to perform. If there were no options specified, the value will benull. If options are specified, the length will be validated.- See Also:
-
KEY_CREATION_TIMESTAMP
Timestamp (long) for the creation of a task.- See Also:
-
KEY_COMPLETION_TIMESTAMP
Timestamp (long) for the completion of a task.- See Also:
-
KEY_UPLOAD_FROM_FILE
An absolute location (String) of the source file that will be uploaded.- See Also:
-
KEY_UPLOAD_TO_DIR
An absolute location (String) of the target upload directory.- See Also:
-
KEY_NEED_TO_DELETE_UPLOAD_SOURCE
A boolean flag indicating if the upload source needs to be deleted after uploaded.- See Also:
-
KEY_UPLOAD_EXPANSION_FILENAME
The name (String) of the uploaded + expanded archive.- See Also:
-
KEY_CONTROLLER_HOST
The hostname (String) of the Collective Controller.- See Also:
-
KEY_CONTROLLER_PORT
The https port (as a String) of the Collective Controller.- See Also:
-
KEY_USER
The current user (String) of the task.- See Also:
-
KEY_STATUS
The current status (String) of the task.- See Also:
-
KEY_RECURSIVE_DELETE
A boolean flag indicating if the delete operation of the task should be recursive.- See Also:
-
KEY_FILE_TO_DELETE
The absolute location (String) of the file to be deleted.- See Also:
-
KEY_DELETE_SOURCE
Kept for backwards compatibility. UseKEY_NEED_TO_DELETE_UPLOAD_SOURCE.- See Also:
-
-
Method Details
-
createTask
Create a new task in the task storage- Parameters:
hostNames- An array of host names to run this task onproperties- Properties of the task- Returns:
- An unique task identifier in String
-
getTaskTokens
Get all task identifiers in the task storage- Parameters:
filter- A set of filter entries, or null for no filtering.- Returns:
- A set of task identifiers in String
-
getTaskPropertyKeys
Get all the property keys of a given task- Parameters:
token- Task identifier- Returns:
- A set of keys in String
-
getTaskHostNames
Get all the host names of a given task- Parameters:
token- Task identifier- Returns:
- An array of host names to run this task on
-
getTaskPropertyValue
Get the property value of a given task and key- Parameters:
token- Task identifierkey- The key of the property- Returns:
- The value of the property
-
getTaskStatus
Get the overall status of a task. A task may be run on many hosts. Each host will have its own overall status. The status of a task represents the overall result of a task.- Parameters:
token- Task identifier- Returns:
- The status in String
-
getHostStatus
Get the overall status of a host. A task may contain more than one step. The status of a host represents the overall status of all steps involved.- Parameters:
token- Task identifierhostName- Host name- Returns:
- The status in String
-
addHostResult
Add a result record to the specified task and host- Parameters:
token- Task identifierhostName- Host namecommandResult- The CommandResult object which holds the result
-
getHostResult
Get a list of CommandResult object from a given task and host- Parameters:
token- Task identifierhostName- Host name- Returns:
- A list of CommandResult object
-
startWorking
Declare the start of work for a given task and host. This method should be called before adding result for the given task and host. This method will change the status of the host to STATUS_IN_PROGRESS.- Parameters:
token- Task identifierhostName- Host name
-
stopWorking
Signal the completion of the work for a given task and host. This method should be called after adding the last result for the given task and host. This method will change the status of the host to STATUS_SUCCEEDED.- Parameters:
token- Task identifierhostName- Host name
-
stopWorking
Signal the completion of the work for a given task and host. This method should be called after adding the last result for the given task and host.- Parameters:
token- Task identifierhostName- Host namestatus- The completion status of the host. If null is specified, the status will be changed to STATUS_SUCCEEDED.
-