Author: tabish
Date: Sun Dec 14 13:37:35 2008
New Revision: 726538
URL: http://svn.apache.org/viewvc?rev=726538&view=rev
Log:
http://issues.apache.org/activemq/browse/AMQCPP-216
Add attributes to ActiveMQBlobMessage.
Also fix some typos in the API docs.
Modified:
activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQBlobMessage.cpp
activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQBlobMessage.h
activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQBytesMessage.h
activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.h
activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQMessage.h
activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQTextMessage.h
Modified:
activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQBlobMessage.cpp
URL:
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQBlobMessage.cpp?rev=726538&r1=726537&r2=726538&view=diff
==============================================================================
---
activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQBlobMessage.cpp
(original)
+++
activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQBlobMessage.cpp
Sun Dec 14 13:37:35 2008
@@ -24,7 +24,11 @@
using namespace activemq::connector::openwire::commands;
////////////////////////////////////////////////////////////////////////////////
-ActiveMQBlobMessage::ActiveMQBlobMessage() {
+const std::string ActiveMQBlobMessage::BINARY_MIME_TYPE =
"application/octet-stream";
+
+////////////////////////////////////////////////////////////////////////////////
+ActiveMQBlobMessage::ActiveMQBlobMessage() :
+ mimeType( ActiveMQBlobMessage::BINARY_MIME_TYPE ), deletedByBroker( false
) {
}
////////////////////////////////////////////////////////////////////////////////
Modified:
activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQBlobMessage.h
URL:
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQBlobMessage.h?rev=726538&r1=726537&r2=726538&view=diff
==============================================================================
---
activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQBlobMessage.h
(original)
+++
activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQBlobMessage.h
Sun Dec 14 13:37:35 2008
@@ -24,17 +24,29 @@
#endif
#include <activemq/util/Config.h>
-#include <activemq/connector/openwire/commands/ActiveMQMessage.h>
+#include <activemq/connector/openwire/commands/ActiveMQMessageBase.h>
+#include <cms/Message.h>
+#include <string>
namespace activemq {
namespace connector {
namespace openwire {
namespace commands {
- class AMQCPP_API ActiveMQBlobMessage : public ActiveMQMessage {
+ class AMQCPP_API ActiveMQBlobMessage :
+ public ActiveMQMessageBase< cms::Message > {
+
+ private:
+
+ std::string remoteBlobUrl;
+ std::string mimeType;
+ std::string name;
+ bool deletedByBroker;
+
public:
- const static unsigned char ID_ACTIVEMQBLOBMESSAGE = 29;
+ static const unsigned char ID_ACTIVEMQBLOBMESSAGE = 29;
+ static const std::string BINARY_MIME_TYPE;
public:
@@ -60,18 +72,109 @@
* @return src - Source Object
*/
virtual void copyDataStructure( const DataStructure* src ) {
- ActiveMQMessage::copyDataStructure( src );
+ ActiveMQMessageBase<cms::Message>::copyDataStructure( src );
+ }
+
+ /**
+ * Returns a string containing the information for this DataStructure
+ * such as its type and value of its elements.
+ * @return formatted string useful for debugging.
+ */
+ virtual std::string toString() const{
+ std::ostringstream stream;
+
+ stream << "Begin Class = ActiveMQBlobMessage" << std::endl;
+ stream << ActiveMQMessageBase<cms::Message>::toString();
+ stream << "End Class = ActiveMQBlobMessage" << std::endl;
+
+ return stream.str();
+ }
+
+ /**
+ * Compares the DataStructure passed in to this one, and returns if
+ * they are equivalent. Equivalent here means that they are of the
+ * same type, and that each element of the objects are the same.
+ * @returns true if DataStructure's are Equal.
+ */
+ virtual bool equals( const DataStructure* value ) const {
+ return ActiveMQMessageBase<cms::Message>::equals( value );
+ }
+
+ public: // cms::Message
+
+ /**
+ * Clone this message exactly, returns a new instance that the
+ * caller is required to delete.
+ * @return new copy of this message
+ */
+ virtual cms::Message* clone() const {
+ return dynamic_cast<cms::Message*>( this->cloneDataStructure() );
+ }
+
+ public: // BlobMessage
+
+ /**
+ * Get the Remote URL of the Blob.
+ * @returns string from of the Remote Blob URL.
+ */
+ std::string getRemoteBlobURL() const {
+ return this->remoteBlobUrl;
}
- public: // ActiveMQMessage
+ /**
+ * Set the Remote URL of the Blob
+ * @param remoteURL - String form of the Remote URL.
+ */
+ void setRemoteBlobURL( const std::string& remoteURL ) {
+ this->remoteBlobUrl = remoteURL;
+ }
+
+ /**
+ * Get the Mime Type of the Blob.
+ * @returns string holding the MIME Type.
+ */
+ std::string getMimeType() const {
+ return this->mimeType;
+ }
+
+ /**
+ * Set the Mime Type of the Blob
+ * @param mimeType - String holding the MIME Type.
+ */
+ void setMimeType( const std::string& mimeType ) {
+ this->mimeType = mimeType;
+ }
+
+ /**
+ * Gets the Name of the Blob.
+ * @returns string name of the Blob.
+ */
+ std::string getName() const {
+ return this->name;
+ }
+
+ /**
+ * Sets the Name of the Blob.
+ * @param name - Name of the Blob.
+ */
+ void setName( const std::string& name ) {
+ this->name = name;
+ }
+
+ /**
+ * Gets if this Blob is deleted by the Broker.
+ * @return true if the Blob is deleted by the Broker.
+ */
+ bool isDeletedByBroker() const {
+ return this->deletedByBroker;
+ }
/**
- * Returns if this message has expired, meaning that its
- * Expiration time has elapsed.
- * @returns true if message is expired.
+ * Sets the Deleted By Broker flag.
+ * @param value - set the Delete by broker flag to value.
*/
- virtual bool isExpired() const {
- return false;
+ void setDeletedByBroker( bool value ) {
+ this->deletedByBroker = value;
}
};
Modified:
activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQBytesMessage.h
URL:
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQBytesMessage.h?rev=726538&r1=726537&r2=726538&view=diff
==============================================================================
---
activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQBytesMessage.h
(original)
+++
activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQBytesMessage.h
Sun Dec 14 13:37:35 2008
@@ -83,7 +83,7 @@
stream << "Begin Class = ActiveMQBytesMessage" << std::endl;
stream << ActiveMQMessageBase<cms::BytesMessage>::toString();
- stream << "Begin Class = ActiveMQBytesMessage" << std::endl;
+ stream << "End Class = ActiveMQBytesMessage" << std::endl;
return stream.str();
}
Modified:
activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.h
URL:
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.h?rev=726538&r1=726537&r2=726538&view=diff
==============================================================================
---
activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.h
(original)
+++
activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.h
Sun Dec 14 13:37:35 2008
@@ -56,9 +56,9 @@
virtual unsigned char getDataStructureType() const;
/**
- * Determine if this object is aware of marshalling and should have
- * its before and after marshalling methods called. Defaults to false.
- * @returns true if aware of marshalling
+ * Determine if this object is aware of marshaling and should have
+ * its before and after marshaling methods called. Defaults to false.
+ * @returns true if aware of marshaling
*/
virtual bool isMarshalAware() const {
return true;
@@ -108,7 +108,7 @@
stream << "Begin Class = ActiveMQMapMessage" << std::endl;
stream << ActiveMQMessageBase<cms::MapMessage>::toString();
- stream << "Begin Class = ActiveMQMapMessage" << std::endl;
+ stream << "End Class = ActiveMQMapMessage" << std::endl;
return stream.str();
}
@@ -126,7 +126,7 @@
public: // CMS Message
/**
- * Clonse this message exactly, returns a new instance that the
+ * Clone this message exactly, returns a new instance that the
* caller is required to delete.
* @return new copy of this message
*/
@@ -330,7 +330,7 @@
/**
* Fetches a reference to this objects PrimitiveMap, if one needs
- * to be created or unmarshalled, this will perform the correct steps.
+ * to be created or unmarshaled, this will perform the correct steps.
* @returns reference to a PrimtiveMap.
*/
util::PrimitiveMap& getMap() throw (
decaf::lang::exceptions::NullPointerException );
Modified:
activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQMessage.h
URL:
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQMessage.h?rev=726538&r1=726537&r2=726538&view=diff
==============================================================================
---
activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQMessage.h
(original)
+++
activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQMessage.h
Sun Dec 14 13:37:35 2008
@@ -88,7 +88,7 @@
public: // cms::Message
/**
- * Clonse this message exactly, returns a new instance that the
+ * Clone this message exactly, returns a new instance that the
* caller is required to delete.
* @return new copy of this message
*/
Modified:
activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQTextMessage.h
URL:
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQTextMessage.h?rev=726538&r1=726537&r2=726538&view=diff
==============================================================================
---
activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQTextMessage.h
(original)
+++
activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQTextMessage.h
Sun Dec 14 13:37:35 2008
@@ -77,7 +77,7 @@
stream << "Begin Class = ActiveMQTextMessage" << std::endl;
stream << ActiveMQMessageBase<cms::TextMessage>::toString();
- stream << "Begin Class = ActiveMQTextMessage" << std::endl;
+ stream << "End Class = ActiveMQTextMessage" << std::endl;
return stream.str();
}
@@ -95,7 +95,7 @@
public: // CMS Message
/**
- * Clonse this message exactly, returns a new instance that the
+ * Clone this message exactly, returns a new instance that the
* caller is required to delete.
* @return new copy of this message
*/