Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET Apache Qpid Documentation
SessionManager.h
Go to the documentation of this file.
1 #ifndef _QPID_CONSOLE_SESSION_MANAGER_H
2 #define _QPID_CONSOLE_SESSION_MANAGER_H
3 
4 /*
5  *
6  * Licensed to the Apache Software Foundation (ASF) under one
7  * or more contributor license agreements. See the NOTICE file
8  * distributed with this work for additional information
9  * regarding copyright ownership. The ASF licenses this file
10  * to you under the Apache License, Version 2.0 (the
11  * "License"); you may not use this file except in compliance
12  * with the License. You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing,
17  * software distributed under the License is distributed on an
18  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
19  * KIND, either express or implied. See the License for the
20  * specific language governing permissions and limitations
21  * under the License.
22  *
23  */
24 
26 #include "qpid/console/Broker.h"
27 #include "qpid/console/Package.h"
29 #include "qpid/console/ClassKey.h"
30 #include "qpid/console/Schema.h"
31 #include "qpid/console/Agent.h"
32 #include "qpid/console/Object.h"
33 #include "qpid/console/ObjectId.h"
34 #include "qpid/console/Value.h"
35 #include "qpid/sys/Mutex.h"
36 #include "qpid/sys/Condition.h"
38 #include <string>
39 #include <vector>
40 
41 namespace qpid {
42 namespace console {
43 
44 class ConsoleListener;
45 
51 {
52  public:
53  typedef std::vector<std::string> NameVector;
54  typedef std::vector<ClassKey> KeyVector;
56 
57  struct Settings {
58  bool rcvObjects;
59  bool rcvEvents;
64 
65  Settings() : rcvObjects(true), rcvEvents(true), rcvHeartbeats(true),
66  userBindings(false), methodTimeout(20), getTimeout(20)
67  {}
68  };
69 
85  Settings settings = Settings());
86 
94 
100 
106 
112  QPID_CONSOLE_EXTERN void getClasses(KeyVector& classKeys,
113  const std::string& packageName);
114 
120 
128  QPID_CONSOLE_EXTERN void bindPackage(const std::string& packageName);
129 
137  QPID_CONSOLE_EXTERN void bindClass(const ClassKey& classKey);
138  QPID_CONSOLE_EXTERN void bindClass(const std::string& packageName,
139  const std::string& className);
140 
150  QPID_CONSOLE_EXTERN void bindEvent(const ClassKey& classKey);
151  QPID_CONSOLE_EXTERN void bindEvent(const std::string& packageName,
152  const std::string& eventName="");
153 
154 
162  Broker* broker = 0);
163 
175  const std::string& className,
176  Broker* broker = 0,
177  Agent* agent = 0);
178  //void getObjects(Object::Vector& objects, const ClassKey& classKey,
179  // Broker* broker = 0, Agent* agent = 0);
180  //void getObjects(Object::Vector& objects, const ObjectId& objectId,
181  // Broker* broker = 0, Agent* agent = 0);
182 
183 private:
184  friend class Broker;
186  friend class Object;
187  sys::Mutex lock;
188  sys::Mutex brokerListLock;
189  ConsoleListener* listener;
190  std::vector<Broker*> brokers;
191  std::map<std::string, Package*> packages;
192  SequenceManager sequenceManager;
193  sys::Condition cv;
194  SequenceManager::set syncSequenceList;
195  Object::Vector getResult;
196  std::string error;
197  Settings settings;
198  NameVector bindingKeyList;
199 
200  void bindingKeys();
201  void allBrokersStable();
202  void startProtocol(Broker* broker);
203  void handleBrokerResp(Broker* broker, framing::Buffer& inBuffer, uint32_t sequence);
204  void handlePackageInd(Broker* broker, framing::Buffer& inBuffer, uint32_t sequence);
205  void handleCommandComplete(Broker* broker, framing::Buffer& inBuffer, uint32_t sequence);
206  void handleClassInd(Broker* broker, framing::Buffer& inBuffer, uint32_t sequence);
207  void handleMethodResp(Broker* broker, framing::Buffer& inBuffer, uint32_t sequence);
208  void handleHeartbeatInd(Broker* broker, framing::Buffer& inBuffer, uint32_t sequence);
209  void handleEventInd(Broker* broker, framing::Buffer& inBuffer, uint32_t sequence);
210  void handleSchemaResp(Broker* broker, framing::Buffer& inBuffer, uint32_t sequence);
211  void handleContentInd(Broker* broker, framing::Buffer& inBuffer, uint32_t sequence, bool prop, bool stat);
212  void handleBrokerConnect(Broker* broker);
213  void handleBrokerDisconnect(Broker* broker);
214 
215 };
216 
217 }} // namespace qpid::console
218 
219 #endif

Qpid C++ API Reference
Generated on Fri Feb 22 2013 for Qpid C++ Client API by doxygen 1.8.3