public class StatusException
extends java.lang.Exception
StatusException
is caught by the driver, it generates
a status
document that gets sent to the DirXML engine
and logged to the DSTrace utility and the DirXML logging facility.
If you want to simply print a message to the DSTrace utility, you can use the Tracer object that is passed to the extension's init() method rather than throwing an exception.
Modifier and Type | Field and Description |
---|---|
static int |
LEVEL_ERROR
A non-fatal error occurred in the
Extension . |
static int |
LEVEL_FATAL
A fatal error occurred and the driver should shut down.
|
static int |
LEVEL_RETRY
A temporary error occurred and the driver should retry the event later.
|
static int |
LEVEL_WARNING
A non-fatal condition occurred
in the
Extension . |
static int |
TYPE_APP_AUTHENTICATION
Related to an application authentication request.
|
static int |
TYPE_APP_CONNECTION
A change occurred in the availability of an application.
|
static int |
TYPE_APP_GENERAL
A general response from an application API.
|
static int |
TYPE_DRIVER_GENERAL
A response generated by a driver.
|
static int |
TYPE_PASSWORD_SET_OPERATION
A response to an application password set or change event.
|
Constructor and Description |
---|
StatusException(int level,
int type,
java.lang.String code,
java.lang.String message)
Creates a
StatusException object that is used to
indicate to the driver that an error occurred in the
extension. |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getCode()
Returns the
code value that was passed
into the constructor. |
int |
getLevel()
Returns the
level value that was passed
into the constructor. |
int |
getType()
Returns the
type value that was passed
into the constructor. |
public static final int LEVEL_WARNING
Extension
. The resulting status
document causes a yellow message to be written to the DSTrace utility.public static final int LEVEL_ERROR
Extension
. The resulting status document
causes a red message to be written to the DSTrace
utility. When a regular Exception
object is thrown from an extension, it also results
in a status document being created with this statusLevel.public static final int LEVEL_FATAL
StatusException
or Exception
that is thrown from the init()
method of an
Extension
automatically gets promoted to a
StatusException
with a statusLevel
set to LEVEL_FATAL
.public static final int LEVEL_RETRY
public static final int TYPE_APP_GENERAL
public static final int TYPE_APP_AUTHENTICATION
public static final int TYPE_APP_CONNECTION
public static final int TYPE_DRIVER_GENERAL
public static final int TYPE_PASSWORD_SET_OPERATION
public StatusException(int level, int type, java.lang.String code, java.lang.String message)
StatusException
object that is used to
indicate to the driver that an error occurred in the
extension.level
- Set to either
LEVEL_WARNING
,
LEVEL_ERROR
,
LEVEL_FATAL
, or
LEVEL_RETRY
.type
- An indication of the type of error that occurred. Must be set to either
TYPE_APP_GENERAL
,
TYPE_APP_AUTHENTICATION
,
TYPE_APP_CONNECTION
,
TYPE_DRIVER_GENERAL
, or
TYPE_PASSWORD_SET_OPERATION
.code
- The error code returned from the application, if applicable. This is usually a number
but can be any string. If the error didn't originate in the application or if the
application doesn't use error codes, set it to null
.message
- A descriptive message describing the error that occurred.public int getLevel()
level
value that was passed
into the constructor.STATUS_WARNING
,
STATUS_ERROR
, or
LEVEL_FATAL
, or
LEVEL_RETRY
public int getType()
type
value that was passed
into the constructor.public java.lang.String getCode()
code
value that was passed
into the constructor.