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