Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET Apache Qpid Documentation
qpid/messaging/Session.h
Go to the documentation of this file.
00001 #ifndef QPID_MESSAGING_SESSION_H
00002 #define QPID_MESSAGING_SESSION_H
00003 
00004 /*
00005  *
00006  * Licensed to the Apache Software Foundation (ASF) under one
00007  * or more contributor license agreements.  See the NOTICE file
00008  * distributed with this work for additional information
00009  * regarding copyright ownership.  The ASF licenses this file
00010  * to you under the Apache License, Version 2.0 (the
00011  * "License"); you may not use this file except in compliance
00012  * with the License.  You may obtain a copy of the License at
00013  * 
00014  *   http://www.apache.org/licenses/LICENSE-2.0
00015  * 
00016  * Unless required by applicable law or agreed to in writing,
00017  * software distributed under the License is distributed on an
00018  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
00019  * KIND, either express or implied.  See the License for the
00020  * specific language governing permissions and limitations
00021  * under the License.
00022  *
00023  */
00024 #include "qpid/messaging/ImportExport.h"
00025 
00026 #include "qpid/messaging/exceptions.h"
00027 #include "qpid/messaging/Duration.h"
00028 #include "qpid/messaging/Handle.h"
00029 
00030 #include <string>
00031 
00032 namespace qpid {
00033 namespace messaging {
00034 
00035 #ifndef SWIG
00036 template <class> class PrivateImplRef;
00037 #endif
00038 class Address;
00039 class Connection;
00040 class Message;
00041 class Sender;
00042 class Receiver;
00043 class SessionImpl;
00044 
00049 class QPID_MESSAGING_CLASS_EXTERN Session : public qpid::messaging::Handle<SessionImpl>
00050 {
00051   public:
00052     QPID_MESSAGING_EXTERN Session(SessionImpl* impl = 0);
00053     QPID_MESSAGING_EXTERN Session(const Session&);
00054     QPID_MESSAGING_EXTERN ~Session();
00055     QPID_MESSAGING_EXTERN Session& operator=(const Session&);
00056 
00063     QPID_MESSAGING_EXTERN void close();
00064 
00065     QPID_MESSAGING_EXTERN void commit();
00066     QPID_MESSAGING_EXTERN void rollback();
00067 
00075     QPID_MESSAGING_EXTERN void acknowledge(bool sync=false);
00079     QPID_MESSAGING_EXTERN void acknowledge(Message&, bool sync=false);
00083     QPID_MESSAGING_EXTERN void acknowledgeUpTo(Message&, bool sync=false);
00089     QPID_MESSAGING_EXTERN void reject(Message&);
00095     QPID_MESSAGING_EXTERN void release(Message&);
00096 
00105     QPID_MESSAGING_EXTERN void sync(bool block=true);
00106 
00113     QPID_MESSAGING_EXTERN uint32_t getReceivable();
00119     QPID_MESSAGING_EXTERN uint32_t getUnsettledAcks();
00128     QPID_MESSAGING_EXTERN bool nextReceiver(Receiver&, Duration timeout=Duration::FOREVER);
00137     QPID_MESSAGING_EXTERN Receiver nextReceiver(Duration timeout=Duration::FOREVER);
00138     
00143     QPID_MESSAGING_EXTERN Sender createSender(const Address& address);
00144     QPID_MESSAGING_EXTERN Sender createSender(const std::string& address);
00145 
00150     QPID_MESSAGING_EXTERN Receiver createReceiver(const Address& address);
00151     QPID_MESSAGING_EXTERN Receiver createReceiver(const std::string& address);
00152 
00157     QPID_MESSAGING_EXTERN Sender getSender(const std::string& name) const;
00162     QPID_MESSAGING_EXTERN Receiver getReceiver(const std::string& name) const;
00167     QPID_MESSAGING_EXTERN Connection getConnection() const;
00168 
00169     QPID_MESSAGING_EXTERN bool hasError();
00170     QPID_MESSAGING_EXTERN void checkError();
00171 
00172 #ifndef SWIG
00173   private:
00174   friend class qpid::messaging::PrivateImplRef<Session>;
00175 #endif
00176 };
00177 }} // namespace qpid::messaging
00178 
00179 #endif  

Qpid C++ API Reference
Generated on Mon Aug 22 2011 for Qpid C++ Client API by doxygen 1.7.4