Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET Apache Qpid Documentation
qpid/framing/MessageProperties.h
Go to the documentation of this file.
00001 #ifndef QPID_FRAMING_MESSAGEPROPERTIES_H
00002 #define QPID_FRAMING_MESSAGEPROPERTIES_H
00003 /*
00004  *
00005  * Licensed to the Apache Software Foundation (ASF) under one
00006  * or more contributor license agreements.  See the NOTICE file
00007  * distributed with this work for additional information
00008  * regarding copyright ownership.  The ASF licenses this file
00009  * to you under the Apache License, Version 2.0 (the
00010  * "License"); you may not use this file except in compliance
00011  * with the License.  You may obtain a copy of the License at
00012  *
00013  *   http://www.apache.org/licenses/LICENSE-2.0
00014  *
00015  * Unless required by applicable law or agreed to in writing,
00016  * software distributed under the License is distributed on an
00017  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
00018  * KIND, either express or implied.  See the License for the
00019  * specific language governing permissions and limitations
00020  * under the License.
00021  *
00022  */
00023 
00028 
00029 
00030 #include "qpid/framing/ReplyTo.h"
00031 
00032 #include <ostream>
00033 #include "qpid/framing/amqp_types_full.h"
00034 #include "qpid/CommonImportExport.h"
00035 
00036 namespace qpid {
00037 namespace framing {
00038 
00039 class QPID_COMMON_CLASS_EXTERN MessageProperties  {
00040     uint64_t contentLength;
00041     Uuid messageId;
00042     std::string correlationId;
00043     ReplyTo replyTo;
00044     std::string contentType;
00045     std::string contentEncoding;
00046     std::string userId;
00047     std::string appId;
00048     FieldTable applicationHeaders;
00049     uint16_t flags;
00050 public:
00051     static const uint16_t TYPE = 1027;
00052     MessageProperties(
00053         uint64_t _contentLength,
00054         const Uuid& _messageId,
00055         const std::string& _correlationId,
00056         const ReplyTo& _replyTo,
00057         const std::string& _contentType,
00058         const std::string& _contentEncoding,
00059         const std::string& _userId,
00060         const std::string& _appId,
00061         const FieldTable& _applicationHeaders) : 
00062         contentLength(_contentLength),
00063         messageId(_messageId),
00064         correlationId(_correlationId),
00065         replyTo(_replyTo),
00066         contentType(_contentType),
00067         contentEncoding(_contentEncoding),
00068         userId(_userId),
00069         appId(_appId),
00070         applicationHeaders(_applicationHeaders),
00071         flags(0){
00072         flags |= (1 << 8);
00073         flags |= (1 << 9);
00074         flags |= (1 << 10);
00075         flags |= (1 << 11);
00076         flags |= (1 << 12);
00077         flags |= (1 << 13);
00078         flags |= (1 << 14);
00079         flags |= (1 << 15);
00080         flags |= (1 << 0);
00081     }
00082     MessageProperties()  : contentLength(0), flags(0) {}
00083     
00084     QPID_COMMON_EXTERN void setContentLength(uint64_t _contentLength);
00085     QPID_COMMON_EXTERN uint64_t getContentLength() const;
00086     QPID_COMMON_EXTERN bool hasContentLength() const;
00087     QPID_COMMON_EXTERN void clearContentLengthFlag();
00088     QPID_COMMON_EXTERN void setMessageId(const Uuid& _messageId);
00089     QPID_COMMON_EXTERN const Uuid& getMessageId() const;
00090     QPID_COMMON_EXTERN bool hasMessageId() const;
00091     QPID_COMMON_EXTERN void clearMessageIdFlag();
00092     QPID_COMMON_EXTERN void setCorrelationId(const std::string& _correlationId);
00093     QPID_COMMON_EXTERN const std::string& getCorrelationId() const;
00094     QPID_COMMON_EXTERN bool hasCorrelationId() const;
00095     QPID_COMMON_EXTERN void clearCorrelationIdFlag();
00096     QPID_COMMON_EXTERN void setReplyTo(const ReplyTo& _replyTo);
00097     QPID_COMMON_EXTERN const ReplyTo& getReplyTo() const;
00098     QPID_COMMON_EXTERN bool hasReplyTo() const;
00099     QPID_COMMON_EXTERN void clearReplyToFlag();
00100     QPID_COMMON_EXTERN void setContentType(const std::string& _contentType);
00101     QPID_COMMON_EXTERN const std::string& getContentType() const;
00102     QPID_COMMON_EXTERN bool hasContentType() const;
00103     QPID_COMMON_EXTERN void clearContentTypeFlag();
00104     QPID_COMMON_EXTERN void setContentEncoding(const std::string& _contentEncoding);
00105     QPID_COMMON_EXTERN const std::string& getContentEncoding() const;
00106     QPID_COMMON_EXTERN bool hasContentEncoding() const;
00107     QPID_COMMON_EXTERN void clearContentEncodingFlag();
00108     QPID_COMMON_EXTERN void setUserId(const std::string& _userId);
00109     QPID_COMMON_EXTERN const std::string& getUserId() const;
00110     QPID_COMMON_EXTERN bool hasUserId() const;
00111     QPID_COMMON_EXTERN void clearUserIdFlag();
00112     QPID_COMMON_EXTERN void setAppId(const std::string& _appId);
00113     QPID_COMMON_EXTERN const std::string& getAppId() const;
00114     QPID_COMMON_EXTERN bool hasAppId() const;
00115     QPID_COMMON_EXTERN void clearAppIdFlag();
00116     QPID_COMMON_EXTERN void setApplicationHeaders(const FieldTable& _applicationHeaders);
00117     QPID_COMMON_EXTERN const FieldTable& getApplicationHeaders() const;
00118     QPID_COMMON_EXTERN FieldTable& getApplicationHeaders();
00119     QPID_COMMON_EXTERN bool hasApplicationHeaders() const;
00120     QPID_COMMON_EXTERN void clearApplicationHeadersFlag();
00121     QPID_COMMON_EXTERN friend std::ostream& operator<<(std::ostream&, const MessageProperties&);
00122     QPID_COMMON_EXTERN void encode(Buffer&) const;
00123     QPID_COMMON_EXTERN void decode(Buffer&, uint32_t=0);
00124     QPID_COMMON_EXTERN void encodeStructBody(Buffer&) const;
00125     QPID_COMMON_EXTERN void decodeStructBody(Buffer&, uint32_t=0);
00126     QPID_COMMON_EXTERN uint32_t encodedSize() const;
00127     QPID_COMMON_EXTERN uint32_t bodySize() const;
00128     QPID_COMMON_EXTERN void print(std::ostream& out) const;
00129 }; /* class MessageProperties */
00130 
00131 }}
00132 #endif  

Qpid C++ API Reference
Generated on Mon Aug 22 2011 for Qpid C++ Client API by doxygen 1.7.4