/usr/share/cruisecontrol-bin-2.6.1/projects/qpid-trunk/cpp/src/qpid/broker/ConnectionState.h

00001 /*
00002  *
00003  * Licensed to the Apache Software Foundation (ASF) under one
00004  * or more contributor license agreements.  See the NOTICE file
00005  * distributed with this work for additional information
00006  * regarding copyright ownership.  The ASF licenses this file
00007  * to you under the Apache License, Version 2.0 (the
00008  * "License"); you may not use this file except in compliance
00009  * with the License.  You may obtain a copy of the License at
00010  * 
00011  *   http://www.apache.org/licenses/LICENSE-2.0
00012  * 
00013  * Unless required by applicable law or agreed to in writing,
00014  * software distributed under the License is distributed on an
00015  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
00016  * KIND, either express or implied.  See the License for the
00017  * specific language governing permissions and limitations
00018  * under the License.
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     //contained output tasks
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

Generated on Thu Apr 10 11:08:17 2008 for Qpid by  doxygen 1.4.7