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 {}
00049
00050
00051
00052 virtual ~ConnectionState () {}
00053
00054 uint32_t getFrameMax() const { return framemax; }
00055 uint16_t getHeartbeat() const { return heartbeat; }
00056 uint64_t getStagingThreshold() const { return stagingThreshold; }
00057
00058 void setFrameMax(uint32_t fm) { framemax = fm; }
00059 void setHeartbeat(uint16_t hb) { heartbeat = hb; }
00060 void setStagingThreshold(uint64_t st) { stagingThreshold = st; }
00061
00062 virtual void setUserId(const string& uid) { userId = uid; }
00063 const string& getUserId() const { return userId; }
00064
00065 Broker& getBroker() { return broker; }
00066
00067 Broker& broker;
00068 std::vector<Queue::shared_ptr> exclusiveQueues;
00069
00070
00071 sys::AggregateOutput outputTasks;
00072
00073 sys::ConnectionOutputHandlerPtr& getOutput() { return out; }
00074 framing::ProtocolVersion getVersion() const { return version; }
00075
00076 void setOutputHandler(qpid::sys::ConnectionOutputHandler* o) { out.set(o); }
00077
00078 protected:
00079 framing::ProtocolVersion version;
00080 uint32_t framemax;
00081 uint16_t heartbeat;
00082 uint64_t stagingThreshold;
00083 string userId;
00084 };
00085
00086 }}
00087
00088 #endif