Top Description Fields Constructors Methods
org.osgi.service.zigbee

public Class ZigBeeException

extends RuntimeException
Class Inheritance
Known Direct Subclasses
org.osgi.service.zigbee.APSException, org.osgi.service.zigbee.ZCLException, org.osgi.service.zigbee.ZDPException

This class represents root exception for all the code related to ZigBee. The provided constants names, but not the values.
Author
$Id: c679d422f7d3d2fe33229cb667d827b878da73cd $

Field Summary

Modifier and TypeField and Description
protected final int
errorCode

The error code associated to this exception.

public static final int
OSGI_EXISTING_ID

The error code used when another endpoint exists with the same ID.

public static final int
OSGI_MULTIPLE_HOSTS

The error code used when several hosts exist for this PAN ID target or HOST_PID target.

private static final long
public static final int
TIMEOUT

The error code used when the timeout of ZigBee asynchronous exchange is reached.

public static final int
UNKNOWN_ERROR

This error code is used if the ZigBee error returned is not covered by this API specification.

protected final int
zigBeeErrorCode

The actual error code returned by the ZigBee node.

Constructor Summary

AccessConstructor and Description
public
ZigBeeException(String
exception error description.
errorDesc
)

Creates a ZigBeeException containing only a description, but no error codes.

public
ZigBeeException(int
One of the error codes defined in this interface or UNKNOWN_ERROR if the actual error is not listed in this interface.
errorCode
,
String
An error description which explain the type of problem.
errorDesc
)

Creates a ZigBeeException containing a specific errorCode.

public
ZigBeeException(int
One of the error codes defined in this interface or UNKNOWN_ERROR the actual error is not covered in this interface.
errorCode
,
int
The actual status code or UNKNOWN_ERROR if this status is unknown.
zigBeeErrorCode
,
String
An error description which explain the type of problem.
errorDesc
)

Creates a ZigBeeException containing a specific errorCode or zigBeeErrorCode.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the error code.
getErrorCode
()

Returns the error code.

public int

Returns:

One of the error codes defined above. If the returned error code is UNKNOWN_ERROR and the hasZigBeeErrorCode() returns true then the getZigBeeErrorCode() provides the actual ZigBee error code returned by the device.
getZigBeeErrorCode
()

Returns the potential ZigBee error code.

public boolean

Returns:

true if the ZigBeeException convey also the actual error code returned by the ZigBee stack.
hasZigBeeErrorCode
()

Checks if this exception has a ZigBee error code.

Field Detail

errorCodeback to summary
protected final int errorCode

The error code associated to this exception.

See Also
getErrorCode()
OSGI_EXISTING_IDback to summary
public static final int OSGI_EXISTING_ID

The error code used when another endpoint exists with the same ID.

OSGI_MULTIPLE_HOSTSback to summary
public static final int OSGI_MULTIPLE_HOSTS

The error code used when several hosts exist for this PAN ID target or HOST_PID target.

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.lang.RuntimeException.serialVersionUID.

TIMEOUTback to summary
public static final int TIMEOUT

The error code used when the timeout of ZigBee asynchronous exchange is reached.

UNKNOWN_ERRORback to summary
public static final int UNKNOWN_ERROR

This error code is used if the ZigBee error returned is not covered by this API specification.

zigBeeErrorCodeback to summary
protected final int zigBeeErrorCode

The actual error code returned by the ZigBee node.

See Also
ZigBeeException#getZigBeeErrorCode()

Constructor Detail

ZigBeeExceptionback to summary
public ZigBeeException(String errorDesc)

Creates a ZigBeeException containing only a description, but no error codes. If issued on this exception the getErrorCode() and getZigBeeErrorCode() methods return the UNKNOWN_ERROR constant.

Parameters
errorDesc:String

exception error description.

ZigBeeExceptionback to summary
public ZigBeeException(int errorCode, String errorDesc)

Creates a ZigBeeException containing a specific errorCode. Using this constructor with errorCode set to UNKNOWN_ERROR is equivalent to call ZigBeeException(String).

Parameters
errorCode:int

One of the error codes defined in this interface or UNKNOWN_ERROR if the actual error is not listed in this interface.

errorDesc:String

An error description which explain the type of problem.

ZigBeeExceptionback to summary
public ZigBeeException(int errorCode, int zigBeeErrorCode, String errorDesc)

Creates a ZigBeeException containing a specific errorCode or zigBeeErrorCode. Using this constructor with both the errorCode and zigBeeErrorCode set to UNKNOWN_ERROR is equivalent to call ZigBeeException(String).

Parameters
errorCode:int

One of the error codes defined in this interface or UNKNOWN_ERROR the actual error is not covered in this interface.

zigBeeErrorCode:int

The actual status code or UNKNOWN_ERROR if this status is unknown.

errorDesc:String

An error description which explain the type of problem.

Method Detail

getErrorCodeback to summary
public int getErrorCode()

Returns the error code.

Returns:int

the error code.

getZigBeeErrorCodeback to summary
public int getZigBeeErrorCode()

Returns the potential ZigBee error code.

Returns:int

One of the error codes defined above. If the returned error code is UNKNOWN_ERROR and the hasZigBeeErrorCode() returns true then the getZigBeeErrorCode() provides the actual ZigBee error code returned by the device.

hasZigBeeErrorCodeback to summary
public boolean hasZigBeeErrorCode()

Checks if this exception has a ZigBee error code.

Returns:boolean

true if the ZigBeeException convey also the actual error code returned by the ZigBee stack.