org.walluck.oscar.tools
Class LocateTool

java.lang.Object
  extended by org.walluck.oscar.tools.Tool
      extended by org.walluck.oscar.tools.LocateTool
All Implemented Interfaces:
Listener, LocateListener

public class LocateTool
extends Tool
implements LocateListener

Locate tool.

Since:
1.0
Version:
1.0
Author:
David Walluck

Field Summary
 
Fields inherited from class org.walluck.oscar.tools.Tool
listeners
 
Constructor Summary
LocateTool()
          Creates a new Locate tool.
 
Method Summary
 void bosConnectionAvailable()
          Method called by the LoginTool once the BOS connection is available.
 void getAway(String sn)
          Get a user's away message.
 void getInfo(String sn)
          Get a user's information.
 void locateRights(AIMSession sess, AIMFrame frame, int maxsiglen)
          Describe locateRights method here.
 void setAwayAIM(String awaymsg)
          Set an away message on an AIM connection.
 void setAwayAIM(String encoding, byte[] awaymb)
          Set an away message on an AIM connection.
 void setAwayICQ(String awaymsg)
          Set the away message for an ICQ connection.
 void setInfo(String encoding, String text)
          Describe setInfo method here.
 void shutdown(AIMSession sess)
          Called when the tool is shutting down.
 void userInfo(AIMSession sess, AIMFrame frame, UserInfo info, int infoType, String textEncoding, String text)
          Describe userInfo method here.
 
Methods inherited from class org.walluck.oscar.tools.Tool
getFamily, getId, getSession, getToolData, getVersion, setFamily, setId, setSession, setToolData, setVersion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocateTool

public LocateTool()
Creates a new Locate tool. Family 0x0002.

Method Detail

setInfo

public void setInfo(String encoding,
                    String text)
             throws IOException
Describe setInfo method here.

Parameters:
encoding - a String value
text - a String value
Throws:
IOException - if an error occurs

getInfo

public void getInfo(String sn)
             throws IOException
Get a user's information.

Parameters:
sn - a String value
Throws:
IOException - if an error occurs

getAway

public void getAway(String sn)
             throws IOException
Get a user's away message.

Parameters:
sn - ScreenName to get the away message for.
Throws:
IOException - if an error occurs

setAwayAIM

public void setAwayAIM(String encoding,
                       byte[] awaymb)
                throws IOException
Set an away message on an AIM connection.

Parameters:
encoding - Encoding of the away message (e.g. "us-ascii")
awaymb - byte[] of away message
Throws:
IOException - if an error occurs

setAwayAIM

public void setAwayAIM(String awaymsg)
                throws IOException
Set an away message on an AIM connection.

Parameters:
awaymsg - Custom away message
Throws:
IOException - if an error occurs

setAwayICQ

public void setAwayICQ(String awaymsg)
                throws IOException
Set the away message for an ICQ connection. This method really belongs in ServiceTool, as ICQ doesn't use the Locate mechanism, but we'll leave it here with all the other Presence methods. The away message MUST be one of: Online Away Do Not Disturb Not Available Occupied Free For Chat Invisible

Parameters:
awaymsg - The away message
Throws:
IOException - if an error occurs

shutdown

public void shutdown(AIMSession sess)
Called when the tool is shutting down.

Specified by:
shutdown in class Tool
Parameters:
sess - the oscar session

bosConnectionAvailable

public void bosConnectionAvailable()
Method called by the LoginTool once the BOS connection is available. This allows the other tools to get registered and get involved in the process.

Specified by:
bosConnectionAvailable in class Tool

locateRights

public void locateRights(AIMSession sess,
                         AIMFrame frame,
                         int maxsiglen)
Describe locateRights method here.

Specified by:
locateRights in interface LocateListener
Parameters:
sess - an AIMSession value
frame - an AIMFrame value
maxsiglen - an int value

userInfo

public void userInfo(AIMSession sess,
                     AIMFrame frame,
                     UserInfo info,
                     int infoType,
                     String textEncoding,
                     String text)
Describe userInfo method here.

Specified by:
userInfo in interface LocateListener
Parameters:
sess - an AIMSession value
frame - an AIMFrame value
info - an UserInfo value
infoType - an int value
textEncoding - a String value
text - a String value