00001
00002 #ifndef _MANAGEMENT_SESSION_
00003 #define _MANAGEMENT_SESSION_
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 Session : 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 name;
00044 uint16_t channelId;
00045 uint64_t clientRef;
00046 uint32_t detachedLifespan;
00047
00048
00049 uint8_t attached;
00050 uint64_t expireTime;
00051 uint32_t framesOutstanding;
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<Session> shared_ptr;
00068
00069 Session (Manageable* coreObject, Manageable* _parent, std::string _name);
00070 ~Session (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_SOLICITACK = 1;
00078 static const uint32_t METHOD_DETACH = 2;
00079 static const uint32_t METHOD_RESETLIFESPAN = 3;
00080 static const uint32_t METHOD_CLOSE = 4;
00081
00082
00083 inline void set_channelId (uint16_t val){
00084 sys::RWlock::ScopedWlock writeLock (accessLock);
00085 channelId = val;
00086 configChanged = true;
00087 }
00088 inline void set_clientRef (uint64_t val){
00089 sys::RWlock::ScopedWlock writeLock (accessLock);
00090 clientRef = val;
00091 configChanged = true;
00092 }
00093 inline void set_detachedLifespan (uint32_t val){
00094 sys::RWlock::ScopedWlock writeLock (accessLock);
00095 detachedLifespan = val;
00096 configChanged = true;
00097 }
00098 inline void set_attached (uint8_t val){
00099 sys::RWlock::ScopedWlock writeLock (accessLock);
00100 attached = val;
00101 instChanged = true;
00102 }
00103 inline void set_expireTime (uint64_t val){
00104 sys::RWlock::ScopedWlock writeLock (accessLock);
00105 expireTime = val;
00106 instChanged = true;
00107 }
00108 inline void inc_framesOutstanding (uint32_t by = 1){
00109 sys::RWlock::ScopedWlock writeLock (accessLock);
00110 framesOutstanding += by;
00111 instChanged = true;
00112 }
00113 inline void dec_framesOutstanding (uint32_t by = 1){
00114 sys::RWlock::ScopedWlock writeLock (accessLock);
00115 framesOutstanding -= by;
00116 instChanged = true;
00117 }
00118
00119 };
00120
00121 }}
00122
00123
00124 #endif