com.wilko.jaim
Class BuddyUpdateTocResponse

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

public class BuddyUpdateTocResponse
extends TocResponse
implements TocResponseHandler

A BuddyUpdateTocResponse is delivered to a JaimEventListener when a buddy update is received from the TOC server

Version:
$Revision: 1.7 $
Author:
paulw

Field Summary
static java.lang.String RESPONSE_TYPE
           
 
Fields inherited from class com.wilko.jaim.TocResponse
cmd
 
Constructor Summary
BuddyUpdateTocResponse()
          Creates new BuddyUpdateTocResponse
 
Method Summary
 boolean canHandle(java.lang.String Response)
          Returns true if this response handler can handle the specified response.
 java.lang.String getBuddy()
          Obtain the buddy name from this update
 int getEvil()
          Obtain the "Evil" (Warning) level of this buddy
 int getIdleTime()
          Obtain the idle time of this buddy
 java.lang.String getResponseType()
          Get the response type of this response.
 java.util.Date getSignonTime()
          Get the signon time of this buddy
 boolean isAdmin()
          Is this buddy an "Administrator"
 boolean isAway()
          Get the away status of the buddy specified by this update
 boolean isConfirmed()
          IS this buddy a "confirmed" user
 boolean isOnline()
          Obtain the online status of this buddy update
 boolean isUnconfirmed()
          Is this user an "Unconfirmed user"
 TocResponse parseString(java.lang.String str)
          The parseString method is used to populate the fields of this class from a Buddy Update string from the TOC server
 
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
Constructor Detail

BuddyUpdateTocResponse

public BuddyUpdateTocResponse()
Creates new BuddyUpdateTocResponse

Method Detail

parseString

public TocResponse parseString(java.lang.String str)
The parseString method is used to populate the fields of this class from a Buddy Update string from the TOC server

Specified by:
parseString in interface TocResponseHandler
Parameters:
str - The String containing the buddy update
Returns:
- A TocResponse object that represents this response

isAway

public boolean isAway()
Get the away status of the buddy specified by this update

Returns:
true if the buddy is "away"

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

getBuddy

public java.lang.String getBuddy()
Obtain the buddy name from this update

Returns:
The buddy name

isOnline

public boolean isOnline()
Obtain the online status of this buddy update

Returns:
true if the buddy is on line

getIdleTime

public int getIdleTime()
Obtain the idle time of this buddy

Returns:
The idle time in seconds

getEvil

public int getEvil()
Obtain the "Evil" (Warning) level of this buddy

Returns:
The warning level as a percentage

isAdmin

public boolean isAdmin()
Is this buddy an "Administrator"

Returns:
true if an administrator

isConfirmed

public boolean isConfirmed()
IS this buddy a "confirmed" user

Returns:
True if this buddy is confirmed

isUnconfirmed

public boolean isUnconfirmed()
Is this user an "Unconfirmed user"

Returns:
True if this user is unconfirmed

getSignonTime

public java.util.Date getSignonTime()
Get the signon time of this buddy

Returns:
The date/time of signon

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