Enum PacketType

    • Enum Constant Detail

      • ACCESS_REQUEST

        public static final PacketType ACCESS_REQUEST
        Enum representing the Access-Request packet type specified in section 4.1 of RFC 2865.
      • ACCESS_ACCEPT

        public static final PacketType ACCESS_ACCEPT
        Enum representing the Access-Accept packet type specified in section 4.2 of RFC 2865.
      • ACCESS_REJECT

        public static final PacketType ACCESS_REJECT
        Enum representing the Access-Reject packet type specified in section 4.3 of RFC 2865.
      • ACCOUNTING_REQUEST

        public static final PacketType ACCOUNTING_REQUEST
        Enum representing the Accounting-Request packet type specified in section 4.1 of RFC 2866.
      • ACCOUNTING_RESPONSE

        public static final PacketType ACCOUNTING_RESPONSE
        Enum representing the Accounting-Response packet type specified in section 4.2 of RFC 2866.
      • ACCESS_CHALLENGE

        public static final PacketType ACCESS_CHALLENGE
        Enum representing the Access-Challenge packet type specified in section 4.4 of RFC 2865.
      • RESERVED

        public static final PacketType RESERVED
        Enum representing the reserved packet type specified in section 3 of RFC 2865.
      • UNKNOWN

        public static final PacketType UNKNOWN
        Enum used to represent unrecognized and hence unsupported packet type codes. This is solely for use in this library and is not representative of any RFC specification.
    • Method Detail

      • values

        public static PacketType[] 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 (PacketType c : PacketType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static PacketType 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
      • getTypeCode

        public int getTypeCode()
        Get the type code for a given PacketType.
        Returns:
        the type code for the packet.
      • getPacketType

        public static final PacketType getPacketType​(int code)
        Get the PacketType corresponding to a given code from an incoming packet.
        Parameters:
        code - the integer type code of the packet
        Returns:
        the PacketType representing the corresponding on-the-wire type code or UNKNOWN if the integer code is for a packet type that is not yet supported.