activemq-cpp-3.3.0
|
00001 /* 00002 * Licensed to the Apache Software Foundation (ASF) under one or more 00003 * contributor license agreements. See the NOTICE file distributed with 00004 * this work for additional information regarding copyright ownership. 00005 * The ASF licenses this file to You under the Apache License, Version 2.0 00006 * (the "License"); you may not use this file except in compliance with 00007 * the License. You may obtain a copy of the License at 00008 * 00009 * http://www.apache.org/licenses/LICENSE-2.0 00010 * 00011 * Unless required by applicable law or agreed to in writing, software 00012 * distributed under the License is distributed on an "AS IS" BASIS, 00013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00014 * See the License for the specific language governing permissions and 00015 * limitations under the License. 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 00106 public: 00107 00108 virtual ~Message(); 00109 00116 virtual Message* clone() const = 0; 00117 00143 virtual void acknowledge() const = 0; 00144 00151 virtual void clearBody() = 0; 00152 00163 virtual void clearProperties() = 0; 00164 00173 virtual std::vector<std::string> getPropertyNames() const = 0; 00174 00184 virtual bool propertyExists( const std::string& name ) const = 0; 00185 00196 virtual bool getBooleanProperty( const std::string& name ) const = 0; 00197 00208 virtual unsigned char getByteProperty( const std::string& name ) const = 0; 00209 00220 virtual double getDoubleProperty( const std::string& name ) const = 0; 00221 00232 virtual float getFloatProperty( const std::string& name ) const = 0; 00233 00244 virtual int getIntProperty( const std::string& name ) const = 0; 00245 00256 virtual long long getLongProperty( const std::string& name ) const = 0; 00257 00268 virtual short getShortProperty( const std::string& name ) const = 0; 00269 00280 virtual std::string getStringProperty( const std::string& name ) const = 0; 00281 00293 virtual void setBooleanProperty( const std::string& name, bool value ) = 0; 00294 00306 virtual void setByteProperty( const std::string& name, unsigned char value ) = 0; 00307 00319 virtual void setDoubleProperty( const std::string& name, double value ) = 0; 00320 00331 virtual void setFloatProperty( const std::string& name, float value ) = 0; 00332 00344 virtual void setIntProperty( const std::string& name, int value ) = 0; 00345 00357 virtual void setLongProperty( const std::string& name, long long value ) = 0; 00358 00370 virtual void setShortProperty( const std::string& name, short value ) = 0; 00371 00383 virtual void setStringProperty( const std::string& name, const std::string& value ) = 0; 00384 00395 virtual std::string getCMSCorrelationID() const = 0; 00396 00433 virtual void setCMSCorrelationID( const std::string& correlationId ) = 0; 00434 00442 virtual int getCMSDeliveryMode() const = 0; 00443 00455 virtual void setCMSDeliveryMode( int mode ) = 0; 00456 00474 virtual const Destination* getCMSDestination() const = 0; 00475 00487 virtual void setCMSDestination( const Destination* destination ) = 0; 00488 00514 virtual long long getCMSExpiration() const = 0; 00515 00527 virtual void setCMSExpiration( long long expireTime ) = 0; 00528 00560 virtual std::string getCMSMessageID() const = 0; 00561 00573 virtual void setCMSMessageID( const std::string& id ) = 0; 00574 00591 virtual int getCMSPriority() const = 0; 00592 00604 virtual void setCMSPriority( int priority ) = 0; 00605 00617 virtual bool getCMSRedelivered() const = 0; 00618 00630 virtual void setCMSRedelivered( bool redelivered ) = 0; 00631 00640 virtual const cms::Destination* getCMSReplyTo() const = 0; 00641 00669 virtual void setCMSReplyTo( const cms::Destination* destination ) = 0; 00670 00698 virtual long long getCMSTimestamp() const = 0; 00699 00711 virtual void setCMSTimestamp( long long timeStamp ) = 0; 00712 00722 virtual std::string getCMSType() const = 0; 00723 00754 virtual void setCMSType( const std::string& type ) = 0; 00755 00756 }; 00757 } 00758 00759 #endif /*_CMS_MESSAGE_H_*/