activemq-cpp-3.6.0
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 // Turn off warning message for ignored exception specification
22 #ifdef _MSC_VER
23 #pragma warning( disable : 4290 )
24 #endif
25 
26 #include <activemq/util/Config.h>
28 #include <cms/Message.h>
29 #include <string>
30 #include <memory>
31 
32 namespace activemq {
33 namespace commands {
34 
36  public ActiveMQMessageTemplate< cms::Message > {
37 
38  private:
39 
40  std::string remoteBlobUrl;
41  std::string mimeType;
42  std::string name;
43  bool deletedByBroker;
44 
45  public:
46 
47  static const unsigned char ID_ACTIVEMQBLOBMESSAGE = 29;
48  static const std::string BINARY_MIME_TYPE;
49 
50  private:
51 
53  ActiveMQBlobMessage& operator= ( const ActiveMQBlobMessage& );
54 
55  public:
56 
58  virtual ~ActiveMQBlobMessage() throw() {}
59 
60  virtual unsigned char getDataStructureType() const;
61 
62  virtual ActiveMQBlobMessage* cloneDataStructure() const;
63 
64  virtual void copyDataStructure( const DataStructure* src );
65 
66  virtual std::string toString() const;
67 
68  virtual bool equals( const DataStructure* value ) const;
69 
70  public: // cms::Message
71 
72  virtual cms::Message* clone() const {
73  ActiveMQBlobMessage* clone = this->cloneDataStructure();
74  clone->setReadOnlyBody(false);
75  clone->setReadOnlyProperties(false);
76  return dynamic_cast<cms::Message*>(clone);
77  }
78 
79  public: // BlobMessage
80 
85  std::string getRemoteBlobUrl() const {
86  return this->remoteBlobUrl;
87  }
88 
93  void setRemoteBlobUrl( const std::string& remoteURL ) {
94  this->remoteBlobUrl = remoteURL;
95  }
96 
101  std::string getMimeType() const {
102  return this->mimeType;
103  }
104 
109  void setMimeType( const std::string& mimeType ) {
110  this->mimeType = mimeType;
111  }
112 
117  std::string getName() const {
118  return this->name;
119  }
120 
125  void setName( const std::string& name ) {
126  this->name = name;
127  }
128 
133  bool isDeletedByBroker() const {
134  return this->deletedByBroker;
135  }
136 
141  void setDeletedByBroker( bool value ) {
142  this->deletedByBroker = value;
143  }
144 
145  };
146 
147 }}
148 
149 #endif /*_ACTIVEMQ_COMMANDS_ACTIVEMQBLOBMESSAGE_H_*/