Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET | Apache Qpid Documentation |
00001 #ifndef _client_Message_h 00002 #define _client_Message_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 <string> 00025 #include "qpid/client/Session.h" 00026 #include "qpid/framing/MessageTransferBody.h" 00027 #include "qpid/framing/TransferContent.h" 00028 #include "qpid/client/ClientImportExport.h" 00029 00030 namespace qpid { 00031 namespace client { 00032 00108 class Message : public framing::TransferContent 00109 { 00110 public: 00115 QPID_CLIENT_EXTERN Message(const std::string& data=std::string(), 00116 const std::string& routingKey=std::string()); 00117 00123 QPID_CLIENT_EXTERN std::string getDestination() const; 00124 00126 QPID_CLIENT_EXTERN bool isRedelivered() const; 00128 QPID_CLIENT_EXTERN void setRedelivered(bool redelivered); 00129 00131 QPID_CLIENT_EXTERN framing::FieldTable& getHeaders(); 00132 00134 QPID_CLIENT_EXTERN const framing::FieldTable& getHeaders() const; 00135 00137 QPID_CLIENT_EXTERN const framing::MessageTransferBody& getMethod() const; 00139 QPID_CLIENT_EXTERN const framing::SequenceNumber& getId() const; 00140 00142 QPID_CLIENT_EXTERN Message(const framing::FrameSet& frameset); 00143 00144 private: 00145 //method and id are only set for received messages: 00146 framing::MessageTransferBody method; 00147 framing::SequenceNumber id; 00148 }; 00149 00150 }} 00151 00152 #endif