Mixes for Privacy and Anonymity in the Internet
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes
CAXMLErrorMessage Class Reference

This class encapsulates an error or success message. More...

Inheritance diagram for CAXMLErrorMessage:
CAAbstractXMLEncodable

List of all members.

Public Member Functions

 CAXMLErrorMessage (const UINT32 errorCode, UINT8 *message)
 Creates an errorMessage object.
 CAXMLErrorMessage (UINT32 errorCode)
 Uses a default description String.
 CAXMLErrorMessage (const UINT32 errorCode, UINT8 *message, CAAbstractXMLEncodable *messageObject)
 attaches an object to the error message
 CAXMLErrorMessage (UINT8 *strXmlData)
 Parses the string XML representation.
 CAXMLErrorMessage (DOMElement *elemRoot)
 ~CAXMLErrorMessage ()
SINT32 toXmlElement (XERCES_CPP_NAMESPACE::DOMDocument *a_doc, DOMElement *&elemRoot)
 Creates the XML structure inside an existing DOM_Document, but does not append it to any node.
UINT32 getErrorCode ()
UINT8getDescription ()
void * getMessageObject ()

Static Public Attributes

static const UINT32 ERR_OK = 0
static const UINT32 ERR_INTERNAL_SERVER_ERROR = 1
static const UINT32 ERR_WRONG_FORMAT = 2
static const UINT32 ERR_WRONG_DATA = 3
static const UINT32 ERR_KEY_NOT_FOUND = 4
static const UINT32 ERR_BAD_SIGNATURE = 5
static const UINT32 ERR_BAD_REQUEST = 6
static const UINT32 ERR_NO_ACCOUNTCERT = 7
static const UINT32 ERR_NO_BALANCE = 8
static const UINT32 ERR_NO_CONFIRMATION = 9
static const UINT32 ERR_ACCOUNT_EMPTY = 10
static const UINT32 ERR_CASCADE_LENGTH = 11
static const UINT32 ERR_DATABASE_ERROR = 12
static const UINT32 ERR_INSUFFICIENT_BALANCE = 13
static const UINT32 ERR_NO_FLATRATE_OFFERED = 14
static const UINT32 ERR_INVALID_CODE = 15
static const UINT32 ERR_OUTDATED_CC = 16
static const UINT32 ERR_INVALID_PRICE_CERT = 17
static const UINT32 ERR_MULTIPLE_LOGIN = 18
static const UINT32 ERR_NO_RECORD_FOUND = 19
static const UINT32 ERR_SUCCESS_BUT_WITH_ERRORS = 20
static const UINT32 ERR_BLOCKED = 21
static const UINT32 ERR_NO_ERROR_GIVEN = 100

Private Member Functions

SINT32 setValues (DOMElement *elemRoot)

Private Attributes

UINT32 m_iErrorCode
UINT8m_strErrMsg
void * m_messageObject

Detailed Description

This class encapsulates an error or success message.

In order to be independent from the HTTP protocol on the higher layer, this is now used instead of http errorcodes.

Author:
Bastian Voigt, Elmar Schraml

Constructor & Destructor Documentation

CAXMLErrorMessage::CAXMLErrorMessage ( const UINT32  errorCode,
UINT8 message 
)

Creates an errorMessage object.

The errorcode should be one of the above ERR_* constants.

Parameters:
errorCodeUINT32 one of the above constants
messageString a human-readable description of the error

References m_iErrorCode, m_messageObject, and m_strErrMsg.

Uses a default description String.

Parameters:
errorCodeUINT32

References m_iErrorCode, m_messageObject, and m_strErrMsg.

CAXMLErrorMessage::CAXMLErrorMessage ( const UINT32  errorCode,
UINT8 message,
CAAbstractXMLEncodable messageObject 
)

attaches an object to the error message

References m_iErrorCode, m_messageObject, and m_strErrMsg.

Parses the string XML representation.

References E_SUCCESS, ERR_NO_ERROR_GIVEN, m_iErrorCode, m_messageObject, m_strErrMsg, parseDOMDocument(), and setValues().

CAXMLErrorMessage::CAXMLErrorMessage ( DOMElement *  elemRoot)

References m_messageObject, and m_strErrMsg.


Member Function Documentation

SINT32 CAXMLErrorMessage::setValues ( DOMElement *  elemRoot) [private]
SINT32 CAXMLErrorMessage::toXmlElement ( XERCES_CPP_NAMESPACE::DOMDocument *  a_pDoc,
DOMElement *&  pElemRoot 
) [virtual]

Creates the XML structure inside an existing DOM_Document, but does not append it to any node.

Parameters:
a_docan existing DOM_Document
elemRooton return contains the root element of the created XML structure. Note that the element is not appended to any node in the document

Implements CAAbstractXMLEncodable.

References createDOMElement(), E_SUCCESS, m_iErrorCode, m_messageObject, m_strErrMsg, setDOMElementAttribute(), setDOMElementValue(), CAAbstractXMLEncodable::toXmlElement(), and XML_ELEMENT_ERROR_MSG.


Member Data Documentation

const UINT32 CAXMLErrorMessage::ERR_OK = 0 [static]