com.sun.slamd.message
Class StopClientRequestMessage

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

public class StopClientRequestMessage
extends Message

This class defines a stop client request message, which the SLAMD server can use to request that one or more clients be stopped.


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
StopClientRequestMessage(int messageID, int numClients)
          Creates a new stop client request message that will provide the number of clients to start and the port number of the SLAMD server's client listener.
 
Method Summary
static StopClientRequestMessage decodeStopClient(int messageID, ASN1Element element)
          Decodes the provided ASN.1 element as a stop client request message.
 ASN1Element encode()
          Encodes this message into an ASN.1 element.
 int getNumClients()
          Retrieves the number of clients that should be started.
 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

StopClientRequestMessage

public StopClientRequestMessage(int messageID,
                                int numClients)
Creates a new stop client request message that will provide the number of clients to start and the port number of the SLAMD server's client listener.

Parameters:
messageID - The message ID for this message.
numClients - The number of clients that should be stopped.
Method Detail

getNumClients

public int getNumClients()
Retrieves the number of clients that should be started.

Returns:
The number of clients that should be started.

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.

decodeStopClient

public static StopClientRequestMessage decodeStopClient(int messageID,
                                                        ASN1Element element)
                                                 throws SLAMDException
Decodes the provided ASN.1 element as a stop client request message.

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

encode

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

StopClientRequest ::= [APPLICATION 17] INTEGER

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