net.kano.joscar.snaccmd.icon
Class IconRequest

java.lang.Object
  extended bySnacCommand
      extended byIconCommand
          extended byIconRequest

public class IconRequest
extends IconCommand

A SNAC command sent to request another user's buddy icon. Normally responded-to with an IconDataCmd.

See Also:
IconDataCmd
Source of this SNAC:
AIM client
SNAC command type:
Family 0x10, command 0x04

Field Summary
static int CODE_DEFAULT
          A default value for the "icon request code" sent in an IconRequest.
 
Fields inherited from class IconCommand
CMD_ICON_DATA, CMD_ICON_REQ, CMD_UPLOAD_ACK, CMD_UPLOAD_ICON, FAMILY_ICON, FAMILY_INFO
 
Fields inherited from class SnacCommand
SNACFLAG_DEFAULT
 
Constructor Summary
protected IconRequest(SnacPacket packet)
          Generates a new icon request command from the given incoming SNAC packet.
  IconRequest(java.lang.String sn, ExtraInfoBlock iconInfo)
          Creates a new outgoing (server-bound) icon request for the icon corresponding to the given icon information block from the given user.
  IconRequest(java.lang.String sn, int code, ExtraInfoBlock iconInfo)
          Creates a new outgoing (server-bound) icon request for the icon corresponding to the given icon information block from the given user.
 
Method Summary
 int getCode()
          Returns some sort of code included in this request.
 ExtraInfoBlock getIconInfo()
          Returns the icon information block corresponding to the icon being requested.
 java.lang.String getScreenname()
          Returns the screenname of the user whose icon is being requested.
 java.lang.String toString()
           
 void writeData(java.io.OutputStream out)
          Writes this command's SNAC data block to the given stream.
 
Methods inherited from class SnacCommand
getCommand, getFamily, getFlag1, getFlag2
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CODE_DEFAULT

public static final int CODE_DEFAULT
A default value for the "icon request code" sent in an IconRequest.

See Also:
Constant Field Values
Constructor Detail

IconRequest

protected IconRequest(SnacPacket packet)
Generates a new icon request command from the given incoming SNAC packet.

Parameters:
packet - an incoming icon request packet

IconRequest

public IconRequest(java.lang.String sn,
                   ExtraInfoBlock iconInfo)
Creates a new outgoing (server-bound) icon request for the icon corresponding to the given icon information block from the given user. The code field is set to CODE_DEFAULT.

Parameters:
sn - the screenname of the user whose buddy icon is being requested
iconInfo - the icon information block whose corresponding icon is being requested

IconRequest

public IconRequest(java.lang.String sn,
                   int code,
                   ExtraInfoBlock iconInfo)
Creates a new outgoing (server-bound) icon request for the icon corresponding to the given icon information block from the given user.

Parameters:
sn - the screenname of the user whose buddy icon is being requested
code - some sort of code; WinAIM sends CODE_DEFAULT
iconInfo - the icon information block whose corresponding icon is being requested
Method Detail

getScreenname

public final java.lang.String getScreenname()
Returns the screenname of the user whose icon is being requested.

Returns:
the screenname of the user whose icon is being requested

getCode

public final int getCode()
Returns some sort of code included in this request. Normally CODE_DEFAULT.

Returns:
the icon request code

getIconInfo

public final ExtraInfoBlock getIconInfo()
Returns the icon information block corresponding to the icon being requested.

Returns:
an icon information block describing the icon being requested

writeData

public void writeData(java.io.OutputStream out)
               throws java.io.IOException
Description copied from class: SnacCommand
Writes this command's SNAC data block to the given stream. The SNAC data block is the data after the first ten bytes of a SNAC packet.

Specified by:
writeData in class SnacCommand
Parameters:
out - the stream to which to write the SNAC data
Throws:
java.io.IOException - if an I/O error occurs

toString

public java.lang.String toString()