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/FieldTable.h"
00029 #include "qpid/framing/Uuid.h"
00030
00031 namespace qpid {
00032 namespace management {
00033
00034 class Session : 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 name;
00045 uint16_t channelId;
00046 uint64_t clientRef;
00047 uint32_t detachedLifespan;
00048
00049
00050 uint8_t attached;
00051 uint64_t expireTime;
00052 uint32_t framesOutstanding;
00053
00054
00055 static void writeSchema (qpid::framing::Buffer& buf);
00056 void writeConfig (qpid::framing::Buffer& buf);
00057 void writeInstrumentation (qpid::framing::Buffer& buf,
00058 bool skipHeaders = false);
00059 void doMethod (std::string methodName,
00060 qpid::framing::Buffer& inBuf,
00061 qpid::framing::Buffer& outBuf);
00062 writeSchemaCall_t getWriteSchemaCall (void) { return writeSchema; }
00063
00064
00065 public:
00066
00067 friend class PackageQpid;
00068 typedef boost::shared_ptr<Session> shared_ptr;
00069
00070 Session (Manageable* coreObject, Manageable* _parent, std::string _name);
00071 ~Session (void);
00072
00073 std::string getPackageName (void) { return packageName; }
00074 std::string getClassName (void) { return className; }
00075 uint8_t* getMd5Sum (void) { return md5Sum; }
00076
00077
00078 static const uint32_t METHOD_SOLICITACK = 1;
00079 static const uint32_t METHOD_DETACH = 2;
00080 static const uint32_t METHOD_RESETLIFESPAN = 3;
00081 static const uint32_t METHOD_CLOSE = 4;
00082
00083
00084 inline void set_channelId (uint16_t val){
00085 sys::RWlock::ScopedWlock writeLock (accessLock);
00086 channelId = val;
00087 configChanged = true;
00088 }
00089 inline void set_clientRef (uint64_t val){
00090 sys::RWlock::ScopedWlock writeLock (accessLock);
00091 clientRef = val;
00092 configChanged = true;
00093 }
00094 inline void set_detachedLifespan (uint32_t val){
00095 sys::RWlock::ScopedWlock writeLock (accessLock);
00096 detachedLifespan = val;
00097 configChanged = true;
00098 }
00099 inline void set_attached (uint8_t val){
00100 sys::RWlock::ScopedWlock writeLock (accessLock);
00101 attached = val;
00102 instChanged = true;
00103 }
00104 inline void set_expireTime (uint64_t val){
00105 sys::RWlock::ScopedWlock writeLock (accessLock);
00106 expireTime = val;
00107 instChanged = true;
00108 }
00109 inline void inc_framesOutstanding (uint32_t by = 1){
00110 sys::RWlock::ScopedWlock writeLock (accessLock);
00111 framesOutstanding += by;
00112 instChanged = true;
00113 }
00114 inline void dec_framesOutstanding (uint32_t by = 1){
00115 sys::RWlock::ScopedWlock writeLock (accessLock);
00116 framesOutstanding -= by;
00117 instChanged = true;
00118 }
00119 inline void set_framesOutstanding (uint32_t val){
00120 sys::RWlock::ScopedWlock writeLock (accessLock);
00121 framesOutstanding = val;
00122 instChanged = true;
00123 }
00124
00125 };
00126
00127 }}
00128
00129
00130 #endif