Qpid Management Framework  0.24
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ResilientConnection.h
Go to the documentation of this file.
1 #ifndef _QmfEngineResilientConnection_
2 #define _QmfEngineResilientConnection_
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 #include <qmf/engine/Message.h>
25 #include <string>
26 
27 namespace qmf {
28 namespace engine {
29 
30  class ResilientConnectionImpl;
31 
36  enum EventKind {
37  CONNECTED = 1,
40  RECV = 4
41  };
42 
44  void* sessionContext; // SESSION_CLOSED, RECV
45  char* errorText; // DISCONNECTED, SESSION_CLOSED
46  Message message; // RECV
47  };
48 
49  class SessionHandle {
51  void* impl;
52  };
53 
63  public:
64 
72  ResilientConnection(const ConnectionSettings& settings);
74 
79  bool isConnected() const;
80 
87 
92  void popEvent();
93 
103  bool createSession(const char* name, void* sessionContext, SessionHandle& handle);
104 
109  void destroySession(SessionHandle handle);
110 
116  void sendMessage(SessionHandle handle, Message& message);
117 
123  void declareQueue(SessionHandle handle, char* queue);
124 
130  void deleteQueue(SessionHandle handle, char* queue);
131 
139  void bind(SessionHandle handle, char* exchange, char* queue, char* key);
140 
148  void unbind(SessionHandle handle, char* exchange, char* queue, char* key);
149 
156  void setNotifyFd(int fd);
157 
164  void notify();
165 
166  private:
167  ResilientConnectionImpl* impl;
168  };
169 }
170 }
171 
172 #endif
173