net.sf.xenqtt.message
Enum ConnectReturnCode

java.lang.Object
  extended by java.lang.Enum<ConnectReturnCode>
      extended by net.sf.xenqtt.message.ConnectReturnCode
All Implemented Interfaces:
Serializable, Comparable<ConnectReturnCode>

public enum ConnectReturnCode
extends Enum<ConnectReturnCode>

The code returned in the ConnAckMessage. The order is important as the ordinal is the numeric value used in messages.


Enum Constant Summary
ACCEPTED
          Connection Accepted (success)
BAD_CREDENTIALS
          Connection Refused: bad user name or password
IDENTIFIER_REJECTED
          Connection Refused: identifier rejected.
NOT_AUTHORIZED
          Connection Refused: not authorized
OTHER
          a return code unknown at the time of this writing
SERVER_UNAVAILABLE
          Connection Refused: server unavailable
UNACCEPTABLE_PROTOCOL_VERSION
          Connection Refused: unacceptable protocol version
 
Method Summary
static ConnectReturnCode lookup(int value)
           
 int value()
           
static ConnectReturnCode valueOf(String name)
          Returns the enum constant of this type with the specified name.
static ConnectReturnCode[] 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

ACCEPTED

public static final ConnectReturnCode ACCEPTED
Connection Accepted (success)


UNACCEPTABLE_PROTOCOL_VERSION

public static final ConnectReturnCode UNACCEPTABLE_PROTOCOL_VERSION
Connection Refused: unacceptable protocol version


IDENTIFIER_REJECTED

public static final ConnectReturnCode IDENTIFIER_REJECTED
Connection Refused: identifier rejected. Sent if the unique client identifier is not between 1 and 23 characters in length.


SERVER_UNAVAILABLE

public static final ConnectReturnCode SERVER_UNAVAILABLE
Connection Refused: server unavailable


BAD_CREDENTIALS

public static final ConnectReturnCode BAD_CREDENTIALS
Connection Refused: bad user name or password


NOT_AUTHORIZED

public static final ConnectReturnCode NOT_AUTHORIZED
Connection Refused: not authorized


OTHER

public static final ConnectReturnCode OTHER
a return code unknown at the time of this writing

Method Detail

values

public static ConnectReturnCode[] 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 (ConnectReturnCode c : ConnectReturnCode.values())
    System.out.println(c);

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

valueOf

public static ConnectReturnCode 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

lookup

public static ConnectReturnCode lookup(int value)
Returns:
The ConnectReturnCode for the specified value. OTHER if the value does not match any other explicit enum.

value

public int value()
Returns:
The numeric value for this ConnectReturnCode


Copyright © 2013. All Rights Reserved.