00001 #ifndef QPID_FRAMING_FILEPROPERTIES_H
00002 #define QPID_FRAMING_FILEPROPERTIES_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00028
00029
00030
00031 #include <ostream>
00032 #include "qpid/framing/amqp_types_full.h"
00033
00034 namespace qpid {
00035 namespace framing {
00036
00037 class FileProperties {
00038 string contentType;
00039 string contentEncoding;
00040 FieldTable headers;
00041 uint8_t priority;
00042 string replyTo;
00043 string messageId;
00044 string filename;
00045 uint64_t timestamp;
00046 string clusterId;
00047 uint16_t flags;
00048 public:
00049 static const uint16_t TYPE = 2305;
00050 FileProperties(
00051 const string& _contentType,
00052 const string& _contentEncoding,
00053 const FieldTable& _headers,
00054 uint8_t _priority,
00055 const string& _replyTo,
00056 const string& _messageId,
00057 const string& _filename,
00058 uint64_t _timestamp,
00059 const string& _clusterId) :
00060 contentType(_contentType),
00061 contentEncoding(_contentEncoding),
00062 headers(_headers),
00063 priority(_priority),
00064 replyTo(_replyTo),
00065 messageId(_messageId),
00066 filename(_filename),
00067 timestamp(_timestamp),
00068 clusterId(_clusterId),
00069 flags(0){
00070 flags |= (1 << 8);
00071 flags |= (1 << 9);
00072 flags |= (1 << 10);
00073 flags |= (1 << 11);
00074 flags |= (1 << 12);
00075 flags |= (1 << 13);
00076 flags |= (1 << 14);
00077 flags |= (1 << 15);
00078 flags |= (1 << 0);
00079 }
00080 FileProperties() : priority(0), timestamp(0), flags(0) {}
00081
00082 void setContentType(const string& _contentType);
00083 const string& getContentType() const;
00084 bool hasContentType() const;
00085 void clearContentTypeFlag();
00086 void setContentEncoding(const string& _contentEncoding);
00087 const string& getContentEncoding() const;
00088 bool hasContentEncoding() const;
00089 void clearContentEncodingFlag();
00090 void setHeaders(const FieldTable& _headers);
00091 const FieldTable& getHeaders() const;
00092 FieldTable& getHeaders();
00093 bool hasHeaders() const;
00094 void clearHeadersFlag();
00095 void setPriority(uint8_t _priority);
00096 uint8_t getPriority() const;
00097 bool hasPriority() const;
00098 void clearPriorityFlag();
00099 void setReplyTo(const string& _replyTo);
00100 const string& getReplyTo() const;
00101 bool hasReplyTo() const;
00102 void clearReplyToFlag();
00103 void setMessageId(const string& _messageId);
00104 const string& getMessageId() const;
00105 bool hasMessageId() const;
00106 void clearMessageIdFlag();
00107 void setFilename(const string& _filename);
00108 const string& getFilename() const;
00109 bool hasFilename() const;
00110 void clearFilenameFlag();
00111 void setTimestamp(uint64_t _timestamp);
00112 uint64_t getTimestamp() const;
00113 bool hasTimestamp() const;
00114 void clearTimestampFlag();
00115 void setClusterId(const string& _clusterId);
00116 const string& getClusterId() const;
00117 bool hasClusterId() const;
00118 void clearClusterIdFlag();
00119 friend std::ostream& operator<<(std::ostream&, const FileProperties&);
00120 void encode(Buffer&) const;
00121 void decode(Buffer&, uint32_t=0);
00122 void encodeStructBody(Buffer&) const;
00123 void decodeStructBody(Buffer&, uint32_t=0);
00124 uint32_t size() const;
00125 uint32_t bodySize() const;
00126 void print(std::ostream& out) const;
00127 };
00128
00129 }}
00130 #endif