com.sun.slamd.protocol
Class ClientManagerHello

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

public class ClientManagerHello
extends SLAMDMessage

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

Author:
Neil A. Wilson

Constructor Summary
ClientManagerHello()
          Creates a new instance of this client manager hello message which is intended for use in decoding a message transmitted between the client manager and the server.
ClientManagerHello(int messageID, java.util.HashMap extraProperties, java.lang.String clientIP, int clientPort, java.lang.String clientManagerID, int majorVersion, int minorVersion, int pointVersion, int maxClients)
          Creates a new instance of this client manager hello message with the provided information.
ClientManagerHello(int messageID, java.util.HashMap extraProperties, java.lang.String clientIP, int clientPort, java.lang.String clientManagerID, int majorVersion, int minorVersion, int pointVersion, int maxClients, java.lang.String authMethod, java.lang.String authID, byte[] authCredentials, boolean requireServerAuth)
          Creates a new instance of this client manager 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 getClientIP()
          Retrieves the client IP address for this client manager connection.
 java.lang.String getClientManagerID()
          Retrieves the client manager ID for this client manager connection.
 int getClientPort()
          Retrieves the client port number for this client manager connection.
 int getMajorVersion()
          Retrieves the major version number for the client manager software.
 int getMaxClients()
          Retrieves the maximum number of concurrent clients that may be created using this client manager.
 int getMinorVersion()
          Retrieves the minor version number for the client manager software.
 int getPointVersion()
          Retrieves the point version number for the client manager software.
 boolean getRequireServerAuth()
          Indicates whether the client requires the server to authenticate itself to the client.
 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 setClientIP(java.lang.String clientIP)
          Specifies the client IP address for this client manager connection.
 void setClientManagerID(java.lang.String clientManagerID)
          Specifies the client manager ID for this client manager connection.
 void setClientPort(int clientPort)
          Specifies the client port number for this client manager connection.
 void setMajorVersion(int majorVersion)
          Specifies the major version number for the client manager software.
 void setMaxClients(int maxClients)
          Specifies the maximum number of concurrent clients that may be created using this client manager.
 void setMinorVersion(int minorVersion)
          Specifies the minor version number for the client manager software.
 void setPointVersion(int pointVersion)
          Specifies the point version number for the client manager software.
 void setRequireServerAuth(boolean requireServerAuth)
          Specifies whether the client requires the server to authenticate itself to the client.
 
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

ClientManagerHello

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


ClientManagerHello

public ClientManagerHello(int messageID,
                          java.util.HashMap extraProperties,
                          java.lang.String clientIP,
                          int clientPort,
                          java.lang.String clientManagerID,
                          int majorVersion,
                          int minorVersion,
                          int pointVersion,
                          int maxClients)
Creates a new instance of this client manager 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 manager system.
clientPort - The port number of the client manager system.
clientManagerID - The ID for this client manager.
majorVersion - The major version number for this client manager.
minorVersion - The minor version number for this client manager.
pointVersion - The point version number for this client manager.
maxClients - The maximum number of clients that may be created using this client manager.

ClientManagerHello

public ClientManagerHello(int messageID,
                          java.util.HashMap extraProperties,
                          java.lang.String clientIP,
                          int clientPort,
                          java.lang.String clientManagerID,
                          int majorVersion,
                          int minorVersion,
                          int pointVersion,
                          int maxClients,
                          java.lang.String authMethod,
                          java.lang.String authID,
                          byte[] authCredentials,
                          boolean requireServerAuth)
Creates a new instance of this client manager 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 manager system.
clientPort - The port number of the client manager system.
clientManagerID - The ID for this client manager.
majorVersion - The major version number for this client manager.
minorVersion - The minor version number for this client manager.
pointVersion - The point version number for this client manager.
maxClients - The maximum number of clients that may be created using this client manager.
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 manager connection.

Returns:
The client IP address for this client manager connection.

setClientIP

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

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

getClientPort

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

Returns:
The client port number for this client manager connection.

setClientPort

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

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

getClientManagerID

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

Returns:
The client manager ID for this client manager connection.

setClientManagerID

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

Parameters:
clientManagerID - The client manager ID for this client manager connection.

getMajorVersion

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

Returns:
The major version number for the client manager software.

setMajorVersion

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

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

getMinorVersion

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

Returns:
The minor version number for the client manager software.

setMinorVersion

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

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

getPointVersion

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

Returns:
The point version number for the client manager software.

setPointVersion

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

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

getMaxClients

public int getMaxClients()
Retrieves the maximum number of concurrent clients that may be created using this client manager.

Returns:
The maximum number of concurrent clients that may be created using this client manager, or 0 if there is no limit.

setMaxClients

public void setMaxClients(int maxClients)
Specifies the maximum number of concurrent clients that may be created using this client manager.

Parameters:
maxClients - The maximum number of concurrent clients that may be created using this client manager.

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.