activemq-cpp-3.4.0

src/main/activemq/commands/WireFormatInfo.h

Go to the documentation of this file.
00001 
00018 #ifndef _ACTIVEMQ_COMMANDS_WIREFORMATINFO_H_
00019 #define _ACTIVEMQ_COMMANDS_WIREFORMATINFO_H_
00020 
00021 #include <activemq/util/Config.h>
00022 #include <activemq/commands/BaseCommand.h>
00023 #include <activemq/util/PrimitiveMap.h>
00024 #include <activemq/exceptions/ActiveMQException.h>
00025 
00026 #include <vector>
00027 
00028 namespace activemq{
00029 namespace commands{
00030 
00031     class AMQCPP_API WireFormatInfo : public BaseCommand {
00032     private:
00033 
00034         std::vector<unsigned char> magic;
00035         std::vector<unsigned char> marshalledProperties;
00036 
00041         util::PrimitiveMap properties;
00042 
00046         int version;
00047 
00048     public:
00049 
00050         const static unsigned char ID_WIREFORMATINFO = 1;
00051 
00052     public:
00053 
00054         WireFormatInfo();
00055 
00056         virtual ~WireFormatInfo();
00057 
00058         virtual unsigned char getDataStructureType() const;
00059 
00060         virtual DataStructure* cloneDataStructure() const;
00061 
00062         virtual void copyDataStructure( const DataStructure* src );
00063 
00064         virtual std::string toString() const;
00065 
00066         virtual bool equals( const DataStructure* value ) const;
00067 
00068         virtual bool isMarshalAware() const {
00069             return true;
00070         }
00071 
00072         virtual decaf::lang::Pointer<commands::Command> visit(
00073             activemq::state::CommandVisitor* visitor ) throw( exceptions::ActiveMQException );
00074 
00079         int getVersion() const {
00080             return version;
00081         }
00082 
00087         void setVersion( int version ) {
00088             this->version = version;
00089         }
00090 
00095         long long getMaxInactivityDuration() const;
00096 
00101         void setMaxInactivityDuration( long long maxInactivityDuration );
00102 
00107         long long getMaxInactivityDurationInitalDelay() const;
00108 
00113         void setMaxInactivityDurationInitalDelay( long long maxInactivityDurationInitalDelay );
00114 
00119         bool isStackTraceEnabled() const;
00120 
00125         void setStackTraceEnabled( bool stackTraceEnabled );
00126 
00131         bool isTcpNoDelayEnabled() const;
00132 
00137         void setTcpNoDelayEnabled( bool tcpNoDelayEnabled );
00138 
00143         bool isCacheEnabled() const;
00144 
00149         void setCacheEnabled( bool cacheEnabled );
00150 
00155         int getCacheSize() const;
00156 
00161         void setCacheSize( int value );
00162 
00167         bool isTightEncodingEnabled() const;
00168 
00173         void setTightEncodingEnabled( bool tightEncodingEnabled );
00174 
00179         bool isSizePrefixDisabled() const;
00180 
00185         void setSizePrefixDisabled( bool sizePrefixDisabled );
00186 
00191         const std::vector<unsigned char>& getMagic() const {
00192             return magic;
00193         }
00194 
00199         void setMagic( const std::vector<unsigned char>& magic ) {
00200             this->magic = magic;
00201         }
00202 
00207         const std::vector<unsigned char>& getMarshalledProperties() const {
00208             return marshalledProperties;
00209         }
00210 
00217         void setMarshalledProperties( const std::vector<unsigned char>& marshalledProperties ) {
00218             this->marshalledProperties = marshalledProperties;
00219         }
00220 
00225         virtual const util::PrimitiveMap& getProperties() const {
00226             return properties;
00227         }
00228 
00233         virtual util::PrimitiveMap& getProperties() {
00234             return properties;
00235         }
00236 
00241         virtual void setProperties( const util::PrimitiveMap& map ) {
00242             this->properties.copy( map );
00243         }
00244 
00249         bool isValid() const;
00250 
00254         virtual bool isWireFormatInfo() const {
00255             return true;
00256         }
00257 
00258     public:
00259 
00260         virtual void beforeMarshal( wireformat::WireFormat* wireFormat AMQCPP_UNUSED );
00261 
00262         virtual void afterUnmarshal( wireformat::WireFormat* wireFormat AMQCPP_UNUSED );
00263 
00264     };
00265 
00266 }}
00267 
00268 #endif /*_ACTIVEMQ_COMMANDS_WIREFORMATINFO_H_*/