00001
00002 #ifndef _MANAGEMENT_CLIENT_
00003 #define _MANAGEMENT_CLIENT_
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include "qpid/management/ManagementObject.h"
00028 #include "qpid/framing/FieldTable.h"
00029 #include "qpid/framing/Uuid.h"
00030
00031 namespace qpid {
00032 namespace management {
00033
00034 class Client : public ManagementObject
00035 {
00036 private:
00037
00038 static std::string packageName;
00039 static std::string className;
00040 static uint8_t md5Sum[16];
00041
00042
00043 uint64_t vhostRef;
00044 std::string address;
00045 uint8_t incoming;
00046
00047
00048 uint8_t closing;
00049 std::string authIdentity;
00050 uint64_t framesFromClient;
00051 uint64_t framesToClient;
00052 uint64_t bytesFromClient;
00053 uint64_t bytesToClient;
00054
00055
00056 static void writeSchema (qpid::framing::Buffer& buf);
00057 void writeConfig (qpid::framing::Buffer& buf);
00058 void writeInstrumentation (qpid::framing::Buffer& buf,
00059 bool skipHeaders = false);
00060 void doMethod (std::string methodName,
00061 qpid::framing::Buffer& inBuf,
00062 qpid::framing::Buffer& outBuf);
00063 writeSchemaCall_t getWriteSchemaCall (void) { return writeSchema; }
00064
00065
00066 public:
00067
00068 friend class PackageQpid;
00069 typedef boost::shared_ptr<Client> shared_ptr;
00070
00071 Client (Manageable* coreObject, Manageable* _parent, std::string _address, uint8_t _incoming);
00072 ~Client (void);
00073
00074 std::string getPackageName (void) { return packageName; }
00075 std::string getClassName (void) { return className; }
00076 uint8_t* getMd5Sum (void) { return md5Sum; }
00077
00078
00079 static const uint32_t METHOD_CLOSE = 1;
00080
00081
00082 inline void set_closing (uint8_t val){
00083 sys::RWlock::ScopedWlock writeLock (accessLock);
00084 closing = val;
00085 instChanged = true;
00086 }
00087 inline void set_authIdentity (std::string val){
00088 sys::RWlock::ScopedWlock writeLock (accessLock);
00089 authIdentity = val;
00090 instChanged = true;
00091 }
00092 inline void inc_framesFromClient (uint64_t by = 1){
00093 sys::RWlock::ScopedWlock writeLock (accessLock);
00094 framesFromClient += by;
00095 instChanged = true;
00096 }
00097 inline void dec_framesFromClient (uint64_t by = 1){
00098 sys::RWlock::ScopedWlock writeLock (accessLock);
00099 framesFromClient -= by;
00100 instChanged = true;
00101 }
00102 inline void set_framesFromClient (uint64_t val){
00103 sys::RWlock::ScopedWlock writeLock (accessLock);
00104 framesFromClient = val;
00105 instChanged = true;
00106 }
00107 inline void inc_framesToClient (uint64_t by = 1){
00108 sys::RWlock::ScopedWlock writeLock (accessLock);
00109 framesToClient += by;
00110 instChanged = true;
00111 }
00112 inline void dec_framesToClient (uint64_t by = 1){
00113 sys::RWlock::ScopedWlock writeLock (accessLock);
00114 framesToClient -= by;
00115 instChanged = true;
00116 }
00117 inline void set_framesToClient (uint64_t val){
00118 sys::RWlock::ScopedWlock writeLock (accessLock);
00119 framesToClient = val;
00120 instChanged = true;
00121 }
00122 inline void inc_bytesFromClient (uint64_t by = 1){
00123 sys::RWlock::ScopedWlock writeLock (accessLock);
00124 bytesFromClient += by;
00125 instChanged = true;
00126 }
00127 inline void dec_bytesFromClient (uint64_t by = 1){
00128 sys::RWlock::ScopedWlock writeLock (accessLock);
00129 bytesFromClient -= by;
00130 instChanged = true;
00131 }
00132 inline void set_bytesFromClient (uint64_t val){
00133 sys::RWlock::ScopedWlock writeLock (accessLock);
00134 bytesFromClient = val;
00135 instChanged = true;
00136 }
00137 inline void inc_bytesToClient (uint64_t by = 1){
00138 sys::RWlock::ScopedWlock writeLock (accessLock);
00139 bytesToClient += by;
00140 instChanged = true;
00141 }
00142 inline void dec_bytesToClient (uint64_t by = 1){
00143 sys::RWlock::ScopedWlock writeLock (accessLock);
00144 bytesToClient -= by;
00145 instChanged = true;
00146 }
00147 inline void set_bytesToClient (uint64_t val){
00148 sys::RWlock::ScopedWlock writeLock (accessLock);
00149 bytesToClient = val;
00150 instChanged = true;
00151 }
00152
00153 };
00154
00155 }}
00156
00157
00158 #endif