net.kano.joscar.snaccmd.loc
Class DirInfoCmd

java.lang.Object
  extended bySnacCommand
      extended byLocCommand
          extended byDirInfoCmd

public class DirInfoCmd
extends LocCommand

A SNAC command containing a user's directory information. Normally sent in response to a GetDirInfoCmd.

See Also:
GetDirInfoCmd
Source of this SNAC:
AIM server
SNAC command type:
Family 0x02, command 0x0c

Field Summary
static int CODE_ERROR
          A result code indicating that the requested directory information was not found.
static int CODE_SUCCESS
          A result code indicating that the requested directory information exists.
 
Fields inherited from class LocCommand
CMD_DIR_INFO, CMD_GET_DIR, CMD_INTEREST_ACK, CMD_NEW_GET_INFO, CMD_OLD_GET_INFO, CMD_RIGHTS_REQ, CMD_RIGHTS_RESP, CMD_SET_DIR, CMD_SET_DIR_ACK, CMD_SET_INFO, CMD_SET_INTERESTS, CMD_USER_INFO, FAMILY_INFO, FAMILY_LOC
 
Fields inherited from class SnacCommand
SNACFLAG_DEFAULT
 
Constructor Summary
  DirInfoCmd(DirInfo dirInfo)
          Creates a new outgoing directory information command with the given directory information block, if any.
  DirInfoCmd(int code, DirInfo dirInfo)
          Creates a new outgoing directory information command with the given result code and directory information block, if any.
protected DirInfoCmd(SnacPacket packet)
          Generates a new directory information response from the given incoming SNAC packet.
 
Method Summary
 DirInfo getDirInfo()
          Returns the directory information block included in this response, or null if none was sent.
 int getResultCode()
          Returns the result code sent of this directory information response.
 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 the requested directory information exists.

See Also:
Constant Field Values

CODE_ERROR

public static final int CODE_ERROR
A result code indicating that the requested directory information was not found.

See Also:
Constant Field Values
Constructor Detail

DirInfoCmd

protected DirInfoCmd(SnacPacket packet)
Generates a new directory information response from the given incoming SNAC packet.

Parameters:
packet - an incoming directory information response packet

DirInfoCmd

public DirInfoCmd(DirInfo dirInfo)
Creates a new outgoing directory information command with the given directory information block, if any. The code field is set to CODE_SUCCESS if dirInfo is non-null and to CODE_ERROR if it is null.

Parameters:
dirInfo - a directory information block, or null for none

DirInfoCmd

public DirInfoCmd(int code,
                  DirInfo dirInfo)
Creates a new outgoing directory information command with the given result code and directory information block, if any.

Parameters:
code - a result code, like CODE_SUCCESS
dirInfo - a directory information block, or null for none
Method Detail

getResultCode

public final int getResultCode()
Returns the result code sent of this directory information response. Normally one of CODE_SUCCESS and CODE_ERROR.

Returns:
the directory information response code

getDirInfo

public final DirInfo getDirInfo()
Returns the directory information block included in this response, or null if none was sent. This value is normally null if the result code is CODE_ERROR.

Returns:
the directory information contained in this response

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