Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET | Apache Qpid Documentation |
00001 #ifndef QPID_CLIENT_SESSIONBASE_H 00002 #define QPID_CLIENT_SESSIONBASE_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 00025 #include "qpid/SessionId.h" 00026 #include "qpid/framing/amqp_structs.h" 00027 #include "qpid/client/Message.h" 00028 #include "qpid/client/Completion.h" 00029 #include "qpid/client/TypedResult.h" 00030 #include "qpid/client/ClientImportExport.h" 00031 #include <string> 00032 00033 namespace qpid { 00034 namespace client { 00035 00036 class Connection; 00037 class SessionImpl; 00038 00039 using std::string; 00040 using framing::Content; 00041 using framing::FieldTable; 00042 using framing::SequenceNumber; 00043 using framing::SequenceSet; 00044 using framing::SequenceNumberSet; 00045 using qpid::SessionId; 00046 using framing::Xid; 00047 00049 enum CreditUnit { MESSAGE_CREDIT=0, BYTE_CREDIT=1, UNLIMITED_CREDIT=0xFFFFFFFF }; 00050 00057 class QPID_CLIENT_CLASS_EXTERN SessionBase_0_10 { 00058 public: 00059 00061 QPID_CLIENT_EXTERN SessionBase_0_10(); 00062 QPID_CLIENT_EXTERN ~SessionBase_0_10(); 00063 00065 QPID_CLIENT_EXTERN SessionId getId() const; 00066 00070 QPID_CLIENT_EXTERN void close(); 00071 00081 QPID_CLIENT_EXTERN void sync(); 00082 00084 QPID_CLIENT_EXTERN uint32_t timeout(uint32_t seconds); 00085 00087 QPID_CLIENT_EXTERN void suspend(); 00088 00090 QPID_CLIENT_EXTERN void resume(Connection); 00091 00093 QPID_CLIENT_EXTERN uint16_t getChannel() const; 00094 00095 QPID_CLIENT_EXTERN void flush(); 00096 QPID_CLIENT_EXTERN void markCompleted(const framing::SequenceSet& ids, bool notifyPeer); 00097 QPID_CLIENT_EXTERN void markCompleted(const framing::SequenceNumber& id, bool cumulative, bool notifyPeer); 00098 QPID_CLIENT_EXTERN void sendCompletion(); 00099 00100 QPID_CLIENT_EXTERN bool isValid() const; 00101 00102 QPID_CLIENT_EXTERN Connection getConnection(); 00103 protected: 00104 boost::shared_ptr<SessionImpl> impl; 00105 friend class SessionBase_0_10Access; 00106 }; 00107 00108 }} // namespace qpid::client 00109 00110 #endif