net.kano.joscar.snaccmd.error
Class SnacError

java.lang.Object
  extended bySnacCommand
      extended bySnacError

public class SnacError
extends SnacCommand

A SNAC command representing a SNAC error sent in any supported SNAC family. SNAC error commands are normally the command in a family with the command subtype 0x01.


Field Summary
static int CMD_ERROR
          The SNAC command subtype of SNAC errors.
static int CODE_BROKEN_SNAC_DATA
          An error code indicating that a SNAC was malformatted.
static int CODE_IN_LOCAL_PERMIT_DENY
          An error code indicating that the client attempted to send a message to someone you have blocked.
static int CODE_INSUFFICIENT_RIGHTS
          An error code indicating that the user does not have the necessary permissions to perform an action.
static int CODE_INVALID_SNAC
          An error code indicating that an invalid SNAC command was sent.
static int CODE_LIST_OVERFLOW
          An error code meaning something.
static int CODE_NO_AOL
          An error code indicating that a given action cannot be performed while on AOL.
static int CODE_NO_MATCH
          An error code meaning something.
static int CODE_NOT_SUPPORTED_BY_CLIENT
          An error code indicating that a given action, such as sending a file to a user, is not supported by that user.
static int CODE_NOT_SUPPORTED_BY_HOST
          An error code indicating that a given action is not supported by the server.
static int CODE_OBSOLETE_SNAC
          An error code indicating that a SNAC command is no longer supported.
static int CODE_QUEUE_FULL
          An error code meaning something.
static int CODE_RECEIVER_WARNING_LEVEL
          An error code indicating that you cannot send a message to a user because his or her warning level is too high.
static int CODE_REFUSED_BY_CLIENT
          An error code indicating that a message or request was rejected by the client to which it was sent.
static int CODE_REPLY_TOO_LARGE
          An error code indicating that something is too large.
static int CODE_REQUEST_AMBIGUOUS
          An error code meaning something.
static int CODE_REQUEST_DENIED
          An error code indicating that some request was denied.
static int CODE_RESPONSES_LOST
          An error code indicating something.
static int CODE_SENDER_WARNING_LEVEL
          An error code indicating that you cannot send a message to a user because your warning level is too high.
static int CODE_SERVICE_UNAVAILABLE
          An error code indicating that a SNAC family service is "unavailable."
static int CODE_SERVICE_UNDEFINED
          An error code indicating that a SNAC family service does not exist.
static int CODE_TOO_FAST_TO_CLIENT
          An error code indicating that you sent commands too close together for the receiving user to receive them.
static int CODE_TOO_FAST_TO_HOST
          An error code indicating that you sent commands too close together.
static int CODE_USER_TEMP_UNAVAILABLE
          An error code indicating that a user is temporarily unavailable.
static int CODE_USER_UNAVAILABLE
          An error code indicating that a user is not "available," which may mean the user has blocked you or that he or she is offline.
 
Fields inherited from class SnacCommand
SNACFLAG_DEFAULT
 
Constructor Summary
  SnacError(int family, int errorCode)
          Creates a new SNAC error command in the given SNAC family and with the given error code.
protected SnacError(SnacPacket packet)
          Generates a new SNAC error command from the given incoming SNAC packet.
 
Method Summary
 int getErrorCode()
          Returns the error code associated with this error.
 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_INVALID_SNAC

public static final int CODE_INVALID_SNAC
An error code indicating that an invalid SNAC command was sent.

See Also:
Constant Field Values

CODE_TOO_FAST_TO_HOST

public static final int CODE_TOO_FAST_TO_HOST
An error code indicating that you sent commands too close together.

See Also:
Constant Field Values

CODE_TOO_FAST_TO_CLIENT

public static final int CODE_TOO_FAST_TO_CLIENT
An error code indicating that you sent commands too close together for the receiving user to receive them.

See Also:
Constant Field Values

CODE_USER_UNAVAILABLE

public static final int CODE_USER_UNAVAILABLE
An error code indicating that a user is not "available," which may mean the user has blocked you or that he or she is offline. Note that it does *not* mean that you have blocked that user, like CODE_IN_LOCAL_PERMIT_DENY does.

See Also:
Constant Field Values

CODE_SERVICE_UNAVAILABLE

public static final int CODE_SERVICE_UNAVAILABLE
An error code indicating that a SNAC family service is "unavailable." This may mean the service no longer exists or that it is temporarily down.

See Also:
Constant Field Values

CODE_SERVICE_UNDEFINED

public static final int CODE_SERVICE_UNDEFINED
An error code indicating that a SNAC family service does not exist.

See Also:
Constant Field Values

CODE_OBSOLETE_SNAC

public static final int CODE_OBSOLETE_SNAC
An error code indicating that a SNAC command is no longer supported.

See Also:
Constant Field Values

CODE_NOT_SUPPORTED_BY_HOST

public static final int CODE_NOT_SUPPORTED_BY_HOST
An error code indicating that a given action is not supported by the server. Sorry to be so vague; I've never seen this one.

See Also:
Constant Field Values

CODE_NOT_SUPPORTED_BY_CLIENT

public static final int CODE_NOT_SUPPORTED_BY_CLIENT
An error code indicating that a given action, such as sending a file to a user, is not supported by that user.

See Also:
Constant Field Values

CODE_REFUSED_BY_CLIENT

public static final int CODE_REFUSED_BY_CLIENT
An error code indicating that a message or request was rejected by the client to which it was sent.

See Also:
Constant Field Values

CODE_REPLY_TOO_LARGE

public static final int CODE_REPLY_TOO_LARGE
An error code indicating that something is too large. I've never seen this used.

See Also:
Constant Field Values

CODE_RESPONSES_LOST

public static final int CODE_RESPONSES_LOST
An error code indicating something. I've never seen this used.

See Also:
Constant Field Values

CODE_REQUEST_DENIED

public static final int CODE_REQUEST_DENIED
An error code indicating that some request was denied. Sorry for the vagueness; I've never seen this used before.

See Also:
Constant Field Values

CODE_BROKEN_SNAC_DATA

public static final int CODE_BROKEN_SNAC_DATA
An error code indicating that a SNAC was malformatted.

See Also:
Constant Field Values

CODE_INSUFFICIENT_RIGHTS

public static final int CODE_INSUFFICIENT_RIGHTS
An error code indicating that the user does not have the necessary permissions to perform an action.

See Also:
Constant Field Values

CODE_IN_LOCAL_PERMIT_DENY

public static final int CODE_IN_LOCAL_PERMIT_DENY
An error code indicating that the client attempted to send a message to someone you have blocked.

See Also:
Constant Field Values

CODE_SENDER_WARNING_LEVEL

public static final int CODE_SENDER_WARNING_LEVEL
An error code indicating that you cannot send a message to a user because your warning level is too high.

See Also:
Constant Field Values

CODE_RECEIVER_WARNING_LEVEL

public static final int CODE_RECEIVER_WARNING_LEVEL
An error code indicating that you cannot send a message to a user because his or her warning level is too high.

See Also:
Constant Field Values

CODE_USER_TEMP_UNAVAILABLE

public static final int CODE_USER_TEMP_UNAVAILABLE
An error code indicating that a user is temporarily unavailable.

See Also:
Constant Field Values

CODE_NO_MATCH

public static final int CODE_NO_MATCH
An error code meaning something. I've never seen this used.

See Also:
Constant Field Values

CODE_LIST_OVERFLOW

public static final int CODE_LIST_OVERFLOW
An error code meaning something. I've never seen this used.

See Also:
Constant Field Values

CODE_REQUEST_AMBIGUOUS

public static final int CODE_REQUEST_AMBIGUOUS
An error code meaning something. I've never seen this used.

See Also:
Constant Field Values

CODE_QUEUE_FULL

public static final int CODE_QUEUE_FULL
An error code meaning something. I've never seen this used.

See Also:
Constant Field Values

CODE_NO_AOL

public static final int CODE_NO_AOL
An error code indicating that a given action cannot be performed while on AOL.

See Also:
Constant Field Values

CMD_ERROR

public static final int CMD_ERROR
The SNAC command subtype of SNAC errors.

See Also:
Constant Field Values
Constructor Detail

SnacError

protected SnacError(SnacPacket packet)
Generates a new SNAC error command from the given incoming SNAC packet.

Parameters:
packet - an incoming SNAC error packet

SnacError

public SnacError(int family,
                 int errorCode)
Creates a new SNAC error command in the given SNAC family and with the given error code.

Parameters:
family - the SNAC family in which this error occurred
errorCode - an error code, like CODE_INVALID_SNAC
Method Detail

getErrorCode

public final int getErrorCode()
Returns the error code associated with this error. Will be one of the CODE_-prefixed constants defined in this class (like CODE_USER_UNAVAILABLE).

Returns:
the SNAC error code, like CODE_INVALID_SNAC

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