org.walluck.oscar.handlers
Class BuddyListHandler

java.lang.Object
  extended by org.walluck.oscar.handlers.SNACHandler
      extended by org.walluck.oscar.handlers.BuddyListHandler

public class BuddyListHandler
extends SNACHandler

Family 0x0003 - Old-style Buddylist Management (non-SSI).

Since:
1.0
Version:
1.0
Author:
David Walluck
See Also:
SNACHandler

Constructor Summary
BuddyListHandler()
          Family 0x0003.
 
Method Summary
 void addBuddy(AIMSession sess, AIMConnection conn, String sn)
          Subtype 0x0004 - Adds a single buddy to your buddy list.
 void handleSNAC(AIMSession sess, SNACHandler handler, AIMFrame frame, SNAC snac, AIMInputStream buffer)
          Handles incoming SNAC's.
 void removeBuddy(AIMSession sess, AIMConnection conn, String sn)
          Subtype 0x0004 - Removes a single buddy from your buddy list.
 void reqBuddyRights(AIMSession sess, AIMConnection conn)
          Subtype 0x0002 - Request buddy list rights.
 void setBuddyList(AIMSession sess, AIMConnection conn, String buddyList)
          Subtype 0x0004 - Add multiple buddies to your buddy list.
 
Methods inherited from class org.walluck.oscar.handlers.SNACHandler
getFamily, getVersion, setFamily, setVersion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BuddyListHandler

public BuddyListHandler()
Family 0x0003.

Method Detail

reqBuddyRights

public void reqBuddyRights(AIMSession sess,
                           AIMConnection conn)
                    throws IOException
Subtype 0x0002 - Request buddy list rights.

Parameters:
sess - the oscar session
conn - the bos connection for this session
Throws:
IOException - if an error occurs

addBuddy

public void addBuddy(AIMSession sess,
                     AIMConnection conn,
                     String sn)
              throws IOException
Subtype 0x0004 - Adds a single buddy to your buddy list.

TODO: Make this an extension of setBuddyList.

Parameters:
sess - the oscar session
conn - the bos connection for this session
sn - the screename of the buddy you wish to add
Throws:
IOException - if an error occurs

setBuddyList

public void setBuddyList(AIMSession sess,
                         AIMConnection conn,
                         String buddyList)
                  throws IOException
Subtype 0x0004 - Add multiple buddies to your buddy list.

This just builds the "set buddy list" command then queues it.

Parameters:
sess - the oscar session
conn - the bos connection for this session
buddyList - "ScreenNameOne&ScreenNameTwo&"
Throws:
IOException - if an error occurs

removeBuddy

public void removeBuddy(AIMSession sess,
                        AIMConnection conn,
                        String sn)
                 throws IOException
Subtype 0x0004 - Removes a single buddy from your buddy list.

TODO: make this an extension of setBuddyList, and support removing multiple buddies.

Parameters:
sess - the oscar session
conn - the bos connection for this session
sn - the screename of the buddy you wish to remove
Throws:
IOException - if an error occurs

handleSNAC

public void handleSNAC(AIMSession sess,
                       SNACHandler handler,
                       AIMFrame frame,
                       SNAC snac,
                       AIMInputStream buffer)
                throws IOException
Handles incoming SNAC's.

Specified by:
handleSNAC in class SNACHandler
Parameters:
sess - the oscar session
handler - the handler
frame - the incoming frame
snac - the incoming SNAC
buffer - the incoming buffer
Throws:
IOException - if an error occurs