public enum Authorization extends Enum<Authorization>
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.Created: Thu Oct 14 22:19:11 2004
Modifier and Type | Field and Description |
---|---|
protected static String |
ERR_TYPE_AUTH |
protected static String |
ERR_TYPE_CANCEL |
protected static String |
ERR_TYPE_MODIFY |
protected static String |
ERR_TYPE_WAIT |
Modifier and Type | Method and Description |
---|---|
static Authorization |
getByCondition(String condition) |
abstract String |
getCondition()
Method description
|
abstract int |
getErrorCode()
Method description
|
abstract String |
getErrorType()
Method description
|
Packet |
getResponseMessage(Packet packet,
String text,
boolean includeOriginalXML)
Utility method for generating an error response for a stanza (enclosed by the given
Packet ). |
static Authorization |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Authorization[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Authorization AUTHORIZED
public static final Authorization BAD_REQUEST
public static final Authorization CONFLICT
public static final Authorization FEATURE_NOT_IMPLEMENTED
public static final Authorization FORBIDDEN
public static final Authorization GONE
public static final Authorization INTERNAL_SERVER_ERROR
public static final Authorization ITEM_NOT_FOUND
public static final Authorization JID_MALFORMED
public static final Authorization NOT_ACCEPTABLE
public static final Authorization NOT_ALLOWED
public static final Authorization NOT_AUTHORIZED
public static final Authorization PAYMENT_REQUIRED
public static final Authorization POLICY_VIOLATION
public static final Authorization RECIPIENT_UNAVAILABLE
public static final Authorization REDIRECT
public static final Authorization REGISTRATION_REQUIRED
public static final Authorization REMOTE_SERVER_NOT_FOUND
public static final Authorization REMOTE_SERVER_TIMEOUT
public static final Authorization RESOURCE_CONSTRAINT
public static final Authorization SERVICE_UNAVAILABLE
public static final Authorization SUBSCRIPTION_REQUIRED
public static final Authorization UNDEFINED_CONDITION
public static final Authorization UNEXPECTED_REQUEST
protected static final String ERR_TYPE_AUTH
protected static final String ERR_TYPE_CANCEL
protected static final String ERR_TYPE_MODIFY
protected static final String ERR_TYPE_WAIT
public static Authorization[] values()
for (Authorization c : Authorization.values()) System.out.println(c);
public static Authorization valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static Authorization getByCondition(String condition)
public abstract String getCondition()
public abstract int getErrorCode()
public abstract String getErrorType()
public Packet getResponseMessage(Packet packet, String text, boolean includeOriginalXML) throws PacketErrorTypeException
Packet
). 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.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.Packet
instance with an error response for a given
packet.PacketErrorTypeException
- if the packet given as a parameter encloses
an error stanza already.Copyright © 2018 "Tigase, Inc.". All rights reserved.