Mixe for Privacy and Anonymity in the Internet
CAXMLErrorMessage.hpp
Go to the documentation of this file.
00001 /*
00002 Copyright (c) 2000, The JAP-Team
00003 All rights reserved.
00004 Redistribution and use in source and binary forms, with or without modification,
00005 are permitted provided that the following conditions are met:
00006 
00007   - Redistributions of source code must retain the above copyright notice,
00008     this list of conditions and the following disclaimer.
00009 
00010   - Redistributions in binary form must reproduce the above copyright notice,
00011     this list of conditions and the following disclaimer in the documentation and/or
00012     other materials provided with the distribution.
00013 
00014   - Neither the name of the University of Technology Dresden, Germany nor the names of its contributors
00015     may be used to endorse or promote products derived from this software without specific
00016     prior written permission.
00017 
00018 
00019 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS
00020 OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
00021 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS
00022 BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00023 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
00024 OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
00025 IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00026 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
00027 */
00028 #ifndef __CAXMLERRORMESSAGE__
00029 #define __CAXMLERRORMESSAGE__
00030 
00031 #include "CAUtil.hpp"
00032 #include "CAAbstractXMLEncodable.hpp"
00033 #include "CAXMLCostConfirmation.hpp"
00034 
00035 #define XML_ELEMENT_ERROR_MSG "ErrorMessage"
00036 
00044 class CAXMLErrorMessage : public CAAbstractXMLEncodable
00045   {
00046     public:
00047       //codes corresponding to various errors
00048       static const UINT32 ERR_OK = 0;
00049       static const UINT32 ERR_INTERNAL_SERVER_ERROR = 1;
00050       static const UINT32 ERR_WRONG_FORMAT = 2;
00051       static const UINT32 ERR_WRONG_DATA = 3;
00052       static const UINT32 ERR_KEY_NOT_FOUND = 4;
00053       static const UINT32 ERR_BAD_SIGNATURE = 5;
00054       static const UINT32 ERR_BAD_REQUEST = 6;
00055       static const UINT32 ERR_NO_ACCOUNTCERT = 7;
00056       static const UINT32 ERR_NO_BALANCE = 8;
00057       static const UINT32 ERR_NO_CONFIRMATION = 9;
00058       static const UINT32 ERR_ACCOUNT_EMPTY = 10;
00059       static const UINT32 ERR_CASCADE_LENGTH = 11;
00060       static const UINT32 ERR_DATABASE_ERROR = 12;
00061       static const UINT32 ERR_INSUFFICIENT_BALANCE = 13;
00062       static const UINT32 ERR_NO_FLATRATE_OFFERED = 14;
00063       static const UINT32 ERR_INVALID_CODE = 15;
00064       static const UINT32 ERR_OUTDATED_CC = 16;
00065       static const UINT32 ERR_INVALID_PRICE_CERT = 17;
00066       static const UINT32 ERR_MULTIPLE_LOGIN = 18;
00067       static const UINT32 ERR_NO_RECORD_FOUND = 19;
00068       static const UINT32 ERR_SUCCESS_BUT_WITH_ERRORS = 20;
00069       static const UINT32 ERR_BLOCKED = 21;
00070       static const UINT32 ERR_NO_ERROR_GIVEN = 100;
00071 
00072 
00079       CAXMLErrorMessage(const UINT32 errorCode, UINT8 * message);
00080 
00085       CAXMLErrorMessage(UINT32 errorCode);
00086 
00087 
00091       CAXMLErrorMessage(const UINT32 errorCode, UINT8* message, CAAbstractXMLEncodable* messageObject);
00092 
00093 
00097       CAXMLErrorMessage(UINT8 * strXmlData);
00098 
00099       CAXMLErrorMessage(DOMElement* elemRoot);
00100 
00101       ~CAXMLErrorMessage();
00102 
00103       SINT32 toXmlElement( XERCES_CPP_NAMESPACE::DOMDocument* a_doc, DOMElement* &elemRoot);
00104       UINT32 getErrorCode()
00105       {
00106         return m_iErrorCode;
00107       }
00108 
00109       UINT8* getDescription()
00110       {
00111         return m_strErrMsg;
00112       }
00113 
00114       void* getMessageObject()
00115       {
00116         return m_messageObject;
00117       }
00118 
00119     private:
00120       SINT32 setValues(DOMElement* elemRoot);
00121       UINT32 m_iErrorCode;
00122       UINT8 *m_strErrMsg;
00123       void* m_messageObject;
00124   };
00125 
00126 #endif