public class ExchangeFactory extends Object
ExchangeFactory
also incorporates functionality to access
various data elements within an exchange.Constructor and Description |
---|
ExchangeFactory() |
Modifier and Type | Method and Description |
---|---|
DeploymentMessage |
createDeploymentResponse(String jobIdentifier,
String taskIdentifier,
int exchangeSubType,
int conditionFlag,
String description)
Creates a deployment response, to a previously issued request.
|
DeploymentMessage |
createDeploymentStatusOrAbortRequest(String jobIdentifier,
String taskIdentifier,
String respondTo,
int exchangeSubType)
Creates a DeploymentMessage that is a request for either getting the
STATUS or ABORTing a previously deployment operation.
|
DeploymentMessage |
createDepoymentRequest(String jobIdentifier,
Operation operation,
String respondTo)
Creates a deployment request based on the specified parameters.
|
ExecutionStatus |
createExecutionStatusRequest(String jobIdentifier,
String taskIdentifier,
String respondTo)
Creates an
ExecutionStatus REQUEST based on the specified
parameters |
ExecutionStatus |
createExecutionStatusResponse(String jobIdentifier,
String taskIdentifier,
int conditionFlag,
String description,
TaskLifecycleMetrics taskLifecycleMetrics,
String respondTo)
Creates an
ExecutionStatus RESPONSE based on the specified
parameters |
ResourceDiscovery |
createResourceDiscoveryRequest(int resourceType,
String respondTo)
Create a ResourceDiscovery request
|
ResourceDiscovery |
createResourceDiscoveryResponse(int conditionFlag,
String description,
ResourceMetrics resourceMetrics,
String respondTo)
Creates a
ResourceDiscovery response |
DeploymentMessage |
getDeploymentMessage(byte[] exchangeBytes)
Reconstructs the Deployment Message from a stream of bytes
|
int |
getExchangeType(byte[] exchangeBytes)
Retrieves the exchange type information from a stream of bytes.
|
ExecutionStatus |
getExecutionStatus(byte[] exchangeBytes)
Reconstruct the execution status object from a byte[].
|
static ExchangeFactory |
getInstance()
Deprecated.
|
ResourceDiscovery |
getResourceDiscovery(byte[] exchangeBytes)
Reconstructs the
ResourceDiscovery from a stream of bytes |
boolean |
isValidExchangeType(int exchangeType)
Checks to see if a given exchange type is a valid one.
|
@Deprecated public static ExchangeFactory getInstance()
public boolean isValidExchangeType(int exchangeType)
exchangeType
- true
if the exchange is a valid one;
false
otherwise.public int getExchangeType(byte[] exchangeBytes)
exchangeBytes
- The marshalled representation of the exchangeMarshallingException
- if there are problems with the exchange bytespublic DeploymentMessage createDepoymentRequest(String jobIdentifier, Operation operation, String respondTo) throws DeploymentException
jobIdentifier
- The ID to be associated with the deploymentoperation
- The operation being deployedrespondTo
- The stream over which responses need to be sent.DeploymentException
- If problems are encountered with the specified parameters, or
if any of them are NULL.public DeploymentMessage createDeploymentStatusOrAbortRequest(String jobIdentifier, String taskIdentifier, String respondTo, int exchangeSubType) throws DeploymentException
jobIdentifier
- The ID to be associated with the deploymenttaskIdentifier
- The task identifier that was assigned to one of the constituent
tasks that comprises the system-wide deployment.respondTo
- The stream over which responses need to be sent.exchangeSubType
- This should be either the STATUS or ABORT exchange subTypes.DeploymentException
- If problems are encountered with the specified parameters, or if
any of them are NULL or if the exchangeSubType is something other
than DeploymentMessage.STATUS or DeploymentMessage.ABORTpublic DeploymentMessage createDeploymentResponse(String jobIdentifier, String taskIdentifier, int exchangeSubType, int conditionFlag, String description) throws DeploymentException
jobIdentifier
- The ID to be associated with the deploymenttaskIdentifier
- The task identifier that was assigned to one of the constituent
tasks that comprises the system-wide deployment.exchangeSubType
- Indicates whether this is a response to a previously issued
DEPLOY, STATUS or ABORTconditionFlag
- Indicates the status of processing the previously issued request.description
- A detailed description or reason for the responseDeploymentException
- If there are problems creating this exchange.public DeploymentMessage getDeploymentMessage(byte[] exchangeBytes) throws IOException, MarshallingException
exchangeBytes
- The marshalled representation of the exchangeDeploymentMessage
IOException
- If there are problems reconstructing elements of the exchangeMarshallingException
- If there are problems reconstructing specialized elements of
the exchangepublic ExecutionStatus createExecutionStatusRequest(String jobIdentifier, String taskIdentifier, String respondTo)
ExecutionStatus
REQUEST based on the specified
parametersjobIdentifier
- The job identifier that the task is a part oftaskIdentifier
- The identifier of the task in questionrespondTo
- The stream to which the responses should be sentpublic ExecutionStatus createExecutionStatusResponse(String jobIdentifier, String taskIdentifier, int conditionFlag, String description, TaskLifecycleMetrics taskLifecycleMetrics, String respondTo)
ExecutionStatus
RESPONSE based on the specified
parametersjobIdentifier
- The job identifier that the task is a part oftaskIdentifier
- The identifier of the task in questionconditionFlag
- The status of the execution (based on constants in the
ConditionFlag
)description
- A description of the responsetaskLifecycleMetrics
- The metrics associated with the execution.respondTo
- The stream to which the responses should be sentpublic ExecutionStatus getExecutionStatus(byte[] exchangeBytes) throws IOException, MarshallingException
exchangeBytes
- The byte[] representation of the execution status.IOException
- If there are problems reconstructing elements of the exchangeMarshallingException
- If there are problems reconstructing specialized elements of
the exchangepublic ResourceDiscovery createResourceDiscoveryRequest(int resourceType, String respondTo)
resourceType
- The type of the resource the node is looking forrespondTo
- The stream over which responses need to be sent.public ResourceDiscovery createResourceDiscoveryResponse(int conditionFlag, String description, ResourceMetrics resourceMetrics, String respondTo)
ResourceDiscovery
responseresourceMetrics
- The metrics associated with the resource.respondTo
- The stream over which the resource listens to deployment requestsResourceDiscovery
response.public ResourceDiscovery getResourceDiscovery(byte[] exchangeBytes) throws IOException, MarshallingException
ResourceDiscovery
from a stream of bytesexchangeBytes
- The marshalled representation of the exchangeResourceDiscovery
IOException
- If there are problems reconstructing elements of the exchangeMarshallingException
- If there are problems reconstructing specialized elements of
the exchangeCopyright © 2015. All rights reserved.