00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef _CMS_MESSAGE_H_
00019 #define _CMS_MESSAGE_H_
00020
00021 #include <cms/Config.h>
00022 #include <cms/Destination.h>
00023 #include <cms/DeliveryMode.h>
00024
00025 #include <cms/CMSException.h>
00026 #include <cms/IllegalStateException.h>
00027 #include <cms/MessageFormatException.h>
00028 #include <cms/MessageNotWriteableException.h>
00029
00030 namespace cms {
00031
00088 class CMS_API Message {
00089 public:
00090
00094 static const int DEFAULT_DELIVERY_MODE;
00095
00099 static const int DEFAULT_MSG_PRIORITY;
00100
00104 static const long long DEFAULT_TIME_TO_LIVE;
00105
00112 enum ValueType {
00113 NULL_TYPE = 0,
00114 BOOLEAN_TYPE = 1,
00115 BYTE_TYPE = 2,
00116 CHAR_TYPE = 3,
00117 SHORT_TYPE = 4,
00118 INTEGER_TYPE = 5,
00119 LONG_TYPE = 6,
00120 DOUBLE_TYPE = 7,
00121 FLOAT_TYPE = 8,
00122 STRING_TYPE = 9,
00123 BYTE_ARRAY_TYPE = 10,
00124 UNKNOWN_TYPE = 11
00125 };
00126
00127 public:
00128
00129 virtual ~Message();
00130
00137 virtual Message* clone() const = 0;
00138
00164 virtual void acknowledge() const = 0;
00165
00172 virtual void clearBody() = 0;
00173
00184 virtual void clearProperties() = 0;
00185
00194 virtual std::vector<std::string> getPropertyNames() const = 0;
00195
00205 virtual bool propertyExists(const std::string& name) const = 0;
00206
00220 virtual ValueType getPropertyValueType(const std::string& name) const = 0;
00221
00232 virtual bool getBooleanProperty(const std::string& name) const = 0;
00233
00244 virtual unsigned char getByteProperty(const std::string& name) const = 0;
00245
00256 virtual double getDoubleProperty(const std::string& name) const = 0;
00257
00268 virtual float getFloatProperty(const std::string& name) const = 0;
00269
00280 virtual int getIntProperty(const std::string& name) const = 0;
00281
00292 virtual long long getLongProperty(const std::string& name) const = 0;
00293
00304 virtual short getShortProperty(const std::string& name) const = 0;
00305
00316 virtual std::string getStringProperty(const std::string& name) const = 0;
00317
00329 virtual void setBooleanProperty(const std::string& name, bool value) = 0;
00330
00342 virtual void setByteProperty(const std::string& name, unsigned char value) = 0;
00343
00355 virtual void setDoubleProperty(const std::string& name, double value) = 0;
00356
00367 virtual void setFloatProperty(const std::string& name, float value) = 0;
00368
00380 virtual void setIntProperty(const std::string& name, int value) = 0;
00381
00393 virtual void setLongProperty(const std::string& name, long long value) = 0;
00394
00406 virtual void setShortProperty(const std::string& name, short value) = 0;
00407
00419 virtual void setStringProperty(const std::string& name, const std::string& value) = 0;
00420
00431 virtual std::string getCMSCorrelationID() const = 0;
00432
00469 virtual void setCMSCorrelationID(const std::string& correlationId) = 0;
00470
00478 virtual int getCMSDeliveryMode() const = 0;
00479
00491 virtual void setCMSDeliveryMode(int mode) = 0;
00492
00510 virtual const Destination* getCMSDestination() const = 0;
00511
00523 virtual void setCMSDestination(const Destination* destination) = 0;
00524
00550 virtual long long getCMSExpiration() const = 0;
00551
00563 virtual void setCMSExpiration(long long expireTime) = 0;
00564
00596 virtual std::string getCMSMessageID() const = 0;
00597
00609 virtual void setCMSMessageID(const std::string& id) = 0;
00610
00627 virtual int getCMSPriority() const = 0;
00628
00640 virtual void setCMSPriority(int priority) = 0;
00641
00653 virtual bool getCMSRedelivered() const = 0;
00654
00666 virtual void setCMSRedelivered(bool redelivered) = 0;
00667
00676 virtual const cms::Destination* getCMSReplyTo() const = 0;
00677
00705 virtual void setCMSReplyTo(const cms::Destination* destination) = 0;
00706
00734 virtual long long getCMSTimestamp() const = 0;
00735
00747 virtual void setCMSTimestamp(long long timeStamp) = 0;
00748
00758 virtual std::string getCMSType() const = 0;
00759
00790 virtual void setCMSType(const std::string& type) = 0;
00791
00792 };
00793 }
00794
00795 #endif