Mixe for Privacy and Anonymity in the Internet
CAAccountingBIInterface.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 
29 #ifndef __CAACCOUNTINGBIINTERFACE__
30 #define __CAACCOUNTINGBIINTERFACE__
31 #include "CATLSClientSocket.hpp"
32 #include "CAHttpClient.hpp"
33 #include "CASocketAddrINet.hpp"
35 #include "CAXMLErrorMessage.hpp"
36 #include "CAXMLBI.hpp"
37 
38 #define PI_CONNECT_TIMEOUT 5000
39 
40 #define XML_ELEMENT_CCS "CCs"
41 #define XML_ELEMENT_SETTLE_RESULT "SettleResult"
42 #define XML_ATTR_SETTLE_SUCCESSFUL "successful"
43 
44 #define POST_CMD_SETTLEALL "/settleAll"
45 
52 {
53 
54 public:
55 
56  //SINT32 setPIServerAddress(UINT8* pPiServerName, UINT16 piServerPort);
57  //SINT32 setPIServerCertificate(CACertificate * pPiServerCertificate);
60  SINT32 setPIServerConfiguration(CAXMLBI* pPiServerConfig);
61 
64 
65  //static CAAccountingBIInterface *getInstance(CAXMLBI *pPiServerConfig);
66  //static SINT32 cleanup();
67 
71  CAXMLErrorMessage *settle(CAXMLCostConfirmation &cc);
72  CAXMLErrorMessage **settleAll(CAXMLCostConfirmation **CCs, UINT32 nrOfCCs, CAXMLErrorMessage **settleException);
73 
74 /* **
75  * Request a new Balance certificate from the JPI
76  *
77  * @param balanceCert an old balance certificate that the AI wishes to update
78  * @param response a buffer to receive the new balanceCert
79  * @param responseLen the maximum size of the buffer
80  *
81  SINT32 update(UINT8 *balanceCert, UINT8 * response, UINT32 *responseLen);*/
82 
83 private:
84 
85  //CAAccountingBIInterface();
86  //~CAAccountingBIInterface();
87 
88 
93 
94  //static CAAccountingBIInterface *m_pPiInterfaceSingleton;
95  //CAMutex *m_pPiInterfaceMutex;
96  //friend class CAAccountingInstance;
97 };
98 
99 
100 #endif
signed int SINT32
Definition: basetypedefs.h:132
unsigned int UINT32
Definition: basetypedefs.h:131
This class encapsulates the connection to the JPI.
CAAccountingBIInterface()
private constructor just initializes fields, server configuration is done separately
SINT32 terminateBIConnection()
Terminate HTTP(s) connection to the BI (JPI)
CASocketAddrINet * m_pPiServerAddress
SINT32 initBIConnection()
Establishes HTTP(s) connection to the BI (JPI)
CAXMLErrorMessage ** settleAll(CAXMLCostConfirmation **CCs, UINT32 nrOfCCs, CAXMLErrorMessage **settleException)
SINT32 setPIServerConfiguration(CAXMLBI *pPiServerConfig)
~CAAccountingBIInterface()
private destructor
CAXMLErrorMessage * settle(CAXMLCostConfirmation &cc)
Send a cost confirmation to the JPI.
Very simple http client.
This class represents a socket address for Internet (IP) connections.
This class encapsulates an error or success message.