00001
00002 #ifndef _MANAGEMENT_LINK_
00003 #define _MANAGEMENT_LINK_
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 Link : 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 host;
00045 uint16_t port;
00046 uint8_t useSsl;
00047 uint8_t durable;
00048
00049
00050 std::string state;
00051 std::string lastError;
00052
00053
00054
00055 static void writeSchema (qpid::framing::Buffer& buf);
00056 void writeProperties (qpid::framing::Buffer& buf);
00057 void writeStatistics (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 public:
00065
00066 friend class PackageQpid;
00067
00068 Link (ManagementAgent* agent,
00069 Manageable* coreObject, Manageable* _parent, std::string _host, uint16_t _port, uint8_t _useSsl, uint8_t _durable);
00070 ~Link (void);
00071
00072
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 static const uint32_t METHOD_BRIDGE = 2;
00081
00082
00083 inline void set_state (std::string val){
00084 sys::Mutex::ScopedLock mutex(accessLock);
00085 state = val;
00086 instChanged = true;
00087 }
00088 inline void set_lastError (std::string val){
00089 sys::Mutex::ScopedLock mutex(accessLock);
00090 lastError = val;
00091 instChanged = true;
00092 }
00093
00094 };
00095
00096 }}
00097
00098 #endif