Package tigase.xmpp

Enum Authorization

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<Authorization>

    public enum Authorization
    extends java.lang.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

    Author:
    Artur Hefczyc
    • 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​(java.lang.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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getByCondition

        public static Authorization getByCondition​(java.lang.String condition)
      • getCondition

        public abstract java.lang.String getCondition()
      • getErrorCode

        public abstract int getErrorCode()
      • getErrorType

        public abstract java.lang.String getErrorType()
      • getResponseMessage

        public Packet getResponseMessage​(Packet packet,
                                         java.lang.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.