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/Uuid.h"
00029
00030 namespace qpid {
00031 namespace management {
00032
00033 class Client : public ManagementObject
00034 {
00035 private:
00036
00037 static std::string packageName;
00038 static std::string className;
00039 static uint8_t md5Sum[16];
00040
00041
00042 uint64_t vhostRef;
00043 std::string address;
00044
00045
00046 uint8_t closing;
00047 std::string authIdentity;
00048 uint64_t framesFromClient;
00049 uint64_t framesToClient;
00050 uint64_t bytesFromClient;
00051 uint64_t bytesToClient;
00052
00053
00054 static void writeSchema (qpid::framing::Buffer& buf);
00055 void writeConfig (qpid::framing::Buffer& buf);
00056 void writeInstrumentation (qpid::framing::Buffer& buf,
00057 bool skipHeaders = false);
00058 void doMethod (std::string methodName,
00059 qpid::framing::Buffer& inBuf,
00060 qpid::framing::Buffer& outBuf);
00061 writeSchemaCall_t getWriteSchemaCall (void) { return writeSchema; }
00062
00063
00064 public:
00065
00066 friend class PackageQpid;
00067 typedef boost::shared_ptr<Client> shared_ptr;
00068
00069 Client (Manageable* coreObject, Manageable* _parent, std::string _address);
00070 ~Client (void);
00071
00072 std::string getPackageName (void) { return packageName; }
00073 std::string getClassName (void) { return className; }
00074 uint8_t* getMd5Sum (void) { return md5Sum; }
00075
00076
00077 static const uint32_t METHOD_CLOSE = 1;
00078
00079
00080 inline void set_closing (uint8_t val){
00081 sys::RWlock::ScopedWlock writeLock (accessLock);
00082 closing = val;
00083 instChanged = true;
00084 }
00085 inline void set_authIdentity (std::string val){
00086 sys::RWlock::ScopedWlock writeLock (accessLock);
00087 authIdentity = val;
00088 instChanged = true;
00089 }
00090 inline void inc_framesFromClient (uint64_t by = 1){
00091 sys::RWlock::ScopedWlock writeLock (accessLock);
00092 framesFromClient += by;
00093 instChanged = true;
00094 }
00095 inline void dec_framesFromClient (uint64_t by = 1){
00096 sys::RWlock::ScopedWlock writeLock (accessLock);
00097 framesFromClient -= by;
00098 instChanged = true;
00099 }
00100 inline void inc_framesToClient (uint64_t by = 1){
00101 sys::RWlock::ScopedWlock writeLock (accessLock);
00102 framesToClient += by;
00103 instChanged = true;
00104 }
00105 inline void dec_framesToClient (uint64_t by = 1){
00106 sys::RWlock::ScopedWlock writeLock (accessLock);
00107 framesToClient -= by;
00108 instChanged = true;
00109 }
00110 inline void inc_bytesFromClient (uint64_t by = 1){
00111 sys::RWlock::ScopedWlock writeLock (accessLock);
00112 bytesFromClient += by;
00113 instChanged = true;
00114 }
00115 inline void dec_bytesFromClient (uint64_t by = 1){
00116 sys::RWlock::ScopedWlock writeLock (accessLock);
00117 bytesFromClient -= by;
00118 instChanged = true;
00119 }
00120 inline void inc_bytesToClient (uint64_t by = 1){
00121 sys::RWlock::ScopedWlock writeLock (accessLock);
00122 bytesToClient += by;
00123 instChanged = true;
00124 }
00125 inline void dec_bytesToClient (uint64_t by = 1){
00126 sys::RWlock::ScopedWlock writeLock (accessLock);
00127 bytesToClient -= by;
00128 instChanged = true;
00129 }
00130
00131 };
00132
00133 }}
00134
00135
00136 #endif