tigase.xmpp

## Enum Authorization

- java.lang.Object
- - java.lang.Enum<Authorization>
  - - tigase.xmpp.Authorization

- All Implemented Interfaces:
    Serializable, Comparable<Authorization>

      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.
  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

  Version:
    $Rev$
  Author:
    Artur Hefczyc

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `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 Summary

    Fields
    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`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `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.

    - ### Methods inherited from class java.lang.Enum

      `clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Enum Constant Detail

    - #### AUTHORIZED

          public static final Authorization AUTHORIZED

    - #### BAD_REQUEST

          public static final Authorization BAD_REQUEST

    - #### CONFLICT

          public static final Authorization CONFLICT

    - #### FEATURE_NOT_IMPLEMENTED

          public static final Authorization FEATURE_NOT_IMPLEMENTED

    - #### FORBIDDEN

          public static final Authorization FORBIDDEN

    - #### GONE

          public static final Authorization GONE

    - #### INTERNAL_SERVER_ERROR

          public static final Authorization INTERNAL_SERVER_ERROR

    - #### ITEM_NOT_FOUND

          public static final Authorization ITEM_NOT_FOUND

    - #### JID_MALFORMED

          public static final Authorization JID_MALFORMED

    - #### NOT_ACCEPTABLE

          public static final Authorization NOT_ACCEPTABLE

    - #### NOT_ALLOWED

          public static final Authorization NOT_ALLOWED

    - #### NOT_AUTHORIZED

          public static final Authorization NOT_AUTHORIZED

    - #### PAYMENT_REQUIRED

          public static final Authorization PAYMENT_REQUIRED

    - #### POLICY_VIOLATION

          public static final Authorization POLICY_VIOLATION

    - #### RECIPIENT_UNAVAILABLE

          public static final Authorization RECIPIENT_UNAVAILABLE

    - #### REDIRECT

          public static final Authorization REDIRECT

    - #### REGISTRATION_REQUIRED

          public static final Authorization REGISTRATION_REQUIRED

    - #### REMOTE_SERVER_NOT_FOUND

          public static final Authorization REMOTE_SERVER_NOT_FOUND

    - #### REMOTE_SERVER_TIMEOUT

          public static final Authorization REMOTE_SERVER_TIMEOUT

    - #### RESOURCE_CONSTRAINT

          public static final Authorization RESOURCE_CONSTRAINT

    - #### SERVICE_UNAVAILABLE

          public static final Authorization SERVICE_UNAVAILABLE

    - #### SUBSCRIPTION_REQUIRED

          public static final Authorization SUBSCRIPTION_REQUIRED

    - #### UNDEFINED_CONDITION

          public static final Authorization UNDEFINED_CONDITION

    - #### UNEXPECTED_REQUEST

          public static final Authorization UNEXPECTED_REQUEST

  - ### Field Detail

    - #### ERR_TYPE_AUTH

          protected static final String ERR_TYPE_AUTH

      See Also:
        Constant Field Values

    - #### ERR_TYPE_CANCEL

          protected static final String ERR_TYPE_CANCEL

      See Also:
        Constant Field Values

    - #### ERR_TYPE_MODIFY

          protected static final String ERR_TYPE_MODIFY

      See Also:
        Constant Field Values

    - #### ERR_TYPE_WAIT

          protected static final String ERR_TYPE_WAIT

      See Also:
        Constant Field Values

  - ### Method Detail

    - #### values

          public static Authorization[] values()

      Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

          for (Authorization c : Authorization.values())
              System.out.println(c);

      Returns:
        an array containing the constants of this enum type, in the order they are declared

    - #### valueOf

          public static Authorization valueOf(String name)

      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
        `NullPointerException` - if the argument is null

    - #### getCondition

          public abstract String getCondition()

      Method description

    - #### getErrorCode

          public abstract int getErrorCode()

      Method description

    - #### getErrorType

          public abstract String getErrorType()

      Method description

    - #### 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 given `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.
      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.

Copyright © 2013 Tigase. All rights reserved.