com.sun.slamd.message
Class JobControlRequestMessage

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

public class JobControlRequestMessage
extends Message

This class defines a message that can be used to alter the state of a running job (e.g., to request that a client prematurely stop processing a job).


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
JobControlRequestMessage(int messageID, java.lang.String jobID, int jobControlOperation)
          Creates a new job control request message to perform the indicated operation on the specified job.
 
Method Summary
static JobControlRequestMessage decodeJobControlRequest(int messageID, ASN1Element element)
          Decodes the provided ASN.1 element as a job control request message.
 ASN1Element encode()
          Encodes this message into an ASN.1 element.
 int getJobControlOperation()
          Retrieves the type of operation that is being requested.
 java.lang.String getJobID()
          Retrieves the ID of the job for which this operation is being requested.
 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

JobControlRequestMessage

public JobControlRequestMessage(int messageID,
                                java.lang.String jobID,
                                int jobControlOperation)
Creates a new job control request message to perform the indicated operation on the specified job.

Parameters:
messageID - The message ID for this message.
jobID - The ID of the job for which the operation is being requested.
jobControlOperation - The type of operation being requested on the specified job.
Method Detail

getJobID

public java.lang.String getJobID()
Retrieves the ID of the job for which this operation is being requested.

Returns:
The ID of the job for which this operation is being requested.

getJobControlOperation

public int getJobControlOperation()
Retrieves the type of operation that is being requested.

Returns:
The type of operation that is being requested.

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.

decodeJobControlRequest

public static JobControlRequestMessage decodeJobControlRequest(int messageID,
                                                               ASN1Element element)
                                                        throws SLAMDException
Decodes the provided ASN.1 element as a job control request message.

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

encode

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

JobControlRequest ::= [APPLICATION 5] SEQUENCE { jobID OCTET STRING, controlType JobControlType }

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