org.walluck.oscar.handlers
Class IconHandler

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

public class IconHandler
extends SNACHandler

Family 0x0010 - Server stored buddy icons.

Used for storing and retrieving your cute little buddy icon from the AIM servers.

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

Constructor Summary
IconHandler()
          Family 0x0010.
 
Method Summary
 void handleSNAC(AIMSession sess, SNACHandler handler, AIMFrame frame, SNAC snac, AIMInputStream buffer)
          Handles incoming SNAC's.
 void request(AIMSession sess, String sn, byte[] iconcsum)
          Subtype 0x0004 - Request someone's icon.
 void upload(AIMSession sess, byte[] icon)
          Subtype 0x0002 - Upload your icon.
 
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

IconHandler

public IconHandler()
Family 0x0010.

Method Detail

upload

public void upload(AIMSession sess,
                   byte[] icon)
            throws IOException
Subtype 0x0002 - Upload your icon.

Parameters:
sess - the oscar session
icon - the raw data of the icon image file
Throws:
IOException - if an error occurs

request

public void request(AIMSession sess,
                    String sn,
                    byte[] iconcsum)
             throws IOException
Subtype 0x0004 - Request someone's icon.

Parameters:
sess - the oscar session
sn - the screenname of the person whose icon you are requesting
iconcsum - the MD5 checksum of the icon you are requesting
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