net.kano.joscar.snaccmd.ssi
Class ItemsCmd

java.lang.Object
  extended bySnacCommand
      extended bySsiCommand
          extended byItemsCmd
Direct Known Subclasses:
CreateItemsCmd, DeleteItemsCmd, ModifyItemsCmd

public abstract class ItemsCmd
extends SsiCommand

A base class for the three item-based commands in this package. These commands are CreateItemsCmd, ModifyItemsCmd, DeleteItemsCmd.

See Also:
CreateItemsCmd, ModifyItemsCmd, DeleteItemsCmd

Field Summary
 
Fields inherited from class SsiCommand
CMD_ACTIVATE, CMD_CREATE_ITEMS, CMD_DATA_CHECK, CMD_DATA_REQ, CMD_DELETE_ITEMS, CMD_MOD_ACK, CMD_MODIFY_ITEMS, CMD_POST_MOD, CMD_PRE_MOD, CMD_RIGHTS, CMD_RIGHTS_REQ, CMD_SSI_DATA, CMD_UNCHANGED, FAMILY_INFO, FAMILY_SSI
 
Fields inherited from class SnacCommand
SNACFLAG_DEFAULT
 
Constructor Summary
protected ItemsCmd(int command, SnacPacket packet)
          Generates a new item-based command from the given incoming SNAC packet.
protected ItemsCmd(int command, SsiItem[] items)
          Creates a new outgoing item-based command with the given list of items.
protected ItemsCmd(int command, SsiItemObj[] itemObjs)
          Creates a new item-based command with a list of SsiItems generated from the given list of item objects.
 
Method Summary
 SsiItem[] getItems()
          Returns the list of server-stored "items" contained 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
 

Constructor Detail

ItemsCmd

protected ItemsCmd(int command,
                   SnacPacket packet)
Generates a new item-based command from the given incoming SNAC packet.

Parameters:
command - the SNAC command subtype for this command
packet - an incoming item-based command packet

ItemsCmd

protected ItemsCmd(int command,
                   SsiItemObj[] itemObjs)
Creates a new item-based command with a list of SsiItems generated from the given list of item objects.

Parameters:
command - the SNAC command subtype of this command
itemObjs - a list of SSI item objects to use in generating SsiItems

ItemsCmd

protected ItemsCmd(int command,
                   SsiItem[] items)
Creates a new outgoing item-based command with the given list of items.

Parameters:
command - the SNAC command subtype for this command
items - the list of items to send in this commnad
Method Detail

getItems

public final SsiItem[] getItems()
Returns the list of server-stored "items" contained in this command.

Returns:
the list of "items" 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()