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