/opt/workspace/qpid/tags/M2/Final/cpp/lib/client/ClientMessage.h

00001 /*
00002  *
00003  * Licensed to the Apache Software Foundation (ASF) under one
00004  * or more contributor license agreements.  See the NOTICE file
00005  * distributed with this work for additional information
00006  * regarding copyright ownership.  The ASF licenses this file
00007  * to you under the Apache License, Version 2.0 (the
00008  * "License"); you may not use this file except in compliance
00009  * with the License.  You may obtain a copy of the License at
00010  * 
00011  *   http://www.apache.org/licenses/LICENSE-2.0
00012  * 
00013  * Unless required by applicable law or agreed to in writing,
00014  * software distributed under the License is distributed on an
00015  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
00016  * KIND, either express or implied.  See the License for the
00017  * specific language governing permissions and limitations
00018  * under the License.
00019  *
00020  */
00021 #include <string>
00022 #include <framing/amqp_framing.h>
00023 
00024 #ifndef _Message_
00025 #define _Message_
00026 
00027 
00028 namespace qpid {
00029 namespace client {
00030 
00037     class Message{
00038         qpid::framing::AMQHeaderBody::shared_ptr header;
00039         std::string data;
00040         bool redelivered;
00041         u_int64_t deliveryTag;
00042 
00043         qpid::framing::BasicHeaderProperties* getHeaderProperties();
00044         Message(qpid::framing::AMQHeaderBody::shared_ptr& header);
00045     public:
00046         Message();
00047         ~Message();
00048         
00055         inline std::string getData(){ return data; }
00062         inline void setData(const std::string& _data){ data = _data; }
00063 
00068         inline bool isRedelivered(){ return redelivered; }
00069         inline void setRedelivered(bool _redelivered){  redelivered = _redelivered; }
00070 
00071         inline u_int64_t getDeliveryTag(){ return deliveryTag; }
00072 
00073         const std::string& getContentType();
00074         const std::string& getContentEncoding();
00075         qpid::framing::FieldTable& getHeaders();
00076         u_int8_t getDeliveryMode();
00077         u_int8_t getPriority();
00078         const std::string& getCorrelationId();
00079         const std::string& getReplyTo();
00080         const std::string& getExpiration();
00081         const std::string& getMessageId();
00082         u_int64_t getTimestamp();
00083         const std::string& getType();
00084         const std::string& getUserId();
00085         const std::string& getAppId();
00086         const std::string& getClusterId();
00087 
00088         void setContentType(const std::string& type);
00089         void setContentEncoding(const std::string& encoding);
00090         void setHeaders(const qpid::framing::FieldTable& headers);
00094         void setDeliveryMode(u_int8_t mode);
00095         void setPriority(u_int8_t priority);
00096         void setCorrelationId(const std::string& correlationId);
00097         void setReplyTo(const std::string& replyTo);
00098         void setExpiration(const std::string&  expiration);
00099         void setMessageId(const std::string& messageId);
00100         void setTimestamp(u_int64_t timestamp);
00101         void setType(const std::string& type);
00102         void setUserId(const std::string& userId);
00103         void setAppId(const std::string& appId);
00104         void setClusterId(const std::string& clusterId);
00105 
00106 
00107         friend class Channel;
00108     };
00109 
00110 }
00111 }
00112 
00113 
00114 #endif

Generated on Mon Nov 26 19:13:17 2007 for Qpid by  doxygen 1.5.1