Mixe for Privacy and Anonymity in the Internet
CAXMLErrorMessage.hpp
Go to the documentation of this file.
1 /*
2 Copyright (c) 2000, The JAP-Team
3 All rights reserved.
4 Redistribution and use in source and binary forms, with or without modification,
5 are permitted provided that the following conditions are met:
6 
7  - Redistributions of source code must retain the above copyright notice,
8  this list of conditions and the following disclaimer.
9 
10  - Redistributions in binary form must reproduce the above copyright notice,
11  this list of conditions and the following disclaimer in the documentation and/or
12  other materials provided with the distribution.
13 
14  - Neither the name of the University of Technology Dresden, Germany nor the names of its contributors
15  may be used to endorse or promote products derived from this software without specific
16  prior written permission.
17 
18 
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS
20 OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
21 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS
22 BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24 OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
25 IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
27 */
28 #ifndef __CAXMLERRORMESSAGE__
29 #define __CAXMLERRORMESSAGE__
30 
31 #include "CAUtil.hpp"
34 
35 #define XML_ELEMENT_ERROR_MSG "ErrorMessage"
36 
45  {
46  public:
47  //codes corresponding to various errors
48  static const UINT32 ERR_OK = 0;
50  static const UINT32 ERR_WRONG_FORMAT = 2;
51  static const UINT32 ERR_WRONG_DATA = 3;
52  static const UINT32 ERR_KEY_NOT_FOUND = 4;
53  static const UINT32 ERR_BAD_SIGNATURE = 5;
54  static const UINT32 ERR_BAD_REQUEST = 6;
55  static const UINT32 ERR_NO_ACCOUNTCERT = 7;
56  static const UINT32 ERR_NO_BALANCE = 8;
57  static const UINT32 ERR_NO_CONFIRMATION = 9;
58  static const UINT32 ERR_ACCOUNT_EMPTY = 10;
59  static const UINT32 ERR_CASCADE_LENGTH = 11;
60  static const UINT32 ERR_DATABASE_ERROR = 12;
61  static const UINT32 ERR_INSUFFICIENT_BALANCE = 13;
62  static const UINT32 ERR_NO_FLATRATE_OFFERED = 14;
63  static const UINT32 ERR_INVALID_CODE = 15;
64  static const UINT32 ERR_OUTDATED_CC = 16;
65  static const UINT32 ERR_INVALID_PRICE_CERT = 17;
66  static const UINT32 ERR_MULTIPLE_LOGIN = 18;
67  static const UINT32 ERR_NO_RECORD_FOUND = 19;
69  static const UINT32 ERR_BLOCKED = 21;
70  static const UINT32 ERR_NO_ERROR_GIVEN = 100;
71 
72 
79  CAXMLErrorMessage(const UINT32 errorCode, UINT8 * message);
80 
85  CAXMLErrorMessage(UINT32 errorCode);
86 
87 
91  CAXMLErrorMessage(const UINT32 errorCode, UINT8* message, CAAbstractXMLEncodable* messageObject);
92 
93 
97  CAXMLErrorMessage(UINT8 * strXmlData);
98 
99  CAXMLErrorMessage(DOMElement* elemRoot);
100 
102 
103  SINT32 toXmlElement( XERCES_CPP_NAMESPACE::DOMDocument* a_doc, DOMElement* &elemRoot);
105  {
106  return m_iErrorCode;
107  }
108 
110  {
111  return m_strErrMsg;
112  }
113 
115  {
116  return m_messageObject;
117  }
118 
119  private:
120  SINT32 setValues(DOMElement* elemRoot);
124  };
125 
126 #endif
signed int SINT32
Definition: basetypedefs.h:132
unsigned char UINT8
Definition: basetypedefs.h:135
unsigned int UINT32
Definition: basetypedefs.h:131
Abstract base class for classes which can be converted to an XML structure.
This class encapsulates an error or success message.
static const UINT32 ERR_BAD_REQUEST
CAXMLErrorMessage(const UINT32 errorCode, UINT8 *message)
Creates an errorMessage object.
static const UINT32 ERR_WRONG_DATA
static const UINT32 ERR_INVALID_PRICE_CERT
static const UINT32 ERR_BAD_SIGNATURE
static const UINT32 ERR_NO_FLATRATE_OFFERED
static const UINT32 ERR_ACCOUNT_EMPTY
static const UINT32 ERR_INVALID_CODE
static const UINT32 ERR_NO_ERROR_GIVEN
static const UINT32 ERR_WRONG_FORMAT
SINT32 setValues(DOMElement *elemRoot)
static const UINT32 ERR_OUTDATED_CC
static const UINT32 ERR_MULTIPLE_LOGIN
static const UINT32 ERR_INSUFFICIENT_BALANCE
static const UINT32 ERR_DATABASE_ERROR
static const UINT32 ERR_NO_CONFIRMATION
static const UINT32 ERR_OK
static const UINT32 ERR_NO_RECORD_FOUND
static const UINT32 ERR_NO_BALANCE
static const UINT32 ERR_NO_ACCOUNTCERT
static const UINT32 ERR_KEY_NOT_FOUND
static const UINT32 ERR_CASCADE_LENGTH
static const UINT32 ERR_BLOCKED
static const UINT32 ERR_INTERNAL_SERVER_ERROR
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.
static const UINT32 ERR_SUCCESS_BUT_WITH_ERRORS