net.kano.joscar.snaccmd.search
Class InterestListCmd

java.lang.Object
  extended bySnacCommand
      extended bySearchCommand
          extended byInterestListCmd

public class InterestListCmd
extends SearchCommand

A SNAC command containing a "tree" of valid "chat interests." Normally sent in response to a InterestListReq. See InterestInfo for details on how to interpret the data sent in this command.

See Also:
InterestListReq, InterestInfo
Source of this SNAC:
AIM server
SNAC command type:
Family 0x0f, command 0x05

Field Summary
static int CODE_SUCCESS
          A result code indicating that a interest list request was successful.
static int CODE_UNAVAILABLE
          A result code indicating that a chat interest list is currently unavailable.
 
Fields inherited from class SearchCommand
CMD_INTERESTS, CMD_INTERESTS_REQ, CMD_RESULTS, CMD_SEARCH, FAMILY_INFO, FAMILY_SEARCH
 
Fields inherited from class SnacCommand
SNACFLAG_DEFAULT
 
Constructor Summary
  InterestListCmd(int code)
          Creates a new outgoing interest list command with no interest list and with the given result code.
  InterestListCmd(InterestInfo[] interests)
          Creates a new outgoing interest list command with the given interest list.
  InterestListCmd(int code, InterestInfo[] interests)
          Creates a new outgoing interest list command with the given result code and the given interest list.
protected InterestListCmd(SnacPacket packet)
          Generates a new interest list command from the given incoming SNAC packet.
 
Method Summary
 InterestInfo[] getInterests()
          Returns the interest list sent in this command, or null if none was sent.
 int getResultCode()
          Returns the result code sent in this command.
 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_SUCCESS

public static final int CODE_SUCCESS
A result code indicating that a interest list request was successful.

See Also:
Constant Field Values

CODE_UNAVAILABLE

public static final int CODE_UNAVAILABLE
A result code indicating that a chat interest list is currently unavailable.

See Also:
Constant Field Values
Constructor Detail

InterestListCmd

protected InterestListCmd(SnacPacket packet)
Generates a new interest list command from the given incoming SNAC packet.

Parameters:
packet - an incoming interest list packet

InterestListCmd

public InterestListCmd(int code)
Creates a new outgoing interest list command with no interest list and with the given result code.

Parameters:
code - a result code, like CODE_UNAVAILABLE

InterestListCmd

public InterestListCmd(InterestInfo[] interests)
Creates a new outgoing interest list command with the given interest list. The result code will be CODE_SUCCESS if interests is not null (even if interests.length is 0!), and CODE_UNAVAILABLE if interests is null.

Parameters:
interests - a list of interests

InterestListCmd

public InterestListCmd(int code,
                       InterestInfo[] interests)
Creates a new outgoing interest list command with the given result code and the given interest list.

Parameters:
code - a result code, like CODE_UNAVAILABLE
interests - a list of interest, or null for none
Method Detail

getResultCode

public int getResultCode()
Returns the result code sent in this command. Normally either CODE_SUCCESS or CODE_UNAVAILABLE.

Returns:
the result code associated with this response

getInterests

public final InterestInfo[] getInterests()
Returns the interest list sent in this command, or null if none was sent. See InterestInfo for details on how to interpret this list.

Returns:
the list of chat interests sent in this command

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()