00001
00002 #ifndef _MANAGEMENT_BROKER_
00003 #define _MANAGEMENT_BROKER_
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 Broker : 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 systemRef;
00043 uint16_t port;
00044 uint16_t workerThreads;
00045 uint16_t maxConns;
00046 uint16_t connBacklog;
00047 uint32_t stagingThreshold;
00048 uint16_t mgmtPubInterval;
00049 std::string clusterName;
00050 std::string version;
00051 uint8_t dataDirEnabled;
00052 std::string dataDir;
00053
00054
00055
00056
00057 static void writeSchema (qpid::framing::Buffer& buf);
00058 void writeConfig (qpid::framing::Buffer& buf);
00059 void writeInstrumentation (qpid::framing::Buffer& buf,
00060 bool skipHeaders = false);
00061 void doMethod (std::string methodName,
00062 qpid::framing::Buffer& inBuf,
00063 qpid::framing::Buffer& outBuf);
00064 writeSchemaCall_t getWriteSchemaCall (void) { return writeSchema; }
00065
00066
00067 bool getInstChanged (void) { return false; }
00068
00069 public:
00070
00071 friend class PackageQpid;
00072 typedef boost::shared_ptr<Broker> shared_ptr;
00073
00074 Broker (Manageable* coreObject, Manageable* _parent, uint16_t _port);
00075 ~Broker (void);
00076
00077 std::string getPackageName (void) { return packageName; }
00078 std::string getClassName (void) { return className; }
00079 uint8_t* getMd5Sum (void) { return md5Sum; }
00080
00081
00082 static const uint32_t METHOD_JOINCLUSTER = 1;
00083 static const uint32_t METHOD_LEAVECLUSTER = 2;
00084 static const uint32_t METHOD_ECHO = 3;
00085 static const uint32_t METHOD_CONNECT = 4;
00086
00087
00088 inline void set_workerThreads (uint16_t val){
00089 sys::RWlock::ScopedWlock writeLock (accessLock);
00090 workerThreads = val;
00091 configChanged = true;
00092 }
00093 inline void set_maxConns (uint16_t val){
00094 sys::RWlock::ScopedWlock writeLock (accessLock);
00095 maxConns = val;
00096 configChanged = true;
00097 }
00098 inline void set_connBacklog (uint16_t val){
00099 sys::RWlock::ScopedWlock writeLock (accessLock);
00100 connBacklog = val;
00101 configChanged = true;
00102 }
00103 inline void set_stagingThreshold (uint32_t val){
00104 sys::RWlock::ScopedWlock writeLock (accessLock);
00105 stagingThreshold = val;
00106 configChanged = true;
00107 }
00108 inline void set_mgmtPubInterval (uint16_t val){
00109 sys::RWlock::ScopedWlock writeLock (accessLock);
00110 mgmtPubInterval = val;
00111 configChanged = true;
00112 }
00113 inline void set_clusterName (std::string val){
00114 sys::RWlock::ScopedWlock writeLock (accessLock);
00115 clusterName = val;
00116 configChanged = true;
00117 }
00118 inline void set_version (std::string val){
00119 sys::RWlock::ScopedWlock writeLock (accessLock);
00120 version = val;
00121 configChanged = true;
00122 }
00123 inline void set_dataDirEnabled (uint8_t val){
00124 sys::RWlock::ScopedWlock writeLock (accessLock);
00125 dataDirEnabled = val;
00126 configChanged = true;
00127 }
00128 inline void set_dataDir (std::string val){
00129 sys::RWlock::ScopedWlock writeLock (accessLock);
00130 dataDir = val;
00131 configChanged = true;
00132 }
00133
00134 };
00135
00136 }}
00137
00138
00139 #endif