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