00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef _ConnectionState_
00022 #define _ConnectionState_
00023
00024 #include <vector>
00025
00026 #include "qpid/sys/AggregateOutput.h"
00027 #include "qpid/sys/ConnectionOutputHandlerPtr.h"
00028 #include "qpid/framing/ProtocolVersion.h"
00029 #include "qpid/management/Manageable.h"
00030 #include "Broker.h"
00031
00032 namespace qpid {
00033 namespace broker {
00034
00035 class ConnectionState : public ConnectionToken, public management::Manageable
00036 {
00037 protected:
00038 sys::ConnectionOutputHandlerPtr out;
00039
00040 public:
00041 ConnectionState(qpid::sys::ConnectionOutputHandler* o, Broker& b) :
00042 out(o),
00043 broker(b),
00044 outputTasks(out),
00045 framemax(65535),
00046 heartbeat(0),
00047 stagingThreshold(broker.getStagingThreshold()),
00048 federationLink(true)
00049 {}
00050
00051
00052
00053 virtual ~ConnectionState () {}
00054
00055 uint32_t getFrameMax() const { return framemax; }
00056 uint16_t getHeartbeat() const { return heartbeat; }
00057 uint64_t getStagingThreshold() const { return stagingThreshold; }
00058
00059 void setFrameMax(uint32_t fm) { framemax = fm; }
00060 void setHeartbeat(uint16_t hb) { heartbeat = hb; }
00061 void setStagingThreshold(uint64_t st) { stagingThreshold = st; }
00062
00063 virtual void setUserId(const string& uid) { userId = uid; }
00064 const string& getUserId() const { return userId; }
00065
00066 void setUrl(const string& _url) { url = _url; }
00067 const string& getUrl() const { return url; }
00068
00069 void setFederationLink(bool b) { federationLink = b; }
00070 bool isFederationLink() const { return federationLink; }
00071
00072 Broker& getBroker() { return broker; }
00073
00074 Broker& broker;
00075 std::vector<Queue::shared_ptr> exclusiveQueues;
00076
00077
00078 sys::AggregateOutput outputTasks;
00079
00080 sys::ConnectionOutputHandlerPtr& getOutput() { return out; }
00081 framing::ProtocolVersion getVersion() const { return version; }
00082
00083 void setOutputHandler(qpid::sys::ConnectionOutputHandler* o) { out.set(o); }
00084
00085 protected:
00086 framing::ProtocolVersion version;
00087 uint32_t framemax;
00088 uint16_t heartbeat;
00089 uint64_t stagingThreshold;
00090 string userId;
00091 string url;
00092 bool federationLink;
00093 };
00094
00095 }}
00096
00097 #endif