com.caucho.bam
Class BamError

java.lang.Object
  extended by com.caucho.bam.BamError
All Implemented Interfaces:
java.io.Serializable

public class BamError
extends java.lang.Object
implements java.io.Serializable

ActorError encapsulates error responses The errors are defined in RFC-3920, XMPP

See Also:
Serialized Form

Nested Class Summary
static class BamError.ErrorGroup
           
 
Field Summary
static java.lang.String address_MALFORMED
          The target address syntax is invalid ("modify")
static java.lang.String BAD_REQUEST
          Malformed or unprocessable request, e.g.
static java.lang.String CONFLICT
          An existing resource or session already exists.
static java.lang.String CONNECTION_TIMEOUT
          Error if the connection to the server failed.
static java.lang.String FEATURE_NOT_IMPLEMENTED
          The feature is nor implemented, e.g.
static java.lang.String FORBIDDEN
          The requestor does not have proper authorization.
static java.lang.String GONE
          The target or server is no longer at this address.
static java.lang.String INTERNAL_SERVER_ERROR
          An internal server error ("wait")
static java.lang.String ITEM_NOT_FOUND
          The target address doesn't exist ("cancel")
static java.lang.String NOT_ACCEPTABLE
          The request is forbidden because of application policy, i.e.
static java.lang.String NOT_ALLOWED
          The server does not any entity to perform the action ("cancel")
static java.lang.String NOT_AUTHORIZED
          The entity does not have the proper credentials ("auth")
static java.lang.String PAYMENT_REQUIRED
          The entity does not have payment to the service ("auth")
static java.lang.String RECIPIENT_UNAVAILABLE
          The recipient exists, but is currently not attached ("wait")
static java.lang.String REDIRECT
          The recipient is at a new address ("modify")
static java.lang.String REGISTRATION_REQUIRED
          The entity does not have proper registration for the service ("auth")
static java.lang.String REMOTE_CONNECTION_FAILED
          Error if the connection to the remote connection failed.
static java.lang.String REMOTE_LISTENER_UNAVAILABLE
          Error if the target server does not have a bam protocol listener available.
static java.lang.String REMOTE_SERVER_NOT_FOUND
          The remote server does not exist ("cancel")
static java.lang.String REMOTE_SERVER_TIMEOUT
          The remote server could not be contacted ("wait")
static java.lang.String RESOURCE_CONSTRAINT
          The remote service does not have resources to process the request ("wait")
static java.lang.String SERVICE_UNAVAILABLE
          The remote server does not provide the service ("cancel")
static java.lang.String SUBSCRIPTION_REQUIRED
          The resource required a subscription before use ("auth")
static java.lang.String TYPE_AUTH
          Retry after providing credentials
static java.lang.String TYPE_CANCEL
          Do not retry, i.e.
static java.lang.String TYPE_CONTINUE
          proceed, i.e.
static java.lang.String TYPE_MODIFY
          change the request data and try again
static java.lang.String TYPE_WAIT
          Retry after waiting
static java.lang.String UNDEFINED_CONDITION
          An error outside this list (should have an _extra field)
static java.lang.String UNEXPECTED_REQUEST
          The request was syntactically correct, but out-of-order ("wait")
 
Constructor Summary
BamError(java.lang.String text)
          Misc error
BamError(java.lang.String type, java.lang.String group)
          An error response
BamError(java.lang.String type, java.lang.String group, java.lang.String text)
          An error response
BamError(java.lang.String type, java.lang.String group, java.lang.String text, java.io.Serializable data)
          An error response
 
Method Summary
static BamError create(java.lang.Throwable e)
          Creates an ActorError based on an exception
 ErrorPacketException createException()
           
 java.io.Serializable getData()
          Returns any data for the error
 java.io.Serializable getExtra()
          Extra information for UNDEFINED_CONDITION
 java.lang.String getGroup()
          Returns the error group
 java.lang.String getText()
          Returns the error text
 java.lang.String getType()
          Returns the error type
 void setData(java.io.Serializable data)
          Sets any data for the error
 void setExtra(java.io.Serializable extra)
          Extra information for UNDEFINED_CONDITION
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE_AUTH

public static final java.lang.String TYPE_AUTH
Retry after providing credentials

See Also:
Constant Field Values

TYPE_CANCEL

public static final java.lang.String TYPE_CANCEL
Do not retry, i.e. unrecoverable

See Also:
Constant Field Values

TYPE_CONTINUE

public static final java.lang.String TYPE_CONTINUE
proceed, i.e. this was a warning

See Also:
Constant Field Values

TYPE_MODIFY

public static final java.lang.String TYPE_MODIFY
change the request data and try again

See Also:
Constant Field Values

TYPE_WAIT

public static final java.lang.String TYPE_WAIT
Retry after waiting

See Also:
Constant Field Values

CONNECTION_TIMEOUT

public static final java.lang.String CONNECTION_TIMEOUT
Error if the connection to the server failed.

See Also:
Constant Field Values

REMOTE_CONNECTION_FAILED

public static final java.lang.String REMOTE_CONNECTION_FAILED
Error if the connection to the remote connection failed.

See Also:
Constant Field Values

REMOTE_LISTENER_UNAVAILABLE

public static final java.lang.String REMOTE_LISTENER_UNAVAILABLE
Error if the target server does not have a bam protocol listener available.

See Also:
Constant Field Values

BAD_REQUEST

public static final java.lang.String BAD_REQUEST
Malformed or unprocessable request, e.g. bad type. ("cancel")

See Also:
Constant Field Values

CONFLICT

public static final java.lang.String CONFLICT
An existing resource or session already exists. ("cancel")

See Also:
Constant Field Values

FEATURE_NOT_IMPLEMENTED

public static final java.lang.String FEATURE_NOT_IMPLEMENTED
The feature is nor implemented, e.g. bad query class. ("cancel")

See Also:
Constant Field Values

FORBIDDEN

public static final java.lang.String FORBIDDEN
The requestor does not have proper authorization. ("auth")

See Also:
Constant Field Values

GONE

public static final java.lang.String GONE
The target or server is no longer at this address. ("modify")

See Also:
Constant Field Values

INTERNAL_SERVER_ERROR

public static final java.lang.String INTERNAL_SERVER_ERROR
An internal server error ("wait")

See Also:
Constant Field Values

ITEM_NOT_FOUND

public static final java.lang.String ITEM_NOT_FOUND
The target address doesn't exist ("cancel")

See Also:
Constant Field Values

address_MALFORMED

public static final java.lang.String address_MALFORMED
The target address syntax is invalid ("modify")

See Also:
Constant Field Values

NOT_ACCEPTABLE

public static final java.lang.String NOT_ACCEPTABLE
The request is forbidden because of application policy, i.e. it's a valid request, but not allowed ("modify")

See Also:
Constant Field Values

NOT_ALLOWED

public static final java.lang.String NOT_ALLOWED
The server does not any entity to perform the action ("cancel")

See Also:
Constant Field Values

NOT_AUTHORIZED

public static final java.lang.String NOT_AUTHORIZED
The entity does not have the proper credentials ("auth")

See Also:
Constant Field Values

PAYMENT_REQUIRED

public static final java.lang.String PAYMENT_REQUIRED
The entity does not have payment to the service ("auth")

See Also:
Constant Field Values

RECIPIENT_UNAVAILABLE

public static final java.lang.String RECIPIENT_UNAVAILABLE
The recipient exists, but is currently not attached ("wait")

See Also:
Constant Field Values

REDIRECT

public static final java.lang.String REDIRECT
The recipient is at a new address ("modify")

See Also:
Constant Field Values

REGISTRATION_REQUIRED

public static final java.lang.String REGISTRATION_REQUIRED
The entity does not have proper registration for the service ("auth")

See Also:
Constant Field Values

REMOTE_SERVER_NOT_FOUND

public static final java.lang.String REMOTE_SERVER_NOT_FOUND
The remote server does not exist ("cancel")

See Also:
Constant Field Values

REMOTE_SERVER_TIMEOUT

public static final java.lang.String REMOTE_SERVER_TIMEOUT
The remote server could not be contacted ("wait")

See Also:
Constant Field Values

RESOURCE_CONSTRAINT

public static final java.lang.String RESOURCE_CONSTRAINT
The remote service does not have resources to process the request ("wait")

See Also:
Constant Field Values

SERVICE_UNAVAILABLE

public static final java.lang.String SERVICE_UNAVAILABLE
The remote server does not provide the service ("cancel")

See Also:
Constant Field Values

SUBSCRIPTION_REQUIRED

public static final java.lang.String SUBSCRIPTION_REQUIRED
The resource required a subscription before use ("auth")

See Also:
Constant Field Values

UNDEFINED_CONDITION

public static final java.lang.String UNDEFINED_CONDITION
An error outside this list (should have an _extra field)

See Also:
Constant Field Values

UNEXPECTED_REQUEST

public static final java.lang.String UNEXPECTED_REQUEST
The request was syntactically correct, but out-of-order ("wait")

See Also:
Constant Field Values
Constructor Detail

BamError

public BamError(java.lang.String text)
Misc error

Parameters:
text - an error text

BamError

public BamError(java.lang.String type,
                java.lang.String group)
An error response

Parameters:
type - the error type
group - the error group

BamError

public BamError(java.lang.String type,
                java.lang.String group,
                java.lang.String text)
An error response

Parameters:
type - the error type
group - the error group
text - the error text

BamError

public BamError(java.lang.String type,
                java.lang.String group,
                java.lang.String text,
                java.io.Serializable data)
An error response

Parameters:
type - the error type
group - the error group
text - the error text
Method Detail

create

public static BamError create(java.lang.Throwable e)
Creates an ActorError based on an exception


getType

public java.lang.String getType()
Returns the error type


getGroup

public java.lang.String getGroup()
Returns the error group


getText

public java.lang.String getText()
Returns the error text


getData

public java.io.Serializable getData()
Returns any data for the error


setData

public void setData(java.io.Serializable data)
Sets any data for the error


getExtra

public java.io.Serializable getExtra()
Extra information for UNDEFINED_CONDITION


setExtra

public void setExtra(java.io.Serializable extra)
Extra information for UNDEFINED_CONDITION


createException

public ErrorPacketException createException()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object