com.sun.slamd.message
Class StatusResponseMessage

java.lang.Object
  extended bycom.sun.slamd.message.Message
      extended bycom.sun.slamd.message.StatusResponseMessage

public class StatusResponseMessage
extends Message

This class defines a message type that the client can use to provide status information back to the server. The information in the status response may vary based on the request received from the server.


Field Summary
 
Fields inherited from class com.sun.slamd.message.Message
ASN1_TYPE_CLASS_TRANSFER_REQUEST, ASN1_TYPE_CLASS_TRANSFER_RESPONSE, ASN1_TYPE_CLIENT_HELLO, ASN1_TYPE_CLIENT_MANAGER_HELLO, ASN1_TYPE_HELLO_RESPONSE, ASN1_TYPE_JOB_COMPLETED, ASN1_TYPE_JOB_CONTROL_REQUEST, ASN1_TYPE_JOB_CONTROL_RESPONSE, ASN1_TYPE_JOB_REQUEST, ASN1_TYPE_JOB_RESPONSE, ASN1_TYPE_KEEPALIVE, ASN1_TYPE_REGISTER_STAT, ASN1_TYPE_REPORT_STAT, ASN1_TYPE_SERVER_HELLO, ASN1_TYPE_SERVER_SHUTDOWN, ASN1_TYPE_START_CLIENT_REQUEST, ASN1_TYPE_START_CLIENT_RESPONSE, ASN1_TYPE_STATUS_REQUEST, ASN1_TYPE_STATUS_RESPONSE, ASN1_TYPE_STOP_CLIENT_REQUEST, ASN1_TYPE_STOP_CLIENT_RESPONSE, messageID
 
Constructor Summary
StatusResponseMessage(int messageID, int responseCode, int clientStatusCode)
          Creates a new status response message using the specified client status code.
StatusResponseMessage(int messageID, int responseCode, int clientStatusCode, java.lang.String clientStatusMessage)
          Creates a new status response message using the specified client status code and message.
StatusResponseMessage(int messageID, int responseCode, int clientStatusCode, java.lang.String jobID, int jobState, StatTracker[] statTrackers)
          Creates a new status response message based on the provided client and job-specific information.
StatusResponseMessage(int messageID, int responseCode, int clientStatusCode, java.lang.String clientStatusMessage, java.lang.String jobID, int jobState, StatTracker[] statTrackers)
          Creates a new status response message based on the provided client and job-specific information.
 
Method Summary
static StatusResponseMessage decodeStatusResponse(int messageID, ASN1Element element)
          Decodes the provided ASN.1 element as a status response message.
 ASN1Element encode()
          Encodes this message into an ASN.1 element.
 int getClientStatusCode()
          Retrieves the client status code associated with this status response message.
 java.lang.String getClientStatusMessage()
          Retrieves the client status message associated with this status response message.
 java.lang.String getJobID()
          Retrieves the ID of the job associated with this status response message.
 int getJobState()
          Retrieves the state of the job associated with this status response message.
 int getResponseCode()
          Retrieves the response code associated with the status request.
 StatTracker[] getStatTrackers()
          Retrieves the stat tracker information associated with this status response message.
 java.lang.String toString()
          Retrieves a string representation of this message.
 
Methods inherited from class com.sun.slamd.message.Message
decode, getMessageID, getMessageType, send
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StatusResponseMessage

public StatusResponseMessage(int messageID,
                             int responseCode,
                             int clientStatusCode)
Creates a new status response message using the specified client status code. It will not contain a client status message or job-specific information.

Parameters:
messageID - The message ID for this message.
responseCode - The response code for the status request operation.
clientStatusCode - The client status code to include in this status response message.

StatusResponseMessage

public StatusResponseMessage(int messageID,
                             int responseCode,
                             int clientStatusCode,
                             java.lang.String clientStatusMessage)
Creates a new status response message using the specified client status code and message. It will not contain any job-specific information.

Parameters:
messageID - The message ID for this message.
responseCode - The response code for the status request operation.
clientStatusCode - The client status code to include in this status response message.
clientStatusMessage - The client status message to include in this status response message.

StatusResponseMessage

public StatusResponseMessage(int messageID,
                             int responseCode,
                             int clientStatusCode,
                             java.lang.String jobID,
                             int jobState,
                             StatTracker[] statTrackers)
Creates a new status response message based on the provided client and job-specific information. There will be no client status message.

Parameters:
messageID - The message ID for this message.
responseCode - The response code for the status request operation.
clientStatusCode - The client status code to include in this status response message.
jobID - The ID of the job for which job-specific information is being provided.
jobState - The current processing state for the specified job.
statTrackers - The set of stat trackers associated with the job the client is currently processing.

StatusResponseMessage

public StatusResponseMessage(int messageID,
                             int responseCode,
                             int clientStatusCode,
                             java.lang.String clientStatusMessage,
                             java.lang.String jobID,
                             int jobState,
                             StatTracker[] statTrackers)
Creates a new status response message based on the provided client and job-specific information.

Parameters:
messageID - The message ID for this message.
responseCode - The response code for the status request operation.
clientStatusCode - The client status code to include in this status response message.
clientStatusMessage - The client status message to include in this status response message.
jobID - The ID of the job for which job-specific information is being provided.
jobState - The current processing state for the specified job.
statTrackers - The set of stat trackers associated with the job the client is currently processing.
Method Detail

getResponseCode

public int getResponseCode()
Retrieves the response code associated with the status request.

Returns:
The response code associated with the status request.

getClientStatusCode

public int getClientStatusCode()
Retrieves the client status code associated with this status response message.

Returns:
The client status code associated with this status response message.

getClientStatusMessage

public java.lang.String getClientStatusMessage()
Retrieves the client status message associated with this status response message.

Returns:
The client status message associated with this stauts response message.

getJobID

public java.lang.String getJobID()
Retrieves the ID of the job associated with this status response message.

Returns:
The ID of the job associated with this status response message.

getJobState

public int getJobState()
Retrieves the state of the job associated with this status response message.

Returns:
The state of the job associated with this status response message.

getStatTrackers

public StatTracker[] getStatTrackers()
Retrieves the stat tracker information associated with this status response message.

Returns:
The stat tracker information associated with this status response message.

toString

public java.lang.String toString()
Retrieves a string representation of this message.

Overrides:
toString in class Message
Returns:
A string representation of this message.

decodeStatusResponse

public static StatusResponseMessage decodeStatusResponse(int messageID,
                                                         ASN1Element element)
                                                  throws SLAMDException
Decodes the provided ASN.1 element as a status response message.

Parameters:
messageID - The message ID to use for this message.
element - The ASN.1 element containing the StatusResponse sequence.
Returns:
The status response message decoded from the ASN.1 element.
Throws:
SLAMDException - If the provided ASN.1 element cannot be decoded as a status response message.

encode

public ASN1Element encode()
Encodes this message into an ASN.1 element. A status response message has the following syntax:

StatusResponse ::= [APPLICATION 9] SEQUENCE { responseCode ResponseCode, clientStatusCode ClientState, clientStatusMessage OCTET STRING, jobStatus JobStatus OPTIONAL }

Specified by:
encode in class Message
Returns:
An ASN.1 encoded representation of this message.