com.sun.slamd.protocol
Class ClientHello

java.lang.Object
  extended by com.sun.slamd.protocol.SLAMDMessage
      extended by com.sun.slamd.protocol.ClientHello

public class ClientHello
extends SLAMDMessage

This class defines a SLAMD message that will be sent from the client to the server when the connection is first established. It provides the server with all the necessary properties and capabilities for this client.

Author:
Neil A. Wilson

Constructor Summary
ClientHello()
          Creates a new instance of this client hello message which is intended for use in decoding a message transmitted between the client and the server.
ClientHello(int messageID, java.util.HashMap extraProperties, java.lang.String clientIP, int clientPort, java.lang.String clientID, java.lang.String clientManagerID, int majorVersion, int minorVersion, int pointVersion, boolean restrictedMode)
          Creates a new instance of this client hello message with the provided information.
ClientHello(int messageID, java.util.HashMap extraProperties, java.lang.String clientIP, int clientPort, java.lang.String clientID, java.lang.String clientManagerID, int majorVersion, int minorVersion, int pointVersion, boolean restrictedMode, java.lang.String authMethod, java.lang.String authID, byte[] authCredentials, boolean requireServerAuth)
          Creates a new instance of this client hello message with the provided information.
 
Method Summary
 void decodeMessagePayload(ASN1Element payloadElement)
          Decodes the provided ASN.1 element and uses it as the payload for this SLAMD message.
 ASN1Element encodeMessagePayload()
          Encodes the payload component of this SLAMD message to an ASN.1 element for inclusion in the message envelope.
 byte[] getAuthCredentials()
          Retrieves the credentials that the client wishes to use to authenticate to the server.
 java.lang.String getAuthID()
          Retrieves the authentication ID that the client wishes to use to authenticate to the server.
 java.lang.String getAuthMethod()
          Retrieves the name of the method that the client wishes to use to authenticate to the server.
 java.lang.String getClientID()
          Retrieves the client ID for this client connection.
 java.lang.String getClientIP()
          Retrieves the client IP address for this client connection.
 java.lang.String getClientManagerID()
          Retrieves the client manager ID for the client manager with which this client connection is associated.
 int getClientPort()
          Retrieves the client port number for this client connection.
 int getMajorVersion()
          Retrieves the major version number for the client software.
 int getMinorVersion()
          Retrieves the minor version number for the client software.
 int getPointVersion()
          Retrieves the point version number for the client software.
 boolean getRequireServerAuth()
          Indicates whether the client requires the server to authenticate itself to the client.
 boolean getRestrictedMode()
          Indicates whether the client is running in restricted mode and should only be assigned jobs for which it is explicitly requested.
 void payloadToString(java.lang.StringBuffer buffer, int indent)
          Appends a string representation of the payload for this SLAMD message to the provided buffer.
 void setAuthCredentials(byte[] authCredentials)
          Specifies the credentials that the client wishes to use to authenticate to the server.
 void setAuthID(java.lang.String authID)
          Specifies the authentication ID that the client wishes to use to authenticate to the server.
 void setAuthMethod(java.lang.String authMethod)
          Specifies the name of the method that the client wishes to use to authenticate to the server.
 void setClientID(java.lang.String clientID)
          Specifies the client ID for this client connection.
 void setClientIP(java.lang.String clientIP)
          Specifies the client IP address for this client connection.
 void setClientManagerID(java.lang.String clientManagerID)
          Specifies the client manager ID for the client manager with which this client connection is associated.
 void setClientPort(int clientPort)
          Specifies the client port number for this client connection.
 void setMajorVersion(int majorVersion)
          Specifies the major version number for the client software.
 void setMinorVersion(int minorVersion)
          Specifies the minor version number for the client software.
 void setPointVersion(int pointVersion)
          Specifies the point version number for the client software.
 void setRequireServerAuth(boolean requireServerAuth)
          Specifies whether the client requires the server to authenticate itself to the client.
 void setRestrictedMode(boolean restrictedMode)
          Specifies whether the client is running in restricted mode and should only be assigned jobs for which it is explicitly requested.
 
Methods inherited from class com.sun.slamd.protocol.SLAMDMessage
decode, decodeNameValuePair, decodeNameValuePairSequence, encode, encodeNameValuePair, getExtraProperties, getExtraProperty, getMessageID, toString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClientHello

public ClientHello()
Creates a new instance of this client hello message which is intended for use in decoding a message transmitted between the client and the server. It is not intended for general use.


ClientHello

public ClientHello(int messageID,
                   java.util.HashMap extraProperties,
                   java.lang.String clientIP,
                   int clientPort,
                   java.lang.String clientID,
                   java.lang.String clientManagerID,
                   int majorVersion,
                   int minorVersion,
                   int pointVersion,
                   boolean restrictedMode)
Creates a new instance of this client hello message with the provided information.

Parameters:
messageID - The message ID for this SLAMD message.
extraProperties - The "extra" properties for this SLAMD message. Both the names and values for the properties must be strings.
clientIP - The IP address of the client system.
clientPort - The port number of the client system.
clientID - The client ID for the client system.
clientManagerID - The ID for the associated client manager.
majorVersion - The major version number for this client.
minorVersion - The minor version number for this client.
pointVersion - The point version number for this client.
restrictedMode - Indicates whether this client is operating in restricted mode.

ClientHello

public ClientHello(int messageID,
                   java.util.HashMap extraProperties,
                   java.lang.String clientIP,
                   int clientPort,
                   java.lang.String clientID,
                   java.lang.String clientManagerID,
                   int majorVersion,
                   int minorVersion,
                   int pointVersion,
                   boolean restrictedMode,
                   java.lang.String authMethod,
                   java.lang.String authID,
                   byte[] authCredentials,
                   boolean requireServerAuth)
Creates a new instance of this client hello message with the provided information.

Parameters:
messageID - The message ID for this SLAMD message.
extraProperties - The "extra" properties for this SLAMD message. Both the names and values for the properties must be strings.
clientIP - The IP address of the client system.
clientPort - The port number of the client system.
clientID - The client ID for the client system.
clientManagerID - The ID for the associated client manager.
majorVersion - The major version number for this client.
minorVersion - The minor version number for this client.
pointVersion - The point version number for this client.
restrictedMode - Indicates whether this client is operating in restricted mode.
authMethod - The authentication method used by this client.
authID - The authentication ID for this client.
authCredentials - The authentication credentials for this client.
requireServerAuth - Indicates whether this client requires the server to provide its own authentication info.
Method Detail

getClientIP

public java.lang.String getClientIP()
Retrieves the client IP address for this client connection.

Returns:
The client IP address for this client connection.

setClientIP

public void setClientIP(java.lang.String clientIP)
Specifies the client IP address for this client connection.

Parameters:
clientIP - The client IP address for this client connection.

getClientPort

public int getClientPort()
Retrieves the client port number for this client connection.

Returns:
The client port number for this client connection.

setClientPort

public void setClientPort(int clientPort)
Specifies the client port number for this client connection.

Parameters:
clientPort - The client port number for this client connection.

getClientID

public java.lang.String getClientID()
Retrieves the client ID for this client connection.

Returns:
The client ID for this client connection.

setClientID

public void setClientID(java.lang.String clientID)
Specifies the client ID for this client connection.

Parameters:
clientID - The client ID for this client connection.

getClientManagerID

public java.lang.String getClientManagerID()
Retrieves the client manager ID for the client manager with which this client connection is associated.

Returns:
The client manager ID for the client manager with which this client connection is associated, or null if it is not associated with a client manager.

setClientManagerID

public void setClientManagerID(java.lang.String clientManagerID)
Specifies the client manager ID for the client manager with which this client connection is associated.

Parameters:
clientManagerID - The client manager ID for the client manager with which this client connection is associated.

getMajorVersion

public int getMajorVersion()
Retrieves the major version number for the client software.

Returns:
The major version number for the client software.

setMajorVersion

public void setMajorVersion(int majorVersion)
Specifies the major version number for the client software.

Parameters:
majorVersion - The major version number for the client software.

getMinorVersion

public int getMinorVersion()
Retrieves the minor version number for the client software.

Returns:
The minor version number for the client software.

setMinorVersion

public void setMinorVersion(int minorVersion)
Specifies the minor version number for the client software.

Parameters:
minorVersion - The minor version number for the client software.

getPointVersion

public int getPointVersion()
Retrieves the point version number for the client software.

Returns:
The point version number for the client software.

setPointVersion

public void setPointVersion(int pointVersion)
Specifies the point version number for the client software.

Parameters:
pointVersion - The point version number for the client software.

getRestrictedMode

public boolean getRestrictedMode()
Indicates whether the client is running in restricted mode and should only be assigned jobs for which it is explicitly requested.

Returns:
true if this client is running in restricted mode, or false if it is not.

setRestrictedMode

public void setRestrictedMode(boolean restrictedMode)
Specifies whether the client is running in restricted mode and should only be assigned jobs for which it is explicitly requested.

Parameters:
restrictedMode - Specifies whether the client is running in restricted mode.

getAuthMethod

public java.lang.String getAuthMethod()
Retrieves the name of the method that the client wishes to use to authenticate to the server.

Returns:
The name of the method that the client wishes to use to authenticate to the server, or null if no authentication is to be performed.

setAuthMethod

public void setAuthMethod(java.lang.String authMethod)
Specifies the name of the method that the client wishes to use to authenticate to the server.

Parameters:
authMethod - The name of the method that the client wishes to use to authenticate to the server.

getAuthID

public java.lang.String getAuthID()
Retrieves the authentication ID that the client wishes to use to authenticate to the server.

Returns:
The authentication ID that the client wishes to use to authenticate to the server, or null if no authentication is to be performed or no auth ID is required for the selected authentication method.

setAuthID

public void setAuthID(java.lang.String authID)
Specifies the authentication ID that the client wishes to use to authenticate to the server.

Parameters:
authID - The authentication ID that the client wishes to use to authenticate to the server.

getAuthCredentials

public byte[] getAuthCredentials()
Retrieves the credentials that the client wishes to use to authenticate to the server.

Returns:
The credentials that the client wishes to use to authenticate to the server, or null if no authentication is to be performed or no credentials are required for the selected authentication method.

setAuthCredentials

public void setAuthCredentials(byte[] authCredentials)
Specifies the credentials that the client wishes to use to authenticate to the server.

Parameters:
authCredentials - The credentials that the client wishes to use to authenticate to the server.

getRequireServerAuth

public boolean getRequireServerAuth()
Indicates whether the client requires the server to authenticate itself to the client.

Returns:
true if the client requires the server to authenticate itself to the client, or false if not.

setRequireServerAuth

public void setRequireServerAuth(boolean requireServerAuth)
Specifies whether the client requires the server to authenticate itself to the client.

Parameters:
requireServerAuth - Specifies whether the client requires the server to authenticate itself to the client.

encodeMessagePayload

public ASN1Element encodeMessagePayload()
Encodes the payload component of this SLAMD message to an ASN.1 element for inclusion in the message envelope.

Specified by:
encodeMessagePayload in class SLAMDMessage
Returns:
The ASN.1 element containing the encoded message payload.

decodeMessagePayload

public void decodeMessagePayload(ASN1Element payloadElement)
                          throws SLAMDException
Decodes the provided ASN.1 element and uses it as the payload for this SLAMD message.

Specified by:
decodeMessagePayload in class SLAMDMessage
Parameters:
payloadElement - The ASN.1 element to decode as the payload for this SLAMD message.
Throws:
SLAMDException - If a problem occurs while attempting to decode the provided ASN.1 element as the payload for this SLAMD message.

payloadToString

public void payloadToString(java.lang.StringBuffer buffer,
                            int indent)
Appends a string representation of the payload for this SLAMD message to the provided buffer. The string representation may contain multiple lines, but the last line should not end with an end-of-line marker.

Specified by:
payloadToString in class SLAMDMessage
Parameters:
buffer - The buffer to which the string representation is to be appended.
indent - The number of spaces to indent the payload content.