org.alicebot.server.net.listener
Class AliceAIM

java.lang.Object
  extended by org.alicebot.server.net.listener.AliceChatListener
      extended by org.alicebot.server.net.listener.AliceAIM
All Implemented Interfaces:
java.lang.Runnable, BotProcess

public class AliceAIM
extends AliceChatListener

This code is from the Everybuddy Java Project by Chris Carlin (http://EBJava.sourceforge.net/) modified to work with an Alicebot server.

Version:
1.0
Author:
Jon Baer, Sandy McArthur

Field Summary
static java.lang.String label
          The label (as required by the registration scheme).
 
Fields inherited from class org.alicebot.server.net.listener.AliceChatListener
bot, botID, parameters
 
Constructor Summary
AliceAIM(Bot bot)
          Constructs a new AliceAIM listener and sets up parameters.
 
Method Summary
 boolean checkParameters()
          Checks that the parameters that have been set for the listener are okay.
 void frameSend(java.lang.String toBeSent)
           
 void fromAIM(byte[] buffer)
          Processes data received from AIM.
static java.lang.String imNormalize(java.lang.String in)
          Removes spaces from a string.
static java.lang.String imRoast(java.lang.String pass)
          Encodes a password according to AIM's stupid requirement.
 void run()
          Signs on the listener and starts waiting for messages.
 void sendBuddies()
          Please document.
 void sendChatRoomMesg(java.lang.String roomID, java.lang.String message)
          Sends a message to a chat room.
 void sendMesg(java.lang.String to, java.lang.String message)
          Sends a message to a designated recipient.
 void shutdown()
          Shuts down the process.
 void signoff(java.lang.String place)
          Please document.
 void toAIM(byte[] buffer)
          Sends an AIM message.
 
Methods inherited from class org.alicebot.server.net.listener.AliceChatListener
setParameter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

label

public static final java.lang.String label
The label (as required by the registration scheme).

See Also:
Constant Field Values
Constructor Detail

AliceAIM

public AliceAIM(Bot bot)
Constructs a new AliceAIM listener and sets up parameters.

See Also:
AliceChatListener}
Method Detail

checkParameters

public boolean checkParameters()
Description copied from class: AliceChatListener
Checks that the parameters that have been set for the listener are okay.

Specified by:
checkParameters in class AliceChatListener
Returns:
true if parameters are okay, false if not

run

public void run()
Signs on the listener and starts waiting for messages.


shutdown

public void shutdown()
Description copied from interface: BotProcess
Shuts down the process.


frameSend

public void frameSend(java.lang.String toBeSent)
               throws java.io.IOException
Throws:
java.io.IOException

fromAIM

public void fromAIM(byte[] buffer)
Processes data received from AIM.

Parameters:
buffer - the data received from AIM

sendMesg

public void sendMesg(java.lang.String to,
                     java.lang.String message)
Sends a message to a designated recipient.

Parameters:
to - the recipient
message - the message to send

sendChatRoomMesg

public void sendChatRoomMesg(java.lang.String roomID,
                             java.lang.String message)
Sends a message to a chat room.

Parameters:
roomID - the room identifier
message - the message to send

toAIM

public void toAIM(byte[] buffer)
Sends an AIM message. Cannot send a message longer than 2030 bytes.

Parameters:
buffer - the message

sendBuddies

public void sendBuddies()
Please document.


signoff

public void signoff(java.lang.String place)
Please document.

Parameters:
place -

imRoast

public static java.lang.String imRoast(java.lang.String pass)
Encodes a password according to AIM's stupid requirement.

Parameters:
pass - the password to encode

imNormalize

public static java.lang.String imNormalize(java.lang.String in)
Removes spaces from a string.

Parameters:
in - the string from which to remove spaces
Returns:
the string without spaces