net.tomp2p.natpmp
Enum ResultCode

java.lang.Object
  extended by java.lang.Enum<ResultCode>
      extended by net.tomp2p.natpmp.ResultCode
All Implemented Interfaces:
Serializable, Comparable<ResultCode>

public enum ResultCode
extends Enum<ResultCode>

Enumerates the result codes from NAT-PMP messages.

Author:
flszen
See Also:
Message

Enum Constant Summary
NetworkFailure
          Network Failure: e.g.: The gateway itself has not obtained a DHCP lease.
NotAuthorizedRefused
          Not Authorized/Refused: e.g.: Gateway supports mapping, but user has turned feature off.
OutOfResources
          Out of resources: Gateway cannot create any more mappings at this time.
Success
          Success: Successful message.
UnsupportedOpcode
          Unsupported Opcode: The gateway doesn't support the opcode.
UnsupportedVersion
          Unsupported Version: The version of this client library (which is 0) is not supported by the NAT-PMP gateway.
 
Method Summary
static ResultCode valueOf(String name)
          Returns the enum constant of this type with the specified name.
static ResultCode[] 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

Success

public static final ResultCode Success
Success: Successful message.


UnsupportedVersion

public static final ResultCode UnsupportedVersion
Unsupported Version: The version of this client library (which is 0) is not supported by the NAT-PMP gateway.


NotAuthorizedRefused

public static final ResultCode NotAuthorizedRefused
Not Authorized/Refused: e.g.: Gateway supports mapping, but user has turned feature off.


NetworkFailure

public static final ResultCode NetworkFailure
Network Failure: e.g.: The gateway itself has not obtained a DHCP lease.


OutOfResources

public static final ResultCode OutOfResources
Out of resources: Gateway cannot create any more mappings at this time.


UnsupportedOpcode

public static final ResultCode UnsupportedOpcode
Unsupported Opcode: The gateway doesn't support the opcode.

Method Detail

values

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

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

valueOf

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


Copyright © 2013. All Rights Reserved.