Qpid C++ API Reference
Generated on Thu Apr 14 2011 18:21:08 for Qpid C++ Client API by doxygen 1.7.3

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 MessageListener;
00042 class Sender;
00043 class Receiver;
00044 class SessionImpl;
00045 class Subscription;
00046 
00051 class Session : public qpid::messaging::Handle<SessionImpl>
00052 {
00053   public:
00054     QPID_MESSAGING_EXTERN Session(SessionImpl* impl = 0);
00055     QPID_MESSAGING_EXTERN Session(const Session&);
00056     QPID_MESSAGING_EXTERN ~Session();
00057     QPID_MESSAGING_EXTERN Session& operator=(const Session&);
00058 
00065     QPID_MESSAGING_EXTERN void close();
00066 
00067     QPID_MESSAGING_EXTERN void commit();
00068     QPID_MESSAGING_EXTERN void rollback();
00069 
00077     QPID_MESSAGING_EXTERN void acknowledge(bool sync=false);
00081     QPID_MESSAGING_EXTERN void acknowledge(Message&, bool sync=false);
00087     QPID_MESSAGING_EXTERN void reject(Message&);
00093     QPID_MESSAGING_EXTERN void release(Message&);
00094 
00103     QPID_MESSAGING_EXTERN void sync(bool block=true);
00104 
00111     QPID_MESSAGING_EXTERN uint32_t getReceivable();
00117     QPID_MESSAGING_EXTERN uint32_t getUnsettledAcks();
00126     QPID_MESSAGING_EXTERN bool nextReceiver(Receiver&, Duration timeout=Duration::FOREVER);
00135     QPID_MESSAGING_EXTERN Receiver nextReceiver(Duration timeout=Duration::FOREVER);
00136     
00141     QPID_MESSAGING_EXTERN Sender createSender(const Address& address);
00142     QPID_MESSAGING_EXTERN Sender createSender(const std::string& address);
00143 
00148     QPID_MESSAGING_EXTERN Receiver createReceiver(const Address& address);
00149     QPID_MESSAGING_EXTERN Receiver createReceiver(const std::string& address);
00150 
00155     QPID_MESSAGING_EXTERN Sender getSender(const std::string& name) const;
00160     QPID_MESSAGING_EXTERN Receiver getReceiver(const std::string& name) const;
00165     QPID_MESSAGING_EXTERN Connection getConnection() const;
00166 
00167     QPID_MESSAGING_EXTERN bool hasError();
00168     QPID_MESSAGING_EXTERN void checkError();
00169 
00170 #ifndef SWIG
00171   private:
00172   friend class qpid::messaging::PrivateImplRef<Session>;
00173 #endif
00174 };
00175 }} // namespace qpid::messaging
00176 
00177 #endif  

Qpid C++ API Reference
Generated on Thu Apr 14 2011 18:21:08 for Qpid C++ Client API by doxygen 1.7.3