Xindice API
version 1.2m1

org.apache.xindice.core
Class FaultCodes

java.lang.Object
  extended byorg.apache.xindice.core.FaultCodes

public abstract class FaultCodes
extends Object

FaultCodes defines the Xindice specific fault codes and associated error messages.

Version:
$Revision: 564427 $, $Date: 2007-08-09 19:45:48 -0400 (Thu, 09 Aug 2007) $

Field Summary
static int COL
           
static int COL_CANNOT_CREATE
           
static int COL_CANNOT_DROP
           
static int COL_CANNOT_RETRIEVE
           
static int COL_CANNOT_STORE
           
static int COL_COLLECTION_CLOSED
           
static int COL_COLLECTION_NOT_FOUND
           
static int COL_COLLECTION_READ_ONLY
           
static int COL_DOCUMENT_MALFORMED
           
static int COL_DOCUMENT_NOT_FOUND
           
static int COL_DUPLICATE_COLLECTION
           
static int COL_DUPLICATE_RESOURCE
           
static int COL_INVALID_RESULT
           
static int COL_NO_FILER
           
static int COL_NO_INDEXMANAGER
           
static int COL_NULL_RESULT
           
static int DBE
           
static int DBE_CANNOT_CREATE
           
static int DBE_CANNOT_DROP
           
static int DBE_CANNOT_READ
           
static int DBE_NO_PARENT
           
static int GEN
           
static int GEN_CRITICAL_ERROR
           
static int GEN_FATAL_ERROR
           
static int GEN_GENERAL_ERROR
           
static int GEN_UNKNOWN
           
static int IDX
           
static int IDX_CANNOT_CREATE
           
static int IDX_CORRUPTED
           
static int IDX_DUPLICATE_INDEX
           
static int IDX_INDEX_NOT_FOUND
           
static int IDX_MATCHES_NOT_FOUND
           
static int IDX_NOT_SUPPORTED
           
static int IDX_STYLE_NOT_FOUND
           
static int IDX_VALUE_NOT_FOUND
           
static int JAVA
           
static int JAVA_RUNTIME_ERROR
           
static int MAX_CODE
          Defines maximum possible fault code
static int OBJ
           
static int QRY
           
static int QRY_COMPILATION_ERROR
           
static int QRY_NOT_SUPPORTED
           
static int QRY_NULL_RESULT
           
static int QRY_PROCESSING_ERROR
           
static int QRY_STYLE_NOT_FOUND
           
static int SEC
           
static int SEC_INVALID_ACCESS
           
static int SEC_INVALID_CREDENTIALS
           
static int SEC_INVALID_GROUP
           
static int SEC_INVALID_USER
           
static int TRX
           
static int TRX_DOC_LOCKED
           
static int TRX_NO_CONTEXT
           
static int TRX_NOT_ACTIVE
           
static int TRX_NOT_SUPPORTED
           
static int URI
           
static int URI_EMPTY
           
static int URI_NULL
           
static int URI_PARSE_ERROR
           
 
Method Summary
static org.xmldb.api.base.XMLDBException createXMLDBException(Exception e)
          createXMLDBException creates an XMLDBException instance based on the specified Exception.
static org.xmldb.api.base.XMLDBException createXMLDBException(int errorCode, int faultCode, String message, Exception e)
          Creates an XMLDBException instance based on the specified fault code, message, and Exception.
static org.xmldb.api.base.XMLDBException createXMLDBException(int faultCode, String message, Exception e)
           
static org.xmldb.api.base.XMLDBException createXMLDBException(String message, Exception e)
          createXMLDBException creates an XMLDBException instance based on the specified Exception.
static int getErrorCode(int faultCode)
          getErrorCode returns the associated XML:DB error code for the specified Xindice fault code
static int getFaultCode(Exception e)
          getFaultCode examines the provided exception to determine the fault code that is associated with it.
static int getFaultCodeSeries(Exception e)
          getFaultCodeSeries examines the provided exception to determine the fault code series that is associated with it.
static int getFaultCodeType(Exception e)
          getFaultCodeType examines the provided exception to determine the general fault code that is associated with it.
static String getFaultMessage(Exception e)
          getFaultMessage examines the provided exception to determine the fault message that is associated with it.
static String getMessage(int code)
          getMessage returns a textual form for the specified fault code.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_CODE

public static final int MAX_CODE
Defines maximum possible fault code

See Also:
Constant Field Values

GEN

public static final int GEN
See Also:
Constant Field Values

OBJ

public static final int OBJ
See Also:
Constant Field Values

COL

public static final int COL
See Also:
Constant Field Values

IDX

public static final int IDX
See Also:
Constant Field Values

TRX

public static final int TRX
See Also:
Constant Field Values

DBE

public static final int DBE
See Also:
Constant Field Values

QRY

public static final int QRY
See Also:
Constant Field Values

SEC

public static final int SEC
See Also:
Constant Field Values

URI

public static final int URI
See Also:
Constant Field Values

JAVA

public static final int JAVA
See Also:
Constant Field Values

GEN_UNKNOWN

public static final int GEN_UNKNOWN
See Also:
Constant Field Values

GEN_GENERAL_ERROR

public static final int GEN_GENERAL_ERROR
See Also:
Constant Field Values

GEN_CRITICAL_ERROR

public static final int GEN_CRITICAL_ERROR
See Also:
Constant Field Values

GEN_FATAL_ERROR

public static final int GEN_FATAL_ERROR
See Also:
Constant Field Values

COL_COLLECTION_NOT_FOUND

public static final int COL_COLLECTION_NOT_FOUND
See Also:
Constant Field Values

COL_DOCUMENT_NOT_FOUND

public static final int COL_DOCUMENT_NOT_FOUND
See Also:
Constant Field Values

COL_DUPLICATE_COLLECTION

public static final int COL_DUPLICATE_COLLECTION
See Also:
Constant Field Values

COL_NULL_RESULT

public static final int COL_NULL_RESULT
See Also:
Constant Field Values

COL_NO_FILER

public static final int COL_NO_FILER
See Also:
Constant Field Values

COL_NO_INDEXMANAGER

public static final int COL_NO_INDEXMANAGER
See Also:
Constant Field Values

COL_DOCUMENT_MALFORMED

public static final int COL_DOCUMENT_MALFORMED
See Also:
Constant Field Values

COL_CANNOT_STORE

public static final int COL_CANNOT_STORE
See Also:
Constant Field Values

COL_CANNOT_RETRIEVE

public static final int COL_CANNOT_RETRIEVE
See Also:
Constant Field Values

COL_COLLECTION_READ_ONLY

public static final int COL_COLLECTION_READ_ONLY
See Also:
Constant Field Values

COL_COLLECTION_CLOSED

public static final int COL_COLLECTION_CLOSED
See Also:
Constant Field Values

COL_DUPLICATE_RESOURCE

public static final int COL_DUPLICATE_RESOURCE
See Also:
Constant Field Values

COL_CANNOT_CREATE

public static final int COL_CANNOT_CREATE
See Also:
Constant Field Values

COL_CANNOT_DROP

public static final int COL_CANNOT_DROP
See Also:
Constant Field Values

COL_INVALID_RESULT

public static final int COL_INVALID_RESULT
See Also:
Constant Field Values

IDX_VALUE_NOT_FOUND

public static final int IDX_VALUE_NOT_FOUND
See Also:
Constant Field Values

IDX_INDEX_NOT_FOUND

public static final int IDX_INDEX_NOT_FOUND
See Also:
Constant Field Values

IDX_MATCHES_NOT_FOUND

public static final int IDX_MATCHES_NOT_FOUND
See Also:
Constant Field Values

IDX_DUPLICATE_INDEX

public static final int IDX_DUPLICATE_INDEX
See Also:
Constant Field Values

IDX_NOT_SUPPORTED

public static final int IDX_NOT_SUPPORTED
See Also:
Constant Field Values

IDX_STYLE_NOT_FOUND

public static final int IDX_STYLE_NOT_FOUND
See Also:
Constant Field Values

IDX_CORRUPTED

public static final int IDX_CORRUPTED
See Also:
Constant Field Values

IDX_CANNOT_CREATE

public static final int IDX_CANNOT_CREATE
See Also:
Constant Field Values

TRX_DOC_LOCKED

public static final int TRX_DOC_LOCKED
See Also:
Constant Field Values

TRX_NO_CONTEXT

public static final int TRX_NO_CONTEXT
See Also:
Constant Field Values

TRX_NOT_ACTIVE

public static final int TRX_NOT_ACTIVE
See Also:
Constant Field Values

TRX_NOT_SUPPORTED

public static final int TRX_NOT_SUPPORTED
See Also:
Constant Field Values

DBE_NO_PARENT

public static final int DBE_NO_PARENT
See Also:
Constant Field Values

DBE_CANNOT_DROP

public static final int DBE_CANNOT_DROP
See Also:
Constant Field Values

DBE_CANNOT_CREATE

public static final int DBE_CANNOT_CREATE
See Also:
Constant Field Values

DBE_CANNOT_READ

public static final int DBE_CANNOT_READ
See Also:
Constant Field Values

QRY_NULL_RESULT

public static final int QRY_NULL_RESULT
See Also:
Constant Field Values

QRY_COMPILATION_ERROR

public static final int QRY_COMPILATION_ERROR
See Also:
Constant Field Values

QRY_PROCESSING_ERROR

public static final int QRY_PROCESSING_ERROR
See Also:
Constant Field Values

QRY_NOT_SUPPORTED

public static final int QRY_NOT_SUPPORTED
See Also:
Constant Field Values

QRY_STYLE_NOT_FOUND

public static final int QRY_STYLE_NOT_FOUND
See Also:
Constant Field Values

SEC_INVALID_USER

public static final int SEC_INVALID_USER
See Also:
Constant Field Values

SEC_INVALID_GROUP

public static final int SEC_INVALID_GROUP
See Also:
Constant Field Values

SEC_INVALID_ACCESS

public static final int SEC_INVALID_ACCESS
See Also:
Constant Field Values

SEC_INVALID_CREDENTIALS

public static final int SEC_INVALID_CREDENTIALS
See Also:
Constant Field Values

URI_EMPTY

public static final int URI_EMPTY
See Also:
Constant Field Values

URI_NULL

public static final int URI_NULL
See Also:
Constant Field Values

URI_PARSE_ERROR

public static final int URI_PARSE_ERROR
See Also:
Constant Field Values

JAVA_RUNTIME_ERROR

public static final int JAVA_RUNTIME_ERROR
See Also:
Constant Field Values
Method Detail

getErrorCode

public static int getErrorCode(int faultCode)
getErrorCode returns the associated XML:DB error code for the specified Xindice fault code

Parameters:
faultCode - The Xindice fault code
Returns:
the associated XML:DB error code

getMessage

public static String getMessage(int code)
getMessage returns a textual form for the specified fault code.

Parameters:
code - The Fault Code
Returns:
It's textual form

createXMLDBException

public static org.xmldb.api.base.XMLDBException createXMLDBException(Exception e)
createXMLDBException creates an XMLDBException instance based on the specified Exception. If the Exception is a DBException, it will extract any important information from it (like fault codes and messages)

Parameters:
e - The Exception to use
Returns:
An XMLDBException instance

createXMLDBException

public static org.xmldb.api.base.XMLDBException createXMLDBException(String message,
                                                                     Exception e)
createXMLDBException creates an XMLDBException instance based on the specified Exception. If the Exception is a DBException, it will extract any important information from it (like fault codes and messages)

Parameters:
e - The Exception to use
message - The Message to use
Returns:
An XMLDBException instance

createXMLDBException

public static org.xmldb.api.base.XMLDBException createXMLDBException(int faultCode,
                                                                     String message,
                                                                     Exception e)

createXMLDBException

public static org.xmldb.api.base.XMLDBException createXMLDBException(int errorCode,
                                                                     int faultCode,
                                                                     String message,
                                                                     Exception e)
Creates an XMLDBException instance based on the specified fault code, message, and Exception. If the Exception is a DBException, it will extract any important information from it (like fault codes and messages). If the exception is an instance of XindiceException, the exception class name and message of any Throwable(s) available via XindiceException.getCause will also be incorporated into the message. If a chain of wrapped XindiceExceptions is available, the chain will be followed incorporating the class name and message at each level.

Parameters:
errorCode - error code for the XMLDBException
faultCode - the fault code for the created exception
message - message for the XMLDBException, or null to use message from e
e - The Exception to use
Returns:
An XMLDBException instance

getFaultCodeType

public static int getFaultCodeType(Exception e)
getFaultCodeType examines the provided exception to determine the general fault code that is associated with it. General fault codes are reduced from actual fault codes to be one of the GEN_ prefixed fault code values.

Parameters:
e - The Exception to examine
Returns:
The General Fault Code

getFaultCodeSeries

public static int getFaultCodeSeries(Exception e)
getFaultCodeSeries examines the provided exception to determine the fault code series that is associated with it. Series are reduced from actual fault codes to be one of the fault code prefixes (ex: COL, DB, SEC).

Parameters:
e - The Exception to examine
Returns:
The Fault Code Series

getFaultCode

public static int getFaultCode(Exception e)
getFaultCode examines the provided exception to determine the fault code that is associated with it.

Parameters:
e - The Exception to examine
Returns:
The Fault Code

getFaultMessage

public static String getFaultMessage(Exception e)
getFaultMessage examines the provided exception to determine the fault message that is associated with it.

Parameters:
e - The Exception to examine
Returns:
The Fault Message

Xindice API
version 1.2m1

Copyright (c) 1999-2007 The Apache Software Foundation. All Rights Reserved.