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/framing/ProtocolVersion.h" 00028 #include "qpid/framing/MethodContent.h" 00029 #include "qpid/framing/TransferContent.h" 00030 #include "qpid/client/Completion.h" 00031 #include "qpid/client/ConnectionImpl.h" 00032 #include "qpid/client/Execution.h" 00033 #include "qpid/client/SessionImpl.h" 00034 #include "qpid/client/TypedResult.h" 00035 #include "qpid/shared_ptr.h" 00036 #include "qpid/client/ClientImportExport.h" 00037 #include <string> 00038 00039 namespace qpid { 00040 namespace client { 00041 00042 class Connection; 00043 00044 using std::string; 00045 using framing::Content; 00046 using framing::FieldTable; 00047 using framing::MethodContent; 00048 using framing::SequenceNumber; 00049 using framing::SequenceSet; 00050 using framing::SequenceNumberSet; 00051 using qpid::SessionId; 00052 using framing::Xid; 00053 00055 enum CreditUnit { MESSAGE_CREDIT=0, BYTE_CREDIT=1, UNLIMITED_CREDIT=0xFFFFFFFF }; 00056 00063 class SessionBase_0_10 { 00064 public: 00065 00066 typedef framing::TransferContent DefaultContent; 00067 00069 QPID_CLIENT_EXTERN SessionBase_0_10(); 00070 QPID_CLIENT_EXTERN ~SessionBase_0_10(); 00071 00073 QPID_CLIENT_EXTERN framing::FrameSet::shared_ptr get(); 00074 00076 QPID_CLIENT_EXTERN SessionId getId() const; 00077 00081 QPID_CLIENT_EXTERN void close(); 00082 00092 QPID_CLIENT_EXTERN void sync(); 00093 00095 QPID_CLIENT_EXTERN uint32_t timeout(uint32_t seconds); 00096 00098 QPID_CLIENT_EXTERN void suspend(); 00099 00101 QPID_CLIENT_EXTERN void resume(Connection); 00102 00104 QPID_CLIENT_EXTERN uint16_t getChannel() const; 00105 00106 QPID_CLIENT_EXTERN Execution& getExecution(); 00107 QPID_CLIENT_EXTERN void flush(); 00108 QPID_CLIENT_EXTERN void markCompleted(const framing::SequenceSet& ids, bool notifyPeer); 00109 QPID_CLIENT_EXTERN void markCompleted(const framing::SequenceNumber& id, bool cumulative, bool notifyPeer); 00110 QPID_CLIENT_EXTERN void sendCompletion(); 00111 00112 protected: 00113 boost::shared_ptr<SessionImpl> impl; 00114 friend class SessionBase_0_10Access; 00115 }; 00116 00117 }} // namespace qpid::client 00118 00119 #endif