Qpid Management Framework  0.24
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ConsoleSession.h
Go to the documentation of this file.
1 #ifndef QMF_CONSOLE_SESSION_H
2 #define QMF_CONSOLE_SESSION_H
3 /*
4  *
5  * Licensed to the Apache Software Foundation (ASF) under one
6  * or more contributor license agreements. See the NOTICE file
7  * distributed with this work for additional information
8  * regarding copyright ownership. The ASF licenses this file
9  * to you under the Apache License, Version 2.0 (the
10  * "License"); you may not use this file except in compliance
11  * with the License. You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing,
16  * software distributed under the License is distributed on an
17  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18  * KIND, either express or implied. See the License for the
19  * specific language governing permissions and limitations
20  * under the License.
21  *
22  */
23 
24 #include <qmf/ImportExport.h>
25 #include "qmf/Handle.h"
26 #include "qmf/Agent.h"
27 #include "qmf/Subscription.h"
28 #include "qpid/messaging/Duration.h"
29 #include "qpid/messaging/Connection.h"
30 #include <string>
31 
32 namespace qmf {
33 
34 #ifndef SWIG
35  template <class> class PrivateImplRef;
36 #endif
37 
38  class ConsoleSessionImpl;
39  class ConsoleEvent;
40 
41  class QMF_CLASS_EXTERN ConsoleSession : public qmf::Handle<ConsoleSessionImpl> {
42  public:
43  QMF_EXTERN ConsoleSession(ConsoleSessionImpl* impl = 0);
44  QMF_EXTERN ConsoleSession(const ConsoleSession&);
45  QMF_EXTERN ConsoleSession& operator=(const ConsoleSession&);
46  QMF_EXTERN ~ConsoleSession();
47 
69  QMF_EXTERN ConsoleSession(qpid::messaging::Connection& conn, const std::string& options="");
70 
76  QMF_EXTERN void setDomain(const std::string& domain);
77  QMF_EXTERN void setAgentFilter(const std::string& filter);
78 
82  QMF_EXTERN void open();
83 
87  QMF_EXTERN void close();
88 
95  QMF_EXTERN bool nextEvent(ConsoleEvent& outEvent, qpid::messaging::Duration timeout=qpid::messaging::Duration::FOREVER);
96 
100  QMF_EXTERN int pendingEvents() const;
101 
105  QMF_EXTERN uint32_t getAgentCount() const;
106  QMF_EXTERN Agent getAgent(uint32_t agentIndex) const;
107 
111  QMF_EXTERN Agent getConnectedBrokerAgent() const;
112 
120  QMF_EXTERN Subscription subscribe(const Query& query, const std::string& agentFilter = "", const std::string& options = "");
121  QMF_EXTERN Subscription subscribe(const std::string& query, const std::string& agentFilter = "", const std::string& options = "");
122 
123 #ifndef SWIG
124  private:
125  friend class qmf::PrivateImplRef<ConsoleSession>;
126  friend struct ConsoleSessionImplAccess;
127 #endif
128  };
129 
130 }
131 
132 #endif