java.lang.Object
org.cybergarage.upnp.UPnPStatus
Represents the status of UPnP operations and provides standard UPnP error codes.
This class encapsulates UPnP status codes and their corresponding descriptions for error handling in UPnP operations. It includes standard UPnP error codes defined by the UPnP Device Architecture specification.
The class provides both static utility methods for converting error codes to human-readable strings and instance methods for storing and retrieving status information.
Field Summary
Modifier and TypeFieldDescriptionstatic final intError code indicating the action execution failed for other reasons.private int/////////////////////////////////////////////private StringHuman-readable description of the status.static final intError code indicating the requested action is not supported by the device.static final intError code indicating the action arguments are invalid or missing.static final intError code indicating the requested state variable does not exist.static final intError code indicating the current state values are out of sync.static final intError code indicating required preconditions are not met.Constructor Summary
ConstructorsConstructorDescriptionCreates a new UPnPStatus with default values (code 0, empty description).UPnPStatus(int code, String desc) Creates a new UPnPStatus with the specified code and description.Method Summary
Modifier and TypeMethodDescriptionstatic final Stringcode2String(int code) Converts a UPnP status code to its corresponding human-readable string.intgetCode()Gets the status code.Gets the status description.voidsetCode(int code) Sets the status code.voidsetDescription(String description) Sets the status description.
Field Details
INVALID_ACTION
public static final int INVALID_ACTIONError code indicating the requested action is not supported by the device.- See Also:
INVALID_ARGS
public static final int INVALID_ARGSError code indicating the action arguments are invalid or missing.- See Also:
OUT_OF_SYNC
public static final int OUT_OF_SYNCError code indicating the current state values are out of sync.- See Also:
INVALID_VAR
public static final int INVALID_VARError code indicating the requested state variable does not exist.- See Also:
PRECONDITION_FAILED
public static final int PRECONDITION_FAILEDError code indicating required preconditions are not met.- See Also:
ACTION_FAILED
public static final int ACTION_FAILEDError code indicating the action execution failed for other reasons.- See Also:
code
private int code/////////////////////////////////////////////description
Human-readable description of the status.
Constructor Details
UPnPStatus
public UPnPStatus()Creates a new UPnPStatus with default values (code 0, empty description).UPnPStatus
Creates a new UPnPStatus with the specified code and description.- Parameters:
code- the status codedesc- the status description
Method Details
code2String
Converts a UPnP status code to its corresponding human-readable string.- Parameters:
code- the UPnP status code to convert- Returns:
- the human-readable description of the status code
getCode
public int getCode()Gets the status code.- Returns:
- the status code
setCode
public void setCode(int code) Sets the status code.- Parameters:
code- the status code to set
getDescription
setDescription
Sets the status description.- Parameters:
description- the status description to set