org.alicebot.server.net.listener
Class AliceICQ

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

public class AliceICQ
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:
Chris Carlin, Jon Baer, Noel Bush
See Also:
http://EBJava.sourceforge.net/

Field Summary
static java.lang.String label
          Please document.
protected  java.net.DatagramSocket socket
          Please document.
 
Fields inherited from class org.alicebot.server.net.listener.AliceChatListener
bot, botID, parameters
 
Constructor Summary
AliceICQ(Bot bot)
          Creates a new AliceICQ chat listener for a given bot.
 
Method Summary
 void ack(byte a, byte b)
           
 boolean checkParameters()
          Checks that the parameters that have been set for the listener are okay.
 byte[] header(short command)
           
 void run()
          Please document this.
 void send(byte[] buffer)
           
 void sendMesg(int to, java.lang.String mesg)
           
 void shutdown()
          Shuts down the process.
 void signoff()
           
static byte[] toBytes(int x)
          Converts an int to a byte[].
static byte[] toBytes(short x)
          Converts a short to a byte[].
 void toICQ(byte[] buffer)
          Please document this.
 
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

socket

protected java.net.DatagramSocket socket
Please document.


label

public static final java.lang.String label
Please document.

See Also:
Constant Field Values
Constructor Detail

AliceICQ

public AliceICQ(Bot bot)
Creates a new AliceICQ chat listener for a given bot.

Parameters:
bot - the bot for whom to listen
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()
Please document this.


shutdown

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


toICQ

public void toICQ(byte[] buffer)
           throws java.io.IOException
Please document this.

Throws:
java.io.IOException

toBytes

public static byte[] toBytes(short x)
Converts a short to a byte[].

Parameters:
x - the short to convert
Returns:
the short as a byte[]

toBytes

public static byte[] toBytes(int x)
Converts an int to a byte[].

Parameters:
x - the int to convert
Returns:
the int as a byte[]

header

public byte[] header(short command)
              throws java.io.IOException
Throws:
java.io.IOException

ack

public void ack(byte a,
                byte b)
         throws java.io.IOException
Throws:
java.io.IOException

send

public void send(byte[] buffer)
          throws java.io.IOException
Throws:
java.io.IOException

sendMesg

public void sendMesg(int to,
                     java.lang.String mesg)

signoff

public void signoff()