activemq-cpp-3.9.5
Message.h
Go to the documentation of this file.
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#ifndef _CMS_MESSAGE_H_
19#define _CMS_MESSAGE_H_
20
21#include <cms/Config.h>
22#include <cms/Destination.h>
23#include <cms/DeliveryMode.h>
24
25#include <cms/CMSException.h>
29
30namespace cms {
31
89 public:
90
94 static const int DEFAULT_DELIVERY_MODE;
95
99 static const int DEFAULT_MSG_PRIORITY;
100
104 static const long long DEFAULT_TIME_TO_LIVE;
105
126
127 public:
128
129 virtual ~Message();
130
137 virtual Message* clone() const = 0;
138
164 virtual void acknowledge() const = 0;
165
172 virtual void clearBody() = 0;
173
184 virtual void clearProperties() = 0;
185
194 virtual std::vector<std::string> getPropertyNames() const = 0;
195
205 virtual bool propertyExists(const std::string& name) const = 0;
206
220 virtual ValueType getPropertyValueType(const std::string& name) const = 0;
221
232 virtual bool getBooleanProperty(const std::string& name) const = 0;
233
244 virtual unsigned char getByteProperty(const std::string& name) const = 0;
245
256 virtual double getDoubleProperty(const std::string& name) const = 0;
257
268 virtual float getFloatProperty(const std::string& name) const = 0;
269
280 virtual int getIntProperty(const std::string& name) const = 0;
281
292 virtual long long getLongProperty(const std::string& name) const = 0;
293
304 virtual short getShortProperty(const std::string& name) const = 0;
305
316 virtual std::string getStringProperty(const std::string& name) const = 0;
317
329 virtual void setBooleanProperty(const std::string& name, bool value) = 0;
330
342 virtual void setByteProperty(const std::string& name, unsigned char value) = 0;
343
355 virtual void setDoubleProperty(const std::string& name, double value) = 0;
356
367 virtual void setFloatProperty(const std::string& name, float value) = 0;
368
380 virtual void setIntProperty(const std::string& name, int value) = 0;
381
393 virtual void setLongProperty(const std::string& name, long long value) = 0;
394
406 virtual void setShortProperty(const std::string& name, short value) = 0;
407
419 virtual void setStringProperty(const std::string& name, const std::string& value) = 0;
420
431 virtual std::string getCMSCorrelationID() const = 0;
432
469 virtual void setCMSCorrelationID(const std::string& correlationId) = 0;
470
478 virtual int getCMSDeliveryMode() const = 0;
479
491 virtual void setCMSDeliveryMode(int mode) = 0;
492
510 virtual const Destination* getCMSDestination() const = 0;
511
523 virtual void setCMSDestination(const Destination* destination) = 0;
524
550 virtual long long getCMSExpiration() const = 0;
551
563 virtual void setCMSExpiration(long long expireTime) = 0;
564
596 virtual std::string getCMSMessageID() const = 0;
597
609 virtual void setCMSMessageID(const std::string& id) = 0;
610
627 virtual int getCMSPriority() const = 0;
628
640 virtual void setCMSPriority(int priority) = 0;
641
653 virtual bool getCMSRedelivered() const = 0;
654
666 virtual void setCMSRedelivered(bool redelivered) = 0;
667
676 virtual const cms::Destination* getCMSReplyTo() const = 0;
677
705 virtual void setCMSReplyTo(const cms::Destination* destination) = 0;
706
734 virtual long long getCMSTimestamp() const = 0;
735
747 virtual void setCMSTimestamp(long long timeStamp) = 0;
748
758 virtual std::string getCMSType() const = 0;
759
790 virtual void setCMSType(const std::string& type) = 0;
791
792 };
793}
794
795#endif /*_CMS_MESSAGE_H_*/
A Destination object encapsulates a provider-specific address.
Definition Destination.h:39
Root of all messages.
Definition Message.h:88
virtual const cms::Destination * getCMSReplyTo() const =0
Gets the Destination object to which a reply to this message should be sent.
virtual void clearBody()=0
Clears out the body of the message.
virtual void setCMSExpiration(long long expireTime)=0
Sets the message's expiration value.
ValueType
Defines the Type Identifiers used to identify the type contained within a specific Message property o...
Definition Message.h:112
@ LONG_TYPE
Definition Message.h:119
@ DOUBLE_TYPE
Definition Message.h:120
@ FLOAT_TYPE
Definition Message.h:121
@ BYTE_ARRAY_TYPE
Definition Message.h:123
@ BOOLEAN_TYPE
Definition Message.h:114
@ BYTE_TYPE
Definition Message.h:115
@ CHAR_TYPE
Definition Message.h:116
@ INTEGER_TYPE
Definition Message.h:118
@ UNKNOWN_TYPE
Definition Message.h:124
@ STRING_TYPE
Definition Message.h:122
@ SHORT_TYPE
Definition Message.h:117
@ NULL_TYPE
Definition Message.h:113
virtual const Destination * getCMSDestination() const =0
Gets the Destination object for this message.
virtual unsigned char getByteProperty(const std::string &name) const =0
Gets a byte property.
virtual std::vector< std::string > getPropertyNames() const =0
Retrieves the property names.
virtual void setCMSCorrelationID(const std::string &correlationId)=0
Sets the correlation ID for the message.
virtual void setIntProperty(const std::string &name, int value)=0
Sets a int property.
virtual void setCMSMessageID(const std::string &id)=0
Sets the message ID.
static const int DEFAULT_DELIVERY_MODE
The Default delivery mode for Message Producers is PERSISTENT.
Definition Message.h:94
virtual void setFloatProperty(const std::string &name, float value)=0
Sets a float property.
virtual void acknowledge() const =0
Acknowledges all consumed messages of the session of this consumed message.
static const long long DEFAULT_TIME_TO_LIVE
The Default Time to Live for a Message Producer is unlimited, the message will never expire.
Definition Message.h:104
virtual ValueType getPropertyValueType(const std::string &name) const =0
Returns the value type for the given property key.
virtual float getFloatProperty(const std::string &name) const =0
Gets a float property.
virtual short getShortProperty(const std::string &name) const =0
Gets a short property.
virtual void setCMSDestination(const Destination *destination)=0
Sets the Destination object for this message.
virtual std::string getStringProperty(const std::string &name) const =0
Gets a string property.
virtual void setShortProperty(const std::string &name, short value)=0
Sets a short property.
virtual void setCMSTimestamp(long long timeStamp)=0
Sets the message timestamp.
virtual int getCMSPriority() const =0
Gets the message priority level.
virtual void setStringProperty(const std::string &name, const std::string &value)=0
Sets a string property.
virtual bool getCMSRedelivered() const =0
Gets an indication of whether this message is being redelivered.
virtual void setCMSRedelivered(bool redelivered)=0
Specifies whether this message is being redelivered.
virtual bool getBooleanProperty(const std::string &name) const =0
Gets a boolean property.
virtual void setCMSReplyTo(const cms::Destination *destination)=0
Sets the Destination object to which a reply to this message should be sent.
virtual void setCMSPriority(int priority)=0
Sets the Priority Value for this message.
static const int DEFAULT_MSG_PRIORITY
The Default priority assigned to a Message is 4.
Definition Message.h:99
virtual void clearProperties()=0
Clears out the message body.
virtual ~Message()
virtual std::string getCMSMessageID() const =0
The CMSMessageID header field contains a value that uniquely identifies each message sent by a provid...
virtual long long getCMSTimestamp() const =0
Gets the message timestamp.
virtual int getCMSDeliveryMode() const =0
Gets the DeliveryMode for this message.
virtual bool propertyExists(const std::string &name) const =0
Indicates whether or not a given property exists.
virtual void setBooleanProperty(const std::string &name, bool value)=0
Sets a boolean property.
virtual long long getLongProperty(const std::string &name) const =0
Gets a long property.
virtual void setLongProperty(const std::string &name, long long value)=0
Sets a long property.
virtual std::string getCMSType() const =0
Gets the message type identifier supplied by the client when the message was sent.
virtual void setCMSDeliveryMode(int mode)=0
Sets the DeliveryMode for this message.
virtual void setCMSType(const std::string &type)=0
Sets the message type.
virtual double getDoubleProperty(const std::string &name) const =0
Gets a double property.
virtual void setByteProperty(const std::string &name, unsigned char value)=0
Sets a byte property.
virtual long long getCMSExpiration() const =0
Gets the message's expiration value.
virtual Message * clone() const =0
Clone this message exactly, returns a new instance that the caller is required to delete.
virtual void setDoubleProperty(const std::string &name, double value)=0
Sets a double property.
virtual std::string getCMSCorrelationID() const =0
Gets the correlation ID for the message.
virtual int getIntProperty(const std::string &name) const =0
Gets a int property.
#define CMS_API
Definition Config.h:31
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Definition DestinationResolver.h:23