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 #include <activemq/util/Config.h> 00022 #include <activemq/commands/ActiveMQMessageTemplate.h> 00023 #include <cms/Message.h> 00024 #include <string> 00025 #include <memory> 00026 00027 namespace activemq { 00028 namespace commands { 00029 00030 class AMQCPP_API ActiveMQBlobMessage : 00031 public ActiveMQMessageTemplate< cms::Message > { 00032 00033 private: 00034 00035 std::string remoteBlobUrl; 00036 std::string mimeType; 00037 std::string name; 00038 bool deletedByBroker; 00039 00040 public: 00041 00042 static const unsigned char ID_ACTIVEMQBLOBMESSAGE = 29; 00043 static const std::string BINARY_MIME_TYPE; 00044 00045 private: 00046 00047 ActiveMQBlobMessage( const ActiveMQBlobMessage& ); 00048 ActiveMQBlobMessage& operator= ( const ActiveMQBlobMessage& ); 00049 00050 public: 00051 00052 ActiveMQBlobMessage(); 00053 virtual ~ActiveMQBlobMessage() throw() {} 00054 00055 virtual unsigned char getDataStructureType() const; 00056 00057 virtual ActiveMQBlobMessage* cloneDataStructure() const; 00058 00059 virtual void copyDataStructure( const DataStructure* src ); 00060 00061 virtual std::string toString() const; 00062 00063 virtual bool equals( const DataStructure* value ) const; 00064 00065 public: // cms::Message 00066 00067 virtual cms::Message* clone() const { 00068 ActiveMQBlobMessage* clone = this->cloneDataStructure(); 00069 clone->setReadOnlyBody(false); 00070 clone->setReadOnlyProperties(false); 00071 return dynamic_cast<cms::Message*>(clone); 00072 } 00073 00074 public: // BlobMessage 00075 00080 std::string getRemoteBlobUrl() const { 00081 return this->remoteBlobUrl; 00082 } 00083 00088 void setRemoteBlobUrl( const std::string& remoteURL ) { 00089 this->remoteBlobUrl = remoteURL; 00090 } 00091 00096 std::string getMimeType() const { 00097 return this->mimeType; 00098 } 00099 00104 void setMimeType( const std::string& mimeType ) { 00105 this->mimeType = mimeType; 00106 } 00107 00112 std::string getName() const { 00113 return this->name; 00114 } 00115 00120 void setName( const std::string& name ) { 00121 this->name = name; 00122 } 00123 00128 bool isDeletedByBroker() const { 00129 return this->deletedByBroker; 00130 } 00131 00136 void setDeletedByBroker( bool value ) { 00137 this->deletedByBroker = value; 00138 } 00139 00140 }; 00141 00142 }} 00143 00144 #endif /*_ACTIVEMQ_COMMANDS_ACTIVEMQBLOBMESSAGE_H_*/
1.6.1