BOSS 7.1.2
BESIII Offline Software System
|
A class to handle XML RPC requests from a particular client. More...
#include <XmlRpcServerConnection.h>
Public Member Functions | |
XmlRpcServerConnection (int fd, XmlRpcServer *server, bool deleteOnClose=false) | |
Constructor. | |
virtual | ~XmlRpcServerConnection () |
Destructor. | |
virtual unsigned | handleEvent (unsigned eventType) |
Public Member Functions inherited from XmlRpc::XmlRpcSource | |
XmlRpcSource (int fd=-1, bool deleteOnClose=false) | |
virtual | ~XmlRpcSource () |
Destructor. | |
int | getfd () const |
Return the file descriptor being monitored. | |
void | setfd (int fd) |
Specify the file descriptor to monitor. | |
bool | getKeepOpen () const |
Return whether the file descriptor should be kept open if it is no longer monitored. | |
void | setKeepOpen (bool b=true) |
Specify whether the file descriptor should be kept open if it is no longer monitored. | |
virtual void | close () |
Close the owned fd. If deleteOnClose was specified at construction, the object is deleted. | |
Static Public Attributes | |
static const char | METHODNAME_TAG [] = "<methodName>" |
static const char | PARAMS_TAG [] = "<params>" |
static const char | PARAMS_ETAG [] = "</params>" |
static const char | PARAM_TAG [] = "<param>" |
static const char | PARAM_ETAG [] = "</param>" |
static const std::string | SYSTEM_MULTICALL = "system.multicall" |
static const std::string | METHODNAME = "methodName" |
static const std::string | PARAMS = "params" |
static const std::string | FAULTCODE = "faultCode" |
static const std::string | FAULTSTRING = "faultString" |
Protected Types | |
enum | ServerConnectionState { READ_HEADER , READ_REQUEST , WRITE_RESPONSE } |
Protected Member Functions | |
bool | readHeader () |
bool | readRequest () |
bool | writeResponse () |
virtual void | executeRequest () |
std::string | parseRequest (XmlRpcValue ¶ms) |
bool | executeMethod (const std::string &methodName, XmlRpcValue ¶ms, XmlRpcValue &result) |
bool | executeMulticall (const std::string &methodName, XmlRpcValue ¶ms, XmlRpcValue &result) |
void | generateResponse (std::string const &resultXml) |
void | generateFaultResponse (std::string const &msg, int errorCode=-1) |
std::string | generateHeader (std::string const &body) |
Protected Attributes | |
XmlRpcServer * | _server |
ServerConnectionState | _connectionState |
std::string | _header |
int | _contentLength |
std::string | _request |
std::string | _response |
int | _bytesWritten |
bool | _keepAlive |
A class to handle XML RPC requests from a particular client.
Definition at line 25 of file XmlRpcServerConnection.h.
|
protected |
Enumerator | |
---|---|
READ_HEADER | |
READ_REQUEST | |
WRITE_RESPONSE |
Definition at line 79 of file XmlRpcServerConnection.h.
XmlRpcServerConnection::XmlRpcServerConnection | ( | int | fd, |
XmlRpcServer * | server, | ||
bool | deleteOnClose = false ) |
Constructor.
Definition at line 31 of file XmlRpcServerConnection.cpp.
|
virtual |
Destructor.
Definition at line 41 of file XmlRpcServerConnection.cpp.
|
protected |
Definition at line 254 of file XmlRpcServerConnection.cpp.
Referenced by executeMulticall(), and executeRequest().
|
protected |
Definition at line 272 of file XmlRpcServerConnection.cpp.
Referenced by executeMulticall(), and executeRequest().
|
protectedvirtual |
Definition at line 208 of file XmlRpcServerConnection.cpp.
Referenced by writeResponse().
|
protected |
Definition at line 356 of file XmlRpcServerConnection.cpp.
Referenced by executeRequest().
|
protected |
Definition at line 338 of file XmlRpcServerConnection.cpp.
Referenced by generateFaultResponse(), and generateResponse().
|
protected |
Definition at line 321 of file XmlRpcServerConnection.cpp.
Referenced by executeRequest().
|
virtual |
Handle IO on the client connection socket.
eventType | Type of IO event that occurred. |
Implements XmlRpc::XmlRpcSource.
Definition at line 52 of file XmlRpcServerConnection.cpp.
|
protected |
Definition at line 232 of file XmlRpcServerConnection.cpp.
Referenced by executeRequest().
|
protected |
Definition at line 69 of file XmlRpcServerConnection.cpp.
Referenced by handleEvent().
|
protected |
Definition at line 146 of file XmlRpcServerConnection.cpp.
Referenced by handleEvent().
|
protected |
Definition at line 177 of file XmlRpcServerConnection.cpp.
Referenced by handleEvent().
|
protected |
Definition at line 95 of file XmlRpcServerConnection.h.
Referenced by writeResponse().
|
protected |
Definition at line 80 of file XmlRpcServerConnection.h.
Referenced by handleEvent(), readHeader(), readRequest(), writeResponse(), and XmlRpcServerConnection().
|
protected |
Definition at line 86 of file XmlRpcServerConnection.h.
Referenced by readHeader(), and readRequest().
|
protected |
Definition at line 83 of file XmlRpcServerConnection.h.
Referenced by readHeader(), and writeResponse().
|
protected |
Definition at line 98 of file XmlRpcServerConnection.h.
Referenced by readHeader(), writeResponse(), and XmlRpcServerConnection().
|
protected |
Definition at line 89 of file XmlRpcServerConnection.h.
Referenced by parseRequest(), readHeader(), readRequest(), and writeResponse().
|
protected |
Definition at line 92 of file XmlRpcServerConnection.h.
Referenced by generateFaultResponse(), generateResponse(), and writeResponse().
|
protected |
Definition at line 76 of file XmlRpcServerConnection.h.
Referenced by executeMethod(), XmlRpcServerConnection(), and ~XmlRpcServerConnection().
|
static |
Definition at line 38 of file XmlRpcServerConnection.h.
Referenced by executeMulticall(), and generateFaultResponse().
|
static |
Definition at line 39 of file XmlRpcServerConnection.h.
Referenced by executeMulticall(), and generateFaultResponse().
|
static |
Definition at line 35 of file XmlRpcServerConnection.h.
Referenced by executeMulticall().
|
static |
Definition at line 28 of file XmlRpcServerConnection.h.
Referenced by parseRequest().
|
static |
Definition at line 32 of file XmlRpcServerConnection.h.
Referenced by parseRequest().
|
static |
Definition at line 31 of file XmlRpcServerConnection.h.
Referenced by parseRequest().
|
static |
Definition at line 36 of file XmlRpcServerConnection.h.
Referenced by executeMulticall().
|
static |
Definition at line 30 of file XmlRpcServerConnection.h.
Referenced by parseRequest().
|
static |
Definition at line 29 of file XmlRpcServerConnection.h.
Referenced by parseRequest().
|
static |
Definition at line 34 of file XmlRpcServerConnection.h.
Referenced by executeMulticall().