activemq-cpp-3.4.0

src/main/activemq/wireformat/openwire/utils/MessagePropertyInterceptor.h

Go to the documentation of this file.
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 _ACTIVEMQ_WIREFORMAT_OPENWIRE_UTILS_MESSAGEPROPERTYINTERCEPTOR_H_
00019 #define _ACTIVEMQ_WIREFORMAT_OPENWIRE_UTILS_MESSAGEPROPERTYINTERCEPTOR_H_
00020 
00021 #include <activemq/util/Config.h>
00022 #include <activemq/commands/Message.h>
00023 #include <activemq/util/PrimitiveMap.h>
00024 #include <activemq/exceptions/ActiveMQException.h>
00025 
00026 #include <decaf/lang/exceptions/NullPointerException.h>
00027 
00028 namespace activemq {
00029 namespace wireformat {
00030 namespace openwire {
00031 namespace utils {
00032 
00047     class AMQCPP_API MessagePropertyInterceptor {
00048     private:
00049 
00050         commands::Message* message;
00051         util::PrimitiveMap* properties;
00052 
00053     private:
00054 
00055         MessagePropertyInterceptor( const MessagePropertyInterceptor& );
00056         MessagePropertyInterceptor& operator= ( const MessagePropertyInterceptor& );
00057 
00058     public:
00059 
00069         MessagePropertyInterceptor( commands::Message* message, util::PrimitiveMap* properties );
00070 
00071         virtual ~MessagePropertyInterceptor() throw();
00072 
00078         virtual bool getBooleanProperty( const std::string& name ) const;
00079 
00085         virtual unsigned char getByteProperty( const std::string& name ) const;
00086 
00092         virtual double getDoubleProperty( const std::string& name ) const;
00093 
00099         virtual float getFloatProperty( const std::string& name ) const;
00100 
00106         virtual int getIntProperty( const std::string& name ) const;
00107 
00113         virtual long long getLongProperty( const std::string& name ) const;
00114 
00120         virtual short getShortProperty( const std::string& name ) const;
00121 
00127         virtual std::string getStringProperty( const std::string& name ) const;
00128 
00134         virtual void setBooleanProperty( const std::string& name, bool value );
00135 
00141         virtual void setByteProperty( const std::string& name, unsigned char value );
00142 
00148         virtual void setDoubleProperty( const std::string& name, double value );
00149 
00155         virtual void setFloatProperty( const std::string& name, float value );
00156 
00162         virtual void setIntProperty( const std::string& name, int value );
00163 
00169         virtual void setLongProperty( const std::string& name, long long value );
00170 
00176         virtual void setShortProperty( const std::string& name, short value );
00177 
00183         virtual void setStringProperty( const std::string& name, const std::string& value );
00184 
00185     };
00186 
00187 }}}}
00188 
00189 #endif /* _ACTIVEMQ_WIREFORMAT_OPENWIRE_UTILS_MESSAGEPROPERTYINTERCEPTOR_H_ */