activemq-cpp-3.3.0

src/main/activemq/commands/ActiveMQBlobMessage.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_COMMANDS_ACTIVEMQBLOBMESSAGE_H_
00019 #define _ACTIVEMQ_COMMANDS_ACTIVEMQBLOBMESSAGE_H_
00020 
00021 // Turn off warning message for ignored exception specification
00022 #ifdef _MSC_VER
00023 #pragma warning( disable : 4290 )
00024 #endif
00025 
00026 #include <activemq/util/Config.h>
00027 #include <activemq/commands/ActiveMQMessageTemplate.h>
00028 #include <cms/Message.h>
00029 #include <string>
00030 #include <memory>
00031 
00032 namespace activemq {
00033 namespace commands {
00034 
00035     class AMQCPP_API ActiveMQBlobMessage :
00036         public ActiveMQMessageTemplate< cms::Message > {
00037 
00038     private:
00039 
00040         std::string remoteBlobUrl;
00041         std::string mimeType;
00042         std::string name;
00043         bool deletedByBroker;
00044 
00045     public:
00046 
00047         static const unsigned char ID_ACTIVEMQBLOBMESSAGE = 29;
00048         static const std::string BINARY_MIME_TYPE;
00049 
00050     private:
00051 
00052         ActiveMQBlobMessage( const ActiveMQBlobMessage& );
00053         ActiveMQBlobMessage& operator= ( const ActiveMQBlobMessage& );
00054 
00055     public:
00056 
00057         ActiveMQBlobMessage();
00058         virtual ~ActiveMQBlobMessage() throw() {}
00059 
00060         virtual unsigned char getDataStructureType() const;
00061 
00062         virtual ActiveMQBlobMessage* cloneDataStructure() const;
00063 
00064         virtual void copyDataStructure( const DataStructure* src );
00065 
00066         virtual std::string toString() const;
00067 
00068         virtual bool equals( const DataStructure* value ) const;
00069 
00070     public:  // cms::Message
00071 
00072         virtual cms::Message* clone() const {
00073             return dynamic_cast<cms::Message*>( this->cloneDataStructure() );
00074         }
00075 
00076     public: // BlobMessage
00077 
00082         std::string getRemoteBlobUrl() const {
00083             return this->remoteBlobUrl;
00084         }
00085 
00090         void setRemoteBlobUrl( const std::string& remoteURL ) {
00091             this->remoteBlobUrl = remoteURL;
00092         }
00093 
00098         std::string getMimeType() const {
00099             return this->mimeType;
00100         }
00101 
00106         void setMimeType( const std::string& mimeType ) {
00107             this->mimeType = mimeType;
00108         }
00109 
00114         std::string getName() const {
00115             return this->name;
00116         }
00117 
00122         void setName( const std::string& name ) {
00123             this->name = name;
00124         }
00125 
00130         bool isDeletedByBroker() const {
00131             return this->deletedByBroker;
00132         }
00133 
00138         void setDeletedByBroker( bool value ) {
00139             this->deletedByBroker = value;
00140         }
00141 
00142     };
00143 
00144 }}
00145 
00146 #endif /*_ACTIVEMQ_COMMANDS_ACTIVEMQBLOBMESSAGE_H_*/