18 #ifndef _ACTIVEMQ_COMMANDS_ACTIVEMQMESSAGETEMPLATE_H_ 19 #define _ACTIVEMQ_COMMANDS_ACTIVEMQMESSAGETEMPLATE_H_ 44 std::auto_ptr<wireformat::openwire::utils::MessagePropertyInterceptor> propertiesInterceptor;
59 this->getAckHandler()->acknowledgeMessage(
this);
65 this->setReadOnlyBody(
true);
66 this->setReadOnlyProperties(
true);
86 return thisMsgId !=
NULL && otherMsgId !=
NULL && otherMsgId->equals(thisMsgId.
get());
93 this->setContent(std::vector<unsigned char>());
94 this->setReadOnlyBody(
false);
101 this->getMessageProperties().clear();
102 this->setReadOnlyProperties(
false);
109 return getMessageProperties().keySet().toArray();
116 return getMessageProperties().containsKey(name);
162 return this->propertiesInterceptor->getBooleanProperty(name);
171 return this->propertiesInterceptor->getByteProperty(name);
181 return this->propertiesInterceptor->getDoubleProperty(name);
191 return this->propertiesInterceptor->getFloatProperty(name);
201 return this->propertiesInterceptor->getIntProperty(name);
211 return this->propertiesInterceptor->getLongProperty(name);
221 return this->propertiesInterceptor->getShortProperty(name);
231 return this->propertiesInterceptor->getStringProperty(name);
244 failIfReadOnlyProperties();
246 this->propertiesInterceptor->setBooleanProperty(name, value);
257 failIfReadOnlyProperties();
259 this->propertiesInterceptor->setByteProperty(name, value);
270 failIfReadOnlyProperties();
272 this->propertiesInterceptor->setDoubleProperty(name, value);
283 failIfReadOnlyProperties();
285 this->propertiesInterceptor->setFloatProperty(name, value);
296 failIfReadOnlyProperties();
298 this->propertiesInterceptor->setIntProperty(name, value);
309 failIfReadOnlyProperties();
311 this->propertiesInterceptor->setLongProperty(name, value);
322 failIfReadOnlyProperties();
324 this->propertiesInterceptor->setShortProperty(name, value);
335 failIfReadOnlyProperties();
337 this->propertiesInterceptor->setStringProperty(name, value);
343 return this->getCorrelationId();
347 this->setCorrelationId(correlationId);
351 return !this->isPersistent();
359 return dynamic_cast<const cms::Destination*
> (this->getDestination().get());
365 if (destination !=
NULL) {
367 dynamic_cast<ActiveMQDestination*> (destination->
clone())));
369 this->getDestination().reset(
NULL);
376 return this->getExpiration();
380 this->setExpiration(expireTime);
393 this->setMessageId(
id);
398 id->setTextView(value);
399 this->setMessageId(messageId);
404 return this->getPriority();
408 this->setPriority((
unsigned char) priority);
412 return this->getRedeliveryCounter() != 0;
425 if (destination !=
NULL) {
427 dynamic_cast<ActiveMQDestination*> (destination->
clone())));
436 return this->getTimestamp();
440 this->setTimestamp(timeStamp);
444 return this->getType();
454 if (!this->isReadOnlyBody()) {
460 if (this->isReadOnlyBody()) {
466 if (this->isReadOnlyProperties()) {
static cms::MessageFormatException createMessageFormatException(const decaf::lang::Exception &cause)
Definition: Message.h:113
ValueType
Defines the Type Identifiers used to identify the type contained within a specific Message property o...
Definition: Message.h:112
virtual void clearBody()
Definition: ActiveMQMessageTemplate.h:91
Definition: Message.h:119
Definition: Message.h:120
virtual cms::Destination * clone() const =0
Creates a new instance of this destination type that is a copy of this one, and returns it...
virtual std::string getStringProperty(const std::string &name) const
Definition: ActiveMQMessageTemplate.h:228
virtual unsigned char getByteProperty(const std::string &name) const
Definition: ActiveMQMessageTemplate.h:169
virtual void setCMSMessageID(const std::string &value)
Definition: ActiveMQMessageTemplate.h:390
A Destination object encapsulates a provider-specific address.
Definition: Destination.h:39
virtual void setCMSCorrelationID(const std::string &correlationId)
Definition: ActiveMQMessageTemplate.h:346
#define AMQCPP_API
Definition: Config.h:30
This exception must be thrown when a CMS client attempts to write to a read-only message.
Definition: MessageNotWriteableException.h:31
Definition: Message.h:123
virtual std::string getCMSCorrelationID() const
Definition: ActiveMQMessageTemplate.h:342
virtual int getCMSPriority() const
Definition: ActiveMQMessageTemplate.h:403
Definition: PrimitiveValueNode.h:58
Definition: PrimitiveValueNode.h:54
virtual void acknowledge() const
Definition: ActiveMQMessageTemplate.h:57
#define NULL
Definition: Config.h:33
Definition: PrimitiveValueNode.h:51
Definition: PrimitiveValueNode.h:52
Definition: PrimitiveValueNode.h:53
virtual void setCMSDestination(const cms::Destination *destination)
Definition: ActiveMQMessageTemplate.h:362
virtual void clearProperties()
Definition: ActiveMQMessageTemplate.h:99
virtual bool getCMSRedelivered() const
Definition: ActiveMQMessageTemplate.h:411
virtual const cms::Destination * getCMSDestination() const
Definition: ActiveMQMessageTemplate.h:358
virtual long long getLongProperty(const std::string &name) const
Definition: ActiveMQMessageTemplate.h:208
virtual short getShortProperty(const std::string &name) const
Definition: ActiveMQMessageTemplate.h:218
virtual bool propertyExists(const std::string &name) const
Definition: ActiveMQMessageTemplate.h:114
virtual void setBooleanProperty(const std::string &name, bool value)
Definition: ActiveMQMessageTemplate.h:238
virtual void setDoubleProperty(const std::string &name, double value)
Definition: ActiveMQMessageTemplate.h:264
virtual float getFloatProperty(const std::string &name) const
Definition: ActiveMQMessageTemplate.h:188
virtual void setLongProperty(const std::string &name, long long value)
Definition: ActiveMQMessageTemplate.h:303
virtual long long getCMSTimestamp() const
Definition: ActiveMQMessageTemplate.h:435
void failIfReadOnlyBody() const
Definition: ActiveMQMessageTemplate.h:459
virtual void onSend()
Allows derived Message classes to perform tasks before a message is sent.
Definition: ActiveMQMessageTemplate.h:64
virtual void setStringProperty(const std::string &name, const std::string &value)
Definition: ActiveMQMessageTemplate.h:329
virtual std::string getCMSType() const
Definition: ActiveMQMessageTemplate.h:443
Definition: PrimitiveValueNode.h:46
virtual const cms::Destination * getCMSReplyTo() const
Definition: ActiveMQMessageTemplate.h:418
Definition: DataStructure.h:27
Definition: UnsupportedOperationException.h:32
virtual int getIntProperty(const std::string &name) const
Definition: ActiveMQMessageTemplate.h:198
virtual bool equals(const DataStructure *value) const
Compares the DataStructure passed in to this one, and returns if they are equivalent.
Definition: ActiveMQMessageTemplate.h:69
Definition: Message.h:122
virtual long long getCMSExpiration() const
Definition: ActiveMQMessageTemplate.h:375
virtual void setCMSDeliveryMode(int mode)
Definition: ActiveMQMessageTemplate.h:354
virtual void setFloatProperty(const std::string &name, float value)
Definition: ActiveMQMessageTemplate.h:277
virtual void setIntProperty(const std::string &name, int value)
Definition: ActiveMQMessageTemplate.h:290
ActiveMQMessageTemplate()
Definition: ActiveMQMessageTemplate.h:48
virtual void setCMSTimestamp(long long timeStamp)
Definition: ActiveMQMessageTemplate.h:439
virtual int getCMSDeliveryMode() const
Definition: ActiveMQMessageTemplate.h:350
PrimitiveType
Enumeration for the various primitive types.
Definition: PrimitiveValueNode.h:44
CMS API Exception that is the base for all exceptions thrown from CMS classes.
Definition: CMSException.h:50
Definition: Message.h:116
Definition: Message.h:115
Definition: PrimitiveValueNode.h:55
Definition: Message.h:118
virtual void setCMSPriority(int priority)
Definition: ActiveMQMessageTemplate.h:407
virtual void setCMSType(const std::string &type)
Definition: ActiveMQMessageTemplate.h:447
Definition: MessageId.h:49
Definition: DeliveryMode.h:55
virtual std::vector< std::string > getPropertyNames() const
Definition: ActiveMQMessageTemplate.h:107
#define AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
Macro for catching an exception of one type and then re-throwing as a Basic CMSException, good for cases where the method isn't specific about what CMS Exceptions are thrown, bad if you need to throw an exception of MessageNotReadableException for instance.
Definition: CMSExceptionSupport.h:73
PointerType get() const
Gets the real pointer that is contained within this Pointer.
Definition: Pointer.h:188
virtual std::string getCMSMessageID() const
Definition: ActiveMQMessageTemplate.h:383
Definition: Message.h:124
virtual void setByteProperty(const std::string &name, unsigned char value)
Definition: ActiveMQMessageTemplate.h:251
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements...
Definition: CachedConsumer.h:24
virtual void setCMSRedelivered(bool redelivered AMQCPP_UNUSED)
Definition: ActiveMQMessageTemplate.h:415
Definition: PrimitiveValueNode.h:47
virtual void setShortProperty(const std::string &name, short value)
Definition: ActiveMQMessageTemplate.h:316
Definition: PrimitiveValueNode.h:50
Definition: Message.h:121
virtual void setCMSReplyTo(const cms::Destination *destination)
Definition: ActiveMQMessageTemplate.h:422
This exception must be thrown when a CMS client attempts to read a write-only message.
Definition: MessageNotReadableException.h:31
virtual ~ActiveMQMessageTemplate()
Definition: ActiveMQMessageTemplate.h:52
Definition: Message.h:117
Decaf's implementation of a Smart Pointer that is a template on a Type and is Thread Safe if the defa...
Definition: Pointer.h:53
Definition: PrimitiveValueNode.h:48
void failIfWriteOnlyBody() const
Definition: ActiveMQMessageTemplate.h:453
virtual void setCMSExpiration(long long expireTime)
Definition: ActiveMQMessageTemplate.h:379
void failIfReadOnlyProperties() const
Definition: ActiveMQMessageTemplate.h:465
virtual bool getBooleanProperty(const std::string &name) const
Definition: ActiveMQMessageTemplate.h:160
Definition: ActiveMQMessageTemplate.h:41
virtual double getDoubleProperty(const std::string &name) const
Definition: ActiveMQMessageTemplate.h:178
Definition: PrimitiveValueNode.h:49
Definition: Message.h:114
Definition: PrimitiveValueNode.h:45
virtual cms::Message::ValueType getPropertyValueType(const std::string &name) const
Definition: ActiveMQMessageTemplate.h:121