com.realtime.xmpp.types
Class XmppError

java.lang.Object
  |
  +--com.realtime.xmpp.types.XmppError

public class XmppError
extends java.lang.Object

Contains the standard Jabber error codes. Use equals() to determine if two errors are equal.

Version:
1.0 Copyright © 2002 Real Time Entertainment Group, LLC - All rights reserved.
Author:
Mike Prince

Field Summary
static XmppError BAD_REQUEST
          Code 400 is used to inform a sender that a request could not be understood by the recipient because it cannot be understood.
static XmppError CONFLICT
          Code 409 is returned when there is a conflict between two resources, e.g., if a user attempts to join a groupchat room but someone else with the same nickname is already in the room.
static XmppError FORBIDDEN
          Code 403 is used to inform an entity that its request was understood but that the recipient is refusing to fulfill it, e.g., if a node attempts to set information (e.g., preferences or profile information) associated with another node.
static XmppError INTERNAL_SERVER_ERROR
          Code 500 is used when a host or service encounters an unexpected condition which prevents it from handling an XML chunk from a sender, e.g., if an authentication request is not handled by a host because the password could not be retrieved or if password storage fails when a node attempts to register with a host.
protected static XmppError[] m_errors
          All our known error codes.
protected  int m_nCode
          The error code.
protected  java.lang.String m_sName
          The name of the error.
static XmppError NOT_ACCEPTABLE
          Code 406 is used when an XML chunk is for some reason not acceptable to a host or other entity.
static XmppError NOT_ALLOWED
          Code 405 is used when the action requested is not allowed for the JID identified by the 'from' address, e.g., if a node attempts to set the time or version of a host.
static XmppError NOT_FOUND
          Code 404 is used to inform a sender that no recipient was found matching the JID to which an XML chunk was sent, e.g., if a sender has attempted to send a message to a JID that does not exist.
static XmppError NOT_IMPLEMENTED
          Code 501 is used when the recipient does not support the functionality being requested by a sender, e.g., if a node sends an authentication request that does not contain the elements defined by at least one of the accepted authentication methods or when a node attempts to register with a host that does not allow registration.
static XmppError PAYMENT_REQUIRED
          Code 402 is being reserved for future use and is not in use at this time.
static XmppError REDIRECT
          Whereas the HTTP spec contains eight different codes for redirection, XMPP contains only one (which is intended to stand for any redirection error).
static XmppError REGISTRATION_REQUIRED
          Code 407 is used when a message or request is sent to a service that requires prior registration, e.g., if a node attempts to send a message through a gateway to a foreign messaging system without having first registered with that gateway.
static XmppError REMOTE_SERVER_ERROR
          Code 502 is used when delivery of an XML chunk fails because of an inability to reach the intended remote host or service.
static XmppError REMOTE_SERVER_TIMEOUT
          Code 504 is used when attempts to contact a remote host timeout, e.g., if an incorrect hostname is specified.
static XmppError REQUEST_TIMEOUT
          Code 408 is returned when a recipient does not produce a response within the time that the sender was prepared to wait.
static XmppError SERVICE_UNAVAILABLE
          Code 503 is used when a sender requests a service that a recipient is currently unable to handle, usually for temporary reasons, e.g., if a sender attempts to send a message to a recipient that is offline but the recipient's host is not running an offline message storage service.
static XmppError UNAUTHORIZED
          Code 401 is used to inform nodes that they have provided incorrect authorization information, e.g., an incorrect password or unknown username when attempting to authenticate with a host.
 
Constructor Summary
protected XmppError(int nCode, java.lang.String sName)
          Construct an error from a code and a description of the code.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Determine is two errors have the same code.
 int getCode()
          Provide the standard integer code for the error.
static XmppError getInstance(int nCode)
          Provide an XmppError instance corresponding to the error code.
 java.lang.String getName()
          Provides a human readable name of the error.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_nCode

protected int m_nCode
The error code.


m_sName

protected java.lang.String m_sName
The name of the error.


REDIRECT

public static final XmppError REDIRECT
Whereas the HTTP spec contains eight different codes for redirection, XMPP contains only one (which is intended to stand for any redirection error). However, code 302 is being reserved for future functionality and is not implemented at this time.


BAD_REQUEST

public static final XmppError BAD_REQUEST
Code 400 is used to inform a sender that a request could not be understood by the recipient because it cannot be understood. This might be generated when, for example, an entity sends a message that does not have a 'to' attribute, or when a node attempts to authenticate without sending a username.


UNAUTHORIZED

public static final XmppError UNAUTHORIZED
Code 401 is used to inform nodes that they have provided incorrect authorization information, e.g., an incorrect password or unknown username when attempting to authenticate with a host.


PAYMENT_REQUIRED

public static final XmppError PAYMENT_REQUIRED
Code 402 is being reserved for future use and is not in use at this time.


FORBIDDEN

public static final XmppError FORBIDDEN
Code 403 is used to inform an entity that its request was understood but that the recipient is refusing to fulfill it, e.g., if a node attempts to set information (e.g., preferences or profile information) associated with another node.


NOT_FOUND

public static final XmppError NOT_FOUND
Code 404 is used to inform a sender that no recipient was found matching the JID to which an XML chunk was sent, e.g., if a sender has attempted to send a message to a JID that does not exist. (Note: if the host of the intended recipient cannot be reached, an error code from the 500 series will be sent).


NOT_ALLOWED

public static final XmppError NOT_ALLOWED
Code 405 is used when the action requested is not allowed for the JID identified by the 'from' address, e.g., if a node attempts to set the time or version of a host.


NOT_ACCEPTABLE

public static final XmppError NOT_ACCEPTABLE
Code 406 is used when an XML chunk is for some reason not acceptable to a host or other entity. This might be generated when, for example, a node attempts to register with a host using an empty password.


REGISTRATION_REQUIRED

public static final XmppError REGISTRATION_REQUIRED
Code 407 is used when a message or request is sent to a service that requires prior registration, e.g., if a node attempts to send a message through a gateway to a foreign messaging system without having first registered with that gateway.


REQUEST_TIMEOUT

public static final XmppError REQUEST_TIMEOUT
Code 408 is returned when a recipient does not produce a response within the time that the sender was prepared to wait.


CONFLICT

public static final XmppError CONFLICT
Code 409 is returned when there is a conflict between two resources, e.g., if a user attempts to join a groupchat room but someone else with the same nickname is already in the room.


INTERNAL_SERVER_ERROR

public static final XmppError INTERNAL_SERVER_ERROR
Code 500 is used when a host or service encounters an unexpected condition which prevents it from handling an XML chunk from a sender, e.g., if an authentication request is not handled by a host because the password could not be retrieved or if password storage fails when a node attempts to register with a host.


NOT_IMPLEMENTED

public static final XmppError NOT_IMPLEMENTED
Code 501 is used when the recipient does not support the functionality being requested by a sender, e.g., if a node sends an authentication request that does not contain the elements defined by at least one of the accepted authentication methods or when a node attempts to register with a host that does not allow registration.


REMOTE_SERVER_ERROR

public static final XmppError REMOTE_SERVER_ERROR
Code 502 is used when delivery of an XML chunk fails because of an inability to reach the intended remote host or service. Specific examples of why this code is generated include a failure to connect to the remote host or resolve its hostname.


SERVICE_UNAVAILABLE

public static final XmppError SERVICE_UNAVAILABLE
Code 503 is used when a sender requests a service that a recipient is currently unable to handle, usually for temporary reasons, e.g., if a sender attempts to send a message to a recipient that is offline but the recipient's host is not running an offline message storage service.


REMOTE_SERVER_TIMEOUT

public static final XmppError REMOTE_SERVER_TIMEOUT
Code 504 is used when attempts to contact a remote host timeout, e.g., if an incorrect hostname is specified.


m_errors

protected static XmppError[] m_errors
All our known error codes.

Constructor Detail

XmppError

protected XmppError(int nCode,
                    java.lang.String sName)

Construct an error from a code and a description of the code.

* @param nCode One of the standard Jabber error codes. * @param sName The well known name of the error code.

Method Detail

getInstance

public static XmppError getInstance(int nCode)

Provide an XmppError instance corresponding to the error code.

* @param nCode The XMPP error code. * @return XmppError An instance of this class.


getCode

public int getCode()

Provide the standard integer code for the error.

* @return The integer code.


equals

public boolean equals(java.lang.Object obj)

Determine is two errors have the same code.

Overrides:
equals in class java.lang.Object
Returns:
True if both errors have the same code.

getName

public java.lang.String getName()

Provides a human readable name of the error. This is provided for error logs, as the code should be used for any comparisons.

* @return The name of the error code.



Copyright © 2002,2003 Real Time Entertainment Group, LLC. All Rights Reserved.