activemq-cpp-3.8.2
ActiveMQBlobMessage.h
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef _ACTIVEMQ_COMMANDS_ACTIVEMQBLOBMESSAGE_H_
19 #define _ACTIVEMQ_COMMANDS_ACTIVEMQBLOBMESSAGE_H_
20 
21 #include <activemq/util/Config.h>
23 #include <cms/Message.h>
24 #include <string>
25 #include <memory>
26 
27 namespace activemq {
28 namespace commands {
29 
31  public ActiveMQMessageTemplate< cms::Message > {
32 
33  private:
34 
35  std::string remoteBlobUrl;
36  std::string mimeType;
37  std::string name;
38  bool deletedByBroker;
39 
40  public:
41 
42  static const unsigned char ID_ACTIVEMQBLOBMESSAGE = 29;
43  static const std::string BINARY_MIME_TYPE;
44 
45  private:
46 
48  ActiveMQBlobMessage& operator= ( const ActiveMQBlobMessage& );
49 
50  public:
51 
53  virtual ~ActiveMQBlobMessage() throw() {}
54 
55  virtual unsigned char getDataStructureType() const;
56 
57  virtual ActiveMQBlobMessage* cloneDataStructure() const;
58 
59  virtual void copyDataStructure( const DataStructure* src );
60 
61  virtual std::string toString() const;
62 
63  virtual bool equals( const DataStructure* value ) const;
64 
65  public: // cms::Message
66 
67  virtual cms::Message* clone() const {
68  ActiveMQBlobMessage* clone = this->cloneDataStructure();
69  clone->setReadOnlyBody(false);
70  clone->setReadOnlyProperties(false);
71  return dynamic_cast<cms::Message*>(clone);
72  }
73 
74  public: // BlobMessage
75 
80  std::string getRemoteBlobUrl() const {
81  return this->remoteBlobUrl;
82  }
83 
88  void setRemoteBlobUrl( const std::string& remoteURL ) {
89  this->remoteBlobUrl = remoteURL;
90  }
91 
96  std::string getMimeType() const {
97  return this->mimeType;
98  }
99 
104  void setMimeType( const std::string& mimeType ) {
105  this->mimeType = mimeType;
106  }
107 
112  std::string getName() const {
113  return this->name;
114  }
115 
120  void setName( const std::string& name ) {
121  this->name = name;
122  }
123 
128  bool isDeletedByBroker() const {
129  return this->deletedByBroker;
130  }
131 
136  void setDeletedByBroker( bool value ) {
137  this->deletedByBroker = value;
138  }
139 
140  };
141 
142 }}
143 
144 #endif /*_ACTIVEMQ_COMMANDS_ACTIVEMQBLOBMESSAGE_H_*/
static const std::string BINARY_MIME_TYPE
Definition: ActiveMQBlobMessage.h:43
std::string getMimeType() const
Get the Mime Type of the Blob.
Definition: ActiveMQBlobMessage.h:96
std::string getRemoteBlobUrl() const
Get the Remote URL of the Blob.
Definition: ActiveMQBlobMessage.h:80
Root of all messages.
Definition: Message.h:88
#define AMQCPP_API
Definition: Config.h:30
void setMimeType(const std::string &mimeType)
Set the Mime Type of the Blob.
Definition: ActiveMQBlobMessage.h:104
Definition: DataStructure.h:27
void setRemoteBlobUrl(const std::string &remoteURL)
Set the Remote URL of the Blob.
Definition: ActiveMQBlobMessage.h:88
Definition: ActiveMQBlobMessage.h:30
void setReadOnlyBody(bool value)
Set the Read Only State of the Message Content.
Definition: Message.h:270
virtual cms::Message * clone() const
Clone this message exactly, returns a new instance that the caller is required to delete...
Definition: ActiveMQBlobMessage.h:67
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements...
Definition: CachedConsumer.h:24
void setDeletedByBroker(bool value)
Sets the Deleted By Broker flag.
Definition: ActiveMQBlobMessage.h:136
virtual ~ActiveMQBlobMessage()
Definition: ActiveMQBlobMessage.h:53
void setName(const std::string &name)
Sets the Name of the Blob.
Definition: ActiveMQBlobMessage.h:120
std::string getName() const
Gets the Name of the Blob.
Definition: ActiveMQBlobMessage.h:112
Definition: ActiveMQMessageTemplate.h:41
bool isDeletedByBroker() const
Gets if this Blob is deleted by the Broker.
Definition: ActiveMQBlobMessage.h:128
void setReadOnlyProperties(bool value)
Set the Read Only State of the Message Properties.
Definition: Message.h:254