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

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

Inheritance diagram for CAXMLErrorMessage:
CAAbstractXMLEncodable

Public Member Functions

 CAXMLErrorMessage (const UINT32 errorCode, UINT8 *message)
 Creates an errorMessage object. More...
 
 CAXMLErrorMessage (UINT32 errorCode)
 Uses a default description String. More...
 
 CAXMLErrorMessage (const UINT32 errorCode, UINT8 *message, CAAbstractXMLEncodable *messageObject)
 attaches an object to the error message More...
 
 CAXMLErrorMessage (UINT8 *strXmlData)
 Parses the string XML representation. More...
 
 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. More...
 
UINT32 getErrorCode ()
 
UINT8getDescription ()
 
void * getMessageObject ()
 
- Public Member Functions inherited from CAAbstractXMLEncodable
 CAAbstractXMLEncodable ()
 
virtual ~CAAbstractXMLEncodable ()
 pure virtual destructor. More...
 
SINT32 toXmlDocument (XERCES_CPP_NAMESPACE::DOMDocument *&pDoc)
 returns a pointer to the tagname of this XML structure's top level element. More...
 
UINT8toXmlString (UINT32 *pSize)
 Converts the XML structure to a null-terminated C-String representation. More...
 

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() [1/5]

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.

◆ CAXMLErrorMessage() [2/5]

CAXMLErrorMessage::CAXMLErrorMessage ( UINT32  errorCode)

Uses a default description String.

Parameters
errorCodeUINT32

References m_iErrorCode, m_messageObject, and m_strErrMsg.

◆ CAXMLErrorMessage() [3/5]

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

attaches an object to the error message

References m_iErrorCode, m_messageObject, and m_strErrMsg.

◆ CAXMLErrorMessage() [4/5]

CAXMLErrorMessage::CAXMLErrorMessage ( UINT8 strXmlData)

Parses the string XML representation.

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

◆ CAXMLErrorMessage() [5/5]

CAXMLErrorMessage::CAXMLErrorMessage ( DOMElement *  elemRoot)

◆ ~CAXMLErrorMessage()

CAXMLErrorMessage::~CAXMLErrorMessage ( )

References m_messageObject, and m_strErrMsg.

Member Function Documentation

◆ getDescription()

UINT8* CAXMLErrorMessage::getDescription ( )

◆ getErrorCode()

UINT32 CAXMLErrorMessage::getErrorCode ( )

◆ getMessageObject()

void* CAXMLErrorMessage::getMessageObject ( )

◆ setValues()

SINT32 CAXMLErrorMessage::setValues ( DOMElement *  elemRoot)
private

◆ toXmlElement()

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

◆ ERR_ACCOUNT_EMPTY

const UINT32 CAXMLErrorMessage::ERR_ACCOUNT_EMPTY = 10
static

◆ ERR_BAD_REQUEST

const UINT32 CAXMLErrorMessage::ERR_BAD_REQUEST = 6
static

◆ ERR_BAD_SIGNATURE

const UINT32 CAXMLErrorMessage::ERR_BAD_SIGNATURE = 5
static

◆ ERR_BLOCKED

const UINT32 CAXMLErrorMessage::ERR_BLOCKED = 21
static

◆ ERR_CASCADE_LENGTH

const UINT32 CAXMLErrorMessage::ERR_CASCADE_LENGTH = 11
static

◆ ERR_DATABASE_ERROR

const UINT32 CAXMLErrorMessage::ERR_DATABASE_ERROR = 12
static

◆ ERR_INSUFFICIENT_BALANCE

const UINT32 CAXMLErrorMessage::ERR_INSUFFICIENT_BALANCE = 13
static

◆ ERR_INTERNAL_SERVER_ERROR

const UINT32 CAXMLErrorMessage::ERR_INTERNAL_SERVER_ERROR = 1
static

◆ ERR_INVALID_CODE

const UINT32 CAXMLErrorMessage::ERR_INVALID_CODE = 15
static

◆ ERR_INVALID_PRICE_CERT

const UINT32 CAXMLErrorMessage::ERR_INVALID_PRICE_CERT = 17
static

◆ ERR_KEY_NOT_FOUND

const UINT32 CAXMLErrorMessage::ERR_KEY_NOT_FOUND = 4
static

◆ ERR_MULTIPLE_LOGIN

const UINT32 CAXMLErrorMessage::ERR_MULTIPLE_LOGIN = 18
static

◆ ERR_NO_ACCOUNTCERT

const UINT32 CAXMLErrorMessage::ERR_NO_ACCOUNTCERT = 7
static

◆ ERR_NO_BALANCE

const UINT32 CAXMLErrorMessage::ERR_NO_BALANCE = 8
static

◆ ERR_NO_CONFIRMATION

const UINT32 CAXMLErrorMessage::ERR_NO_CONFIRMATION = 9
static

◆ ERR_NO_ERROR_GIVEN

const UINT32 CAXMLErrorMessage::ERR_NO_ERROR_GIVEN = 100
static

◆ ERR_NO_FLATRATE_OFFERED

const UINT32 CAXMLErrorMessage::ERR_NO_FLATRATE_OFFERED = 14
static

◆ ERR_NO_RECORD_FOUND

const UINT32 CAXMLErrorMessage::ERR_NO_RECORD_FOUND = 19
static

◆ ERR_OK

const UINT32 CAXMLErrorMessage::ERR_OK = 0
static

◆ ERR_OUTDATED_CC

const UINT32 CAXMLErrorMessage::ERR_OUTDATED_CC = 16
static

◆ ERR_SUCCESS_BUT_WITH_ERRORS

const UINT32 CAXMLErrorMessage::ERR_SUCCESS_BUT_WITH_ERRORS = 20
static

◆ ERR_WRONG_DATA

const UINT32 CAXMLErrorMessage::ERR_WRONG_DATA = 3
static

◆ ERR_WRONG_FORMAT

const UINT32 CAXMLErrorMessage::ERR_WRONG_FORMAT = 2
static

◆ m_iErrorCode

UINT32 CAXMLErrorMessage::m_iErrorCode
private

◆ m_messageObject

void* CAXMLErrorMessage::m_messageObject
private

◆ m_strErrMsg

UINT8* CAXMLErrorMessage::m_strErrMsg
private