com.wilko.jaim
Class ConfigTocResponse

java.lang.Object
  |
  +--com.wilko.jaim.TocResponse
        |
        +--com.wilko.jaim.ConfigTocResponse
All Implemented Interfaces:
TocResponseHandler

public class ConfigTocResponse
extends TocResponse
implements TocResponseHandler

A ConfigTocResponse contains the config message received from the toc server. This response is handled by the JaimConnection class, but may also be used by client programs. Once this event has been received, information returned from JaimConnection.getGroups() is valid

Author:
Brett Humphreys, Paul Wilkinson

Field Summary
static int DENY_ALL
          Value for mode that indicates DENY ALL mode
static int DENY_SOME
          Value for mode that indicates DENY SOME mode
static int PERMIT_ALL
          Value for mode that indicates PERMIT ALL mode
static int PERMIT_SOME
          Value for mode that indicates PERMIT SOME mode
static java.lang.String RESPONSE_TYPE
           
 
Fields inherited from class com.wilko.jaim.TocResponse
cmd
 
Constructor Summary
ConfigTocResponse()
           
 
Method Summary
 boolean canHandle(java.lang.String Response)
          Returns true if this response handler can handle the specified response.
 java.util.Enumeration enumerateGroups()
          Returns an Enumeration of groups.
 java.util.Collection getGroups()
          Returns a Collection of groups.
 int getMode()
          Gets the mode for this configuration
 java.lang.String getResponseType()
          Get the response type of this response.
 TocResponse parseString(java.lang.String message)
          Parses the config string.
 void setMode(int modeVal)
          Sets the mode for this configuration
 
Methods inherited from class com.wilko.jaim.TocResponse
toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RESPONSE_TYPE

public static java.lang.String RESPONSE_TYPE

PERMIT_ALL

public static final int PERMIT_ALL
Value for mode that indicates PERMIT ALL mode

See Also:
Constant Field Values

DENY_ALL

public static final int DENY_ALL
Value for mode that indicates DENY ALL mode

See Also:
Constant Field Values

PERMIT_SOME

public static final int PERMIT_SOME
Value for mode that indicates PERMIT SOME mode

See Also:
Constant Field Values

DENY_SOME

public static final int DENY_SOME
Value for mode that indicates DENY SOME mode

See Also:
Constant Field Values
Constructor Detail

ConfigTocResponse

public ConfigTocResponse()
Method Detail

enumerateGroups

public java.util.Enumeration enumerateGroups()
Returns an Enumeration of groups. Each Entry is a Group Each group then has an Enumeration of buddies within that group See Group.enumerateBuddies().

Returns:
list of Group elements or an empty list if none are found.

getGroups

public java.util.Collection getGroups()
Returns a Collection of groups. Each element is a {@link Group)

Returns:
the groups

getResponseType

public java.lang.String getResponseType()
Get the response type of this response. This method is used by the response dispatcher within JaimConnection

Specified by:
getResponseType in class TocResponse
Returns:
The response type

parseString

public TocResponse parseString(java.lang.String message)
Parses the config string.

Specified by:
parseString in interface TocResponseHandler
Parameters:
message - - the response from the TOC server. This is the full TOC response string
Returns:
- A TocResponse object that represents this response

setMode

public void setMode(int modeVal)
Sets the mode for this configuration

Parameters:
modeVal - the string value of the mode (1-4)

getMode

public int getMode()
Gets the mode for this configuration

Returns:
mode for the configuration

canHandle

public boolean canHandle(java.lang.String Response)
Returns true if this response handler can handle the specified response.

Specified by:
canHandle in interface TocResponseHandler
Parameters:
Response - - the response string from TOC. This is the part of the response before the first ':'
Returns:
true if the response can be handled

jaimlib.sourceforge.net