com.levelonelabs.aim
Class AIMClient

java.lang.Object
  extended bycom.levelonelabs.aim.AIMClient
All Implemented Interfaces:
AIMSender, java.lang.Runnable

public class AIMClient
extends java.lang.Object
implements java.lang.Runnable, AIMSender

Implements the AIM protocol

Author:
Scott Oster, Will Gorman

Field Summary
 
Fields inherited from interface com.levelonelabs.aim.AIMSender
DEFAULT_GROUP, DENY_ALL, DENY_SOME, PERMIT_ALL, PERMIT_BUDDIES, PERMIT_SOME
 
Constructor Summary
AIMClient(java.lang.String name, java.lang.String pass)
          Constructor for the AIMClient object
AIMClient(java.lang.String name, java.lang.String pass, java.lang.String info)
          Constructor for the AIMClient object
AIMClient(java.lang.String name, java.lang.String pass, java.lang.String info, boolean autoAddUsers)
          Constructor for the AIMClient object
AIMClient(java.lang.String name, java.lang.String pass, java.lang.String info, java.lang.String response, boolean autoAddUsers)
          Constructor for the AIMClient object
 
Method Summary
 void addAIMListener(AIMListener listener)
          Register a listener to recieve aim events
 void addBuddies(java.util.List buddyList)
          Convience method for adding multiple buddies
 void addBuddy(AIMBuddy buddy)
          Add a single budy
 void banBuddy(AIMBuddy buddy)
          tell aim to ignore a buddy
 void denyBuddy(AIMBuddy buddy)
          Add a buddy to the denied list
 AIMBuddy getBuddy(java.lang.String buddyName)
          Retrieve a buddy from the list
 java.util.Iterator getBuddyNames()
          Get an iterator for all the current buddy names
 int getPermitMode()
          Gets the permit mode that is set on the server.
 void permitBuddy(AIMBuddy buddy)
          Add a buddy to the permitted list
 void removeBuddies(java.util.List buddyList)
          Convience method for removing multiple buddies
 void removeBuddy(AIMBuddy buddy)
          Remove a single budy
 void run()
          Main processing method for the AIMClient object
 void sendMessage(AIMBuddy buddy, java.lang.String text)
          Send a message to a buddy
 void sendWarning(AIMBuddy buddy)
          Warn a buddy
 void setAvailable()
          Clear unvailable message
 void setPermitMode(int mode)
          Sets the permit mode on the server.
 void setUnavailable(java.lang.String reason)
          Set unvailable message
 void signOff()
          Sign off from aim server
 void signOn()
          Sign on to aim server
static java.lang.String stripHTML(java.lang.String line)
          Strip out HTML from a string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AIMClient

public AIMClient(java.lang.String name,
                 java.lang.String pass,
                 java.lang.String info,
                 java.lang.String response,
                 boolean autoAddUsers)
Constructor for the AIMClient object

Parameters:
name -
pass -
info - Description of the Parameter
response - what to say to non-users when they message the bot (if autoaddUsers==false)
autoAddUsers -

AIMClient

public AIMClient(java.lang.String name,
                 java.lang.String pass,
                 java.lang.String info,
                 boolean autoAddUsers)
Constructor for the AIMClient object

Parameters:
name -
pass -
info - Description of the Parameter
autoAddUsers -

AIMClient

public AIMClient(java.lang.String name,
                 java.lang.String pass,
                 java.lang.String info)
Constructor for the AIMClient object

Parameters:
name -
pass -
info - Description of the Parameter

AIMClient

public AIMClient(java.lang.String name,
                 java.lang.String pass)
Constructor for the AIMClient object

Parameters:
name -
pass -
Method Detail

stripHTML

public static java.lang.String stripHTML(java.lang.String line)
Strip out HTML from a string

Parameters:
line - * *
Returns:
the string without HTML

getBuddy

public AIMBuddy getBuddy(java.lang.String buddyName)
Retrieve a buddy from the list

Specified by:
getBuddy in interface AIMSender
Parameters:
buddyName -
Returns:
The buddy

getBuddyNames

public java.util.Iterator getBuddyNames()
Get an iterator for all the current buddy names

Specified by:
getBuddyNames in interface AIMSender
Returns:
iterator

signOn

public void signOn()
Sign on to aim server

Specified by:
signOn in interface AIMSender

signOff

public void signOff()
Sign off from aim server

Specified by:
signOff in interface AIMSender

run

public void run()
Main processing method for the AIMClient object

Specified by:
run in interface java.lang.Runnable

addAIMListener

public void addAIMListener(AIMListener listener)
Register a listener to recieve aim events

Specified by:
addAIMListener in interface AIMSender
Parameters:
listener - The listener

sendMessage

public void sendMessage(AIMBuddy buddy,
                        java.lang.String text)
Send a message to a buddy

Specified by:
sendMessage in interface AIMSender
Parameters:
buddy -
text -

addBuddy

public void addBuddy(AIMBuddy buddy)
Add a single budy

Specified by:
addBuddy in interface AIMSender
Parameters:
buddy - The buddy to add

addBuddies

public void addBuddies(java.util.List buddyList)
Convience method for adding multiple buddies

Specified by:
addBuddies in interface AIMSender
Parameters:
buddyList - List of AIMBuddy

removeBuddy

public void removeBuddy(AIMBuddy buddy)
Remove a single budy

Specified by:
removeBuddy in interface AIMSender
Parameters:
buddy - The buddy to add

removeBuddies

public void removeBuddies(java.util.List buddyList)
Convience method for removing multiple buddies

Specified by:
removeBuddies in interface AIMSender
Parameters:
buddyList - List of AIMBuddy

sendWarning

public void sendWarning(AIMBuddy buddy)
Warn a buddy

Specified by:
sendWarning in interface AIMSender
Parameters:
buddy -

banBuddy

public void banBuddy(AIMBuddy buddy)
tell aim to ignore a buddy

Specified by:
banBuddy in interface AIMSender
Parameters:
buddy -

denyBuddy

public void denyBuddy(AIMBuddy buddy)
Add a buddy to the denied list

Specified by:
denyBuddy in interface AIMSender
Parameters:
buddy -

permitBuddy

public void permitBuddy(AIMBuddy buddy)
Add a buddy to the permitted list

Specified by:
permitBuddy in interface AIMSender
Parameters:
buddy -

getPermitMode

public int getPermitMode()
Gets the permit mode that is set on the server.

Specified by:
getPermitMode in interface AIMSender
Returns:
int representation (see public statics) of current permit mode.

setPermitMode

public void setPermitMode(int mode)
Sets the permit mode on the server. (Use constants from AIMSender)

Specified by:
setPermitMode in interface AIMSender
Parameters:
mode -

setAvailable

public void setAvailable()
Clear unvailable message

Specified by:
setAvailable in interface AIMSender

setUnavailable

public void setUnavailable(java.lang.String reason)
Set unvailable message

Specified by:
setUnavailable in interface AIMSender
Parameters:
reason -


Copyright © 2001-2005 Java AIM Bot. All Rights Reserved.