java.lang.Object
org.freenetproject.ForwardPortStatus
Represents the status of a port forwarding operation.
This class encapsulates the result of UPnP port forwarding attempts, including success/failure status, reason messages, and external port information.
This class encapsulates the result of UPnP port forwarding attempts, including success/failure status, reason messages, and external port information.
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe port forward definitely failed.static final intThe port forward definitely succeeded.final intThe external port that was actually forwarded.static final intThe port forward is in progressstatic final intThe port forward may have succeeded.static final intThe port forward probably failedstatic final intThe port forward probably succeeded.final StringA descriptive message explaining the status or reason for failurefinal intThe current status of the port forwarding operationConstructor Summary
ConstructorsConstructorDescriptionForwardPortStatus(int status, String reason, int externalPort) Creates a new ForwardPortStatus with the specified status, reason, and external port.Method Summary
Field Details
status
public final int statusThe current status of the port forwarding operationDEFINITE_SUCCESS
public static final int DEFINITE_SUCCESSThe port forward definitely succeeded.- See Also:
PROBABLE_SUCCESS
public static final int PROBABLE_SUCCESSThe port forward probably succeeded. I.e. it succeeded unless there was for example hostile action on the part of the router.- See Also:
MAYBE_SUCCESS
public static final int MAYBE_SUCCESSThe port forward may have succeeded. Or it may not have. We should definitely try to check out of band. See UP&P: Many routers say they've forwarded the port when they haven't.- See Also:
IN_PROGRESS
PROBABLE_FAILURE
public static final int PROBABLE_FAILUREThe port forward probably failed- See Also:
DEFINITE_FAILURE
public static final int DEFINITE_FAILUREThe port forward definitely failed.- See Also:
reasonString
A descriptive message explaining the status or reason for failureexternalPort
public final int externalPortThe external port that was actually forwarded. Some plugins may need to change the external port and can return it to the node here.
Constructor Details
ForwardPortStatus
Creates a new ForwardPortStatus with the specified status, reason, and external port.- Parameters:
status- the status code of the port forwarding operationreason- a descriptive message explaining the status or reason for failureexternalPort- the external port that was actually forwarded