SAP CC 1.0
API 4.2 (Core)

com.highdeal.hci
Class ServerFailureException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.highdeal.hci.OperationFailureException
              extended by com.highdeal.hci.ServerFailureException
All Implemented Interfaces:
OperationResult, XMLMarshallable, java.io.Serializable

public class ServerFailureException
extends OperationFailureException

Exception thrown when a non business exception occurs into the Transactive server. If such exception occurs, it doesn't mean that a bug exists into server (except for the "unsupportedFailure" reason which denotes a potential existing bug).
When a client receives a such exception, it means that the client request didn't succeed and any change has been performed into the Database. The DB transaction has been rollbacked.
This exception is used to transform in a single common exception a large set of internal exceptions (Runtimes exception for most of them) which can occur on server side. That the reason why this exception manages a nested 'Throwable' attribute which is initialized with the original exception. But this nested exception is NEVER transmitted to the client.
However, on server side, each time a server failure exception is created from an internal exception, the nested (internal) exception stack trace is always printed into server logs (the generated ServerFailureException too). In addition, on client side, the ServerFailureException::getMessage() returns the message of the nested exception if it exists.

See Also:
Serialized Form
XML Schema Fragment
<xs:element name="serverFault">
   <xs:complexType>
     <xs:attribute name="message" type="xs:string"/>
     <xs:attribute name="reason" type="ServerFaultReasonType"/>
   </xs:complexType>
 </xs:element>

 <xs:simpleType name="ServerFaultReasonType">
   <xs:restriction base="xs:string">
     <xs:enumeration value="databaseFailure"/>
     <xs:enumeration value="databaseFailover"/>
     <xs:enumeration value="serverTimeoutOccured"/>
     <xs:enumeration value="cannotLockResource"/>
     <xs:enumeration value="IOFailure"/>
     <xs:enumeration value="interInstanceCommunicationFailure"/>
     <xs:enumeration value="serverShuttingDown"/>
     <xs:enumeration value="statefulServiceViolationProtocol"/>
     <xs:enumeration value="statelessServiceViolationProtocol"/>
     <xs:enumeration value="hciServiceViolationProtocol"/>
     <xs:enumeration value="cacheInvalidationFailure"/>
     <xs:enumeration value="messageQueueFull"/>
     <xs:enumeration value="messageUnsupportedService"/>
     <xs:enumeration value="hciUnsupportedService"/>
     <xs:enumeration value="hciConcurrency"/>
     <xs:enumeration value="incompatibleConfiguration"/>
     <xs:enumeration value="serverToClientCommunicationFailure"/>
     <xs:enumeration value="accessCompatibilityFailure"/>
     <xs:enumeration value="unsupportedFailure"/>
     <xs:enumeration value="offerCacheBusyWhileRefreshing"/>
     <xs:enumeration value="switchBackToRater"/>
     <xs:enumeration value="unsupportedJavaFailure"/>
   </xs:restriction>
 </xs:simpleType>

Field Summary
static int ACCESS_COMPATIBILITY_FAILURE
          Reason code for old use of access (in subscription).
static int CACHE_INVALIDATION_FAILURE
          Reason code when the updater didn't succeed to update in a synchronous way, the caches belonging to rating instances.
static int CANNOT_LOCK_RESOURCE
          Reason code when the server cannot lock resources into the database after having tried SQLHELPER_MAX_REDO attempts.
static int DATABASE_FAILOVER
          Reason code when the server is failing over due to a database failure.
static int DATABASE_FAILURE
          Reason code when a failure occurred with the database.
static int HCI_CONCURRENCY_OPERATION
          Reason code relative to a service invocation on HCI APIs which is in concurrency with another.
static int HCI_SERVICE_VIOLATION_PROTOCOL
          Reason code when XML stream received by the HCI servers (updater and admin) is not conformed to the HCI protocol.
static int HCI_UNSUPPORTED_SERVICE
          Reason code relative to a service invocation on HCI APIs which is not supported.
static int INCOMPATIBLE_CONFIGURATION
          Reason code when the server cannot load its configuration due to out of rank parameter values or missing parameter values.
static int INTER_INSTANCE_COMMUNICATION_FAILURE
          Reason code for networking/communication issues between rating, backups, updater instances.
static int IO_FAILURE
          Reason code when the server encountered some IO failure.
static int MESSAGE_QUEUE_FULL
          Reason code relative to fullfilling of queues implemented by message protocol.
static int MESSAGE_UNSUPPORTED_SERVICE
          Reason code relative to a service invocation on message APIs which is not supported.
static int OFFER_CACHE_BUSY_WHILE_REFRESHING
          Reason code when the subscription cannot be charged because its related offer is temporary unaccessible due to cache refreshing process.
static int SERVER_SHUTTING_DOWN
          Reason code when the server is shutting down.
static int SERVER_TIMEOUT
          Reason code when the server cannot execute the API with the required timeout.
static int SERVER_TO_CLIENT_COMMUNICATION_FAILURE
          The server encountered communication/network issues while trying to reply to the client.
static int SLEEPING_BULK_LOADER
          Reason code when the backup rejects a rating request due to the restarting of the original rater regarding the partition ID.
static int STATEFUL_SERVICE_VIOLATION_PROTOCOL
          The message sent to the stateful API is not conformed to the stateful protocol.
static int STATELESS_SERVICE_VIOLATION_PROTOCOL
          The message sent to the stateless API is not conformed to the stateless protocol.
static int SWITCH_BACK_TO_RATER
          Reason code when the backup rejects a rating request due to the restarting of the original rater regarding the partition ID.
static int TAX_CACHE_BUSY_WHILE_REFRESHING
          Reason code when the subscription cannot be charged because taxes are temporary unaccessible due to cache refreshing process.
static int UNSUPPORTED_FAILURE
          Reason code when the server failure is unknown or not supported.
static int UNSUPPORTED_JAVA_FAILURE
          Reason code when the server failure is a java error and is not supported.
 
Constructor Summary
ServerFailureException()
          Reserved for HCI/XML protocol incarnation.
ServerFailureException(int reason, java.lang.String msg)
          The reason/message exception builder.
ServerFailureException(int reason, java.lang.String msg, java.lang.Throwable t)
          Full Exception builder.
ServerFailureException(com.highdeal.sql.SQLManagerException sqlException)
          The reason/message exception builder.
 
Method Summary
 void addCharacterData(java.lang.String cData)
          Adds character data to the content element.
 void addChild(java.lang.String tagName, XMLMarshallable child)
          Adds a child to the objects, the child represents the marshallable object to be added into the content tree.
 void attach(java.lang.Object attachment)
          Attaches an object to this exception.
 java.lang.Object attachment()
          Returns the object attached to this exception.
 java.lang.String getMessage()
          Returns a readable exception description.
 java.lang.String getOperandReference()
          Gets the code or the reference (if no code exists) identifying the operand of the operation.
 int getReason()
          Returns the reason of the exception.
 java.lang.Throwable getThrowable()
          Returns the original nested exception which is the cause of this ServerFailureException generation.
 void marshal(XMLOutputter output)
          Gives an XML representation of this object, and of its children.
 int parseReason(java.lang.String str)
          Retrieves the reason code from the reason string xml representation.
 java.lang.String reasonToString(int r)
          Returns the xml reason name from the reason code.
 void setAttributes(XMLAttributes atts)
          Sets the attributes of the XML representation of the tag beeing processed.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UNSUPPORTED_JAVA_FAILURE

public static final int UNSUPPORTED_JAVA_FAILURE
Reason code when the server failure is a java error and is not supported. All reasons relative to general server failure get an ID of -1. Value is set to : -1.

See Also:
Constant Field Values

UNSUPPORTED_FAILURE

public static final int UNSUPPORTED_FAILURE
Reason code when the server failure is unknown or not supported. All reasons relative to general server failure get an ID between 0 and 99. Value is set to : 0.

See Also:
Constant Field Values

SERVER_SHUTTING_DOWN

public static final int SERVER_SHUTTING_DOWN
Reason code when the server is shutting down. All reasons relative to general server failure get an ID between 0 and 99. Value is set to : 1.

See Also:
Constant Field Values

INCOMPATIBLE_CONFIGURATION

public static final int INCOMPATIBLE_CONFIGURATION
Reason code when the server cannot load its configuration due to out of rank parameter values or missing parameter values. All reasons relative to general server failure get an ID between 0 and 99. Value is set to : 2.

See Also:
Constant Field Values

DATABASE_FAILURE

public static final int DATABASE_FAILURE
Reason code when a failure occurred with the database. All reasons relative to database have an ID between 100 and 199. Value is set to : 100.

See Also:
Constant Field Values

CANNOT_LOCK_RESOURCE

public static final int CANNOT_LOCK_RESOURCE
Reason code when the server cannot lock resources into the database after having tried SQLHELPER_MAX_REDO attempts. All reasons relative to database have an ID between 100 and 199. Value is set to : 101.

See Also:
Constant Field Values

DATABASE_FAILOVER

public static final int DATABASE_FAILOVER
Reason code when the server is failing over due to a database failure. All reasons relative to database have an ID between 100 and 199. Value is set to : 101.

See Also:
Constant Field Values

SERVER_TIMEOUT

public static final int SERVER_TIMEOUT
Reason code when the server cannot execute the API with the required timeout. All reasons relative to message protocol get an ID between 200 and 299. Value is set to : 200.

See Also:
Constant Field Values

STATEFUL_SERVICE_VIOLATION_PROTOCOL

public static final int STATEFUL_SERVICE_VIOLATION_PROTOCOL
The message sent to the stateful API is not conformed to the stateful protocol. All reasons relative to message protocol get an ID between 200 and 299. Value is set to : 201.

See Also:
Constant Field Values

STATELESS_SERVICE_VIOLATION_PROTOCOL

public static final int STATELESS_SERVICE_VIOLATION_PROTOCOL
The message sent to the stateless API is not conformed to the stateless protocol. All reasons relative to message protocol get an ID between 200 and 299. Value is set to : 202.

See Also:
Constant Field Values

MESSAGE_QUEUE_FULL

public static final int MESSAGE_QUEUE_FULL
Reason code relative to fullfilling of queues implemented by message protocol. All reasons relative to message protocol get an ID between 200 and 299. Value is set to : 203.

See Also:
Constant Field Values

MESSAGE_UNSUPPORTED_SERVICE

public static final int MESSAGE_UNSUPPORTED_SERVICE
Reason code relative to a service invocation on message APIs which is not supported. All reasons relative to message protocol get an ID between 200 and 299. Value is set to : 204.

See Also:
Constant Field Values

HCI_SERVICE_VIOLATION_PROTOCOL

public static final int HCI_SERVICE_VIOLATION_PROTOCOL
Reason code when XML stream received by the HCI servers (updater and admin) is not conformed to the HCI protocol. All reasons relative to HCI protocol get an ID between 300 and 399. Value is set to : 300.

See Also:
Constant Field Values

HCI_UNSUPPORTED_SERVICE

public static final int HCI_UNSUPPORTED_SERVICE
Reason code relative to a service invocation on HCI APIs which is not supported. All reasons relative to HCI protocol get an ID between 300 and 399. Value is set to : 301.

See Also:
Constant Field Values

HCI_CONCURRENCY_OPERATION

public static final int HCI_CONCURRENCY_OPERATION
Reason code relative to a service invocation on HCI APIs which is in concurrency with another. All reasons relative to HCI protocol get an ID between 300 and 399. Value is set to : 302.

See Also:
Constant Field Values

CACHE_INVALIDATION_FAILURE

public static final int CACHE_INVALIDATION_FAILURE
Reason code when the updater didn't succeed to update in a synchronous way, the caches belonging to rating instances. All reasons relative to cache management get an ID between 400 and 499. Value is set to : 401.

See Also:
Constant Field Values

OFFER_CACHE_BUSY_WHILE_REFRESHING

public static final int OFFER_CACHE_BUSY_WHILE_REFRESHING
Reason code when the subscription cannot be charged because its related offer is temporary unaccessible due to cache refreshing process. All reasons relative to cache management get an ID between 400 and 499. Value is set to : 402.

See Also:
Constant Field Values

TAX_CACHE_BUSY_WHILE_REFRESHING

public static final int TAX_CACHE_BUSY_WHILE_REFRESHING
Reason code when the subscription cannot be charged because taxes are temporary unaccessible due to cache refreshing process. All reasons relative to cache management get an ID between 400 and 499. Value is set to : 402.

See Also:
Constant Field Values

INTER_INSTANCE_COMMUNICATION_FAILURE

public static final int INTER_INSTANCE_COMMUNICATION_FAILURE
Reason code for networking/communication issues between rating, backups, updater instances. All server side networking/communication issues get an ID between 500 and 599. Value is set to : 500.

See Also:
Constant Field Values

IO_FAILURE

public static final int IO_FAILURE
Reason code when the server encountered some IO failure. All server side networking/communication issues get an ID between 500 and 599. Value is set to : 501.

See Also:
Constant Field Values

SERVER_TO_CLIENT_COMMUNICATION_FAILURE

public static final int SERVER_TO_CLIENT_COMMUNICATION_FAILURE
The server encountered communication/network issues while trying to reply to the client. All server side networking/communication issues get an ID between 500 and 599. Value is set to : 502.

See Also:
Constant Field Values

ACCESS_COMPATIBILITY_FAILURE

public static final int ACCESS_COMPATIBILITY_FAILURE
Reason code for old use of access (in subscription). Value is set to : 600.

See Also:
Constant Field Values

SWITCH_BACK_TO_RATER

public static final int SWITCH_BACK_TO_RATER
Reason code when the backup rejects a rating request due to the restarting of the original rater regarding the partition ID.

See Also:
Constant Field Values

SLEEPING_BULK_LOADER

public static final int SLEEPING_BULK_LOADER
Reason code when the backup rejects a rating request due to the restarting of the original rater regarding the partition ID.

See Also:
Constant Field Values
Constructor Detail

ServerFailureException

public ServerFailureException()
Reserved for HCI/XML protocol incarnation. Do not use.


ServerFailureException

public ServerFailureException(int reason,
                              java.lang.String msg,
                              java.lang.Throwable t)
Full Exception builder.

Parameters:
reason - the exception reason
msg - the exception message
t - the nested (Throwable) exception.

ServerFailureException

public ServerFailureException(int reason,
                              java.lang.String msg)
The reason/message exception builder.

Parameters:
reason - the exception reason
msg - the exception message

ServerFailureException

public ServerFailureException(com.highdeal.sql.SQLManagerException sqlException)
The reason/message exception builder.

Parameters:
sqlException - the SQL exception
Method Detail

attach

public void attach(java.lang.Object attachment)
Attaches an object to this exception.

Parameters:
attachment - the object to be attached, can be null. Is retrieved thanks to the method attachment().

attachment

public java.lang.Object attachment()
Returns the object attached to this exception.

Returns:
the object set thanks to the method attach(Object).

getMessage

public java.lang.String getMessage()
Returns a readable exception description.

Overrides:
getMessage in class java.lang.Throwable
Returns:
A readable description of the exception.

getThrowable

public java.lang.Throwable getThrowable()
Returns the original nested exception which is the cause of this ServerFailureException generation. This method returns always null on client side.

Returns:
the nested exception (server side only) or null (client side).

setAttributes

public void setAttributes(XMLAttributes atts)
Description copied from interface: XMLMarshallable
Sets the attributes of the XML representation of the tag beeing processed.

Parameters:
atts - the XML attributes of the current tag.

addCharacterData

public void addCharacterData(java.lang.String cData)
Description copied from interface: XMLMarshallable
Adds character data to the content element.

Parameters:
cData - the character data to be added.

addChild

public void addChild(java.lang.String tagName,
                     XMLMarshallable child)
Description copied from interface: XMLMarshallable
Adds a child to the objects, the child represents the marshallable object to be added into the content tree.

Parameters:
tagName - the name of tag for the child.
child - the child to be added.

marshal

public void marshal(XMLOutputter output)
Description copied from interface: XMLMarshallable
Gives an XML representation of this object, and of its children.

Parameters:
output - the XML output to marshall the object into.

getOperandReference

public java.lang.String getOperandReference()
Description copied from interface: OperationResult
Gets the code or the reference (if no code exists) identifying the operand of the operation. If the operation is not auditable, the operand reference is null.

Specified by:
getOperandReference in interface OperationResult
Overrides:
getOperandReference in class OperationFailureException
Returns:
The operand reference of the result.

getReason

public int getReason()
Returns the reason of the exception. Available reasons are :

Returns:
the reason of the exception.

parseReason

public int parseReason(java.lang.String str)
Retrieves the reason code from the reason string xml representation.

Parameters:
str - the reason xml representation.
Returns:
the code of the reason.

reasonToString

public java.lang.String reasonToString(int r)
Returns the xml reason name from the reason code.

Parameters:
r - the reason code.
Returns:
the name of the reason.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Throwable

SAP CC 1.0
API 4.2 (Core)


API Reference - July 2009

SAP Convergent Charging 1.0 (build R4.2.1.35.0.0)
CONVERGENT CHARGING 4.2

(c) Copyright 2009 SAP AG. All rights reserved.