Package tigase.xmpp
Enum Class Authorization
- All Implemented Interfaces:
Serializable
,Comparable<Authorization>
,Constable
Authorization
enumeration type defines authorization error codes. It has also capability to build error
response message relevant to specific error code (or success code). It is used not only for authorization process but
also by other features implementation accessing session data.All defined errors comes directly from XMPP core RFC. For each error has assigned error code - from old Jabber spec. and error condition - XMPP error spec.
Created: Thu Oct 14 22:19:11 2004
- Author:
- Artur Hefczyc
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescription -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Authorization
getByCondition
(String condition) abstract String
abstract int
abstract String
getResponseMessage
(Packet packet, String text, boolean includeOriginalXML) Utility method for generating an error response for a stanza (enclosed by the givenPacket
).static Authorization
Returns the enum constant of this class with the specified name.static Authorization[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
AUTHORIZED
-
BAD_REQUEST
-
CONFLICT
-
FEATURE_NOT_IMPLEMENTED
-
FORBIDDEN
-
GONE
-
INTERNAL_SERVER_ERROR
-
ITEM_NOT_FOUND
-
JID_MALFORMED
-
NOT_ACCEPTABLE
-
NOT_ALLOWED
-
NOT_AUTHORIZED
-
PAYMENT_REQUIRED
-
POLICY_VIOLATION
-
RECIPIENT_UNAVAILABLE
-
REDIRECT
-
REGISTRATION_REQUIRED
-
REMOTE_SERVER_NOT_FOUND
-
REMOTE_SERVER_TIMEOUT
-
RESOURCE_CONSTRAINT
-
SERVICE_UNAVAILABLE
-
SUBSCRIPTION_REQUIRED
-
UNDEFINED_CONDITION
-
UNEXPECTED_REQUEST
-
-
Field Details
-
ERR_TYPE_AUTH
- See Also:
-
ERR_TYPE_CANCEL
- See Also:
-
ERR_TYPE_MODIFY
- See Also:
-
ERR_TYPE_WAIT
- See Also:
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
getByCondition
-
getCondition
-
getErrorCode
public abstract int getErrorCode() -
getErrorType
-
getResponseMessage
public Packet getResponseMessage(Packet packet, String text, boolean includeOriginalXML) throws PacketErrorTypeException Utility method for generating an error response for a stanza (enclosed by the givenPacket
). In some cases it may happen that the error packet is bounced back to the sender which triggers another attempt to generate an error response for the error packet. This may lead to an infinite loop inside the component (Tigase server) eating up CPU and slowing everything down. To prevent this the method detects the error stanza typy and generates an exception.- Parameters:
packet
- is the packet for which the error response is generated.text
- is an error human readable text message.includeOriginalXML
- is a boolean value indicating whether the original content of the stanza (children of the top level element) have to be included in the error stanza.- Returns:
- a new
Packet
instance with an error response for a given packet. - Throws:
PacketErrorTypeException
- if the packet given as a parameter encloses an error stanza already.
-