Author: tabish
Date: Thu Oct 21 12:58:06 2010
New Revision: 1025982
URL: http://svn.apache.org/viewvc?rev=1025982&view=rev
Log:
Completes the C API for all cms::MessageProducer methods
Modified:
activemq/activemq-cpp/trunk/activemq-c/src/main/c/CMS_MessageProducer.cpp
activemq/activemq-cpp/trunk/activemq-c/src/main/c/CMS_MessageProducer.h
activemq/activemq-cpp/trunk/activemq-c/src/main/c/cms.h
Modified:
activemq/activemq-cpp/trunk/activemq-c/src/main/c/CMS_MessageProducer.cpp
URL:
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-c/src/main/c/CMS_MessageProducer.cpp?rev=1025982&r1=1025981&r2=1025982&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-c/src/main/c/CMS_MessageProducer.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-c/src/main/c/CMS_MessageProducer.cpp
Thu Oct 21 12:58:06 2010
@@ -91,6 +91,176 @@ cms_status closeProducer(CMS_MessageProd
}
////////////////////////////////////////////////////////////////////////////////
+cms_status setProducerDeliveryMode(CMS_MessageProducer* producer, int mode) {
+
+ cms_status result = CMS_SUCCESS;
+
+ if(producer != NULL) {
+
+ try{
+ producer->producer->setDeliveryMode(mode);
+ } catch(...) {
+ result = CMS_ERROR;
+ }
+ }
+
+ return result;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+cms_status getProducerDeliveryMode(CMS_MessageProducer* producer, int* mode) {
+
+ cms_status result = CMS_SUCCESS;
+
+ if(producer != NULL && mode != NULL) {
+
+ try{
+ *mode = producer->producer->getDeliveryMode();
+ } catch(...) {
+ result = CMS_ERROR;
+ }
+ }
+
+ return result;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+cms_status setProducerDisableMessageID(CMS_MessageProducer* producer, int
enabled) {
+
+ cms_status result = CMS_SUCCESS;
+
+ if(producer != NULL) {
+
+ try{
+ producer->producer->setDisableMessageID(enabled > 0);
+ } catch(...) {
+ result = CMS_ERROR;
+ }
+ }
+
+ return result;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+cms_status getProducerDisableMessageID(CMS_MessageProducer* producer, int*
enabled) {
+
+ cms_status result = CMS_SUCCESS;
+
+ if(producer != NULL && enabled != NULL) {
+
+ try{
+ *enabled = producer->producer->getDisableMessageID();
+ } catch(...) {
+ result = CMS_ERROR;
+ }
+ }
+
+ return result;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+cms_status setProducerDisableMessageTimeStamp(CMS_MessageProducer* producer,
int enabled) {
+
+ cms_status result = CMS_SUCCESS;
+
+ if(producer != NULL) {
+
+ try{
+ producer->producer->setDisableMessageTimeStamp(enabled > 0);
+ } catch(...) {
+ result = CMS_ERROR;
+ }
+ }
+
+ return result;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+cms_status getProducerDisableMessageTimeStamp(CMS_MessageProducer* producer,
int* enabled) {
+
+ cms_status result = CMS_SUCCESS;
+
+ if(producer != NULL && enabled != NULL) {
+
+ try{
+ *enabled = producer->producer->getDisableMessageTimeStamp();
+ } catch(...) {
+ result = CMS_ERROR;
+ }
+ }
+
+ return result;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+cms_status setProducerPriority(CMS_MessageProducer* producer, int priority) {
+
+ cms_status result = CMS_SUCCESS;
+
+ if(producer != NULL) {
+
+ try{
+ producer->producer->setPriority(priority);
+ } catch(...) {
+ result = CMS_ERROR;
+ }
+ }
+
+ return result;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+cms_status getProducerPriority(CMS_MessageProducer* producer, int* priority) {
+
+ cms_status result = CMS_SUCCESS;
+
+ if(producer != NULL && priority != NULL) {
+
+ try{
+ *priority = producer->producer->getPriority();
+ } catch(...) {
+ result = CMS_ERROR;
+ }
+ }
+
+ return result;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+cms_status setProducerTimeToLive(CMS_MessageProducer* producer, int
timeToLive) {
+
+ cms_status result = CMS_SUCCESS;
+
+ if(producer != NULL) {
+
+ try{
+ producer->producer->setTimeToLive(timeToLive);
+ } catch(...) {
+ result = CMS_ERROR;
+ }
+ }
+
+ return result;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+cms_status getProducerTimeToLive(CMS_MessageProducer* producer, int*
timeToLive) {
+
+ cms_status result = CMS_SUCCESS;
+
+ if(producer != NULL && timeToLive != NULL) {
+
+ try{
+ *timeToLive = producer->producer->getTimeToLive();
+ } catch(...) {
+ result = CMS_ERROR;
+ }
+ }
+
+ return result;
+}
+
+////////////////////////////////////////////////////////////////////////////////
cms_status destroyProducer(CMS_MessageProducer* producer) {
cms_status result = CMS_SUCCESS;
Modified:
activemq/activemq-cpp/trunk/activemq-c/src/main/c/CMS_MessageProducer.h
URL:
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-c/src/main/c/CMS_MessageProducer.h?rev=1025982&r1=1025981&r2=1025982&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-c/src/main/c/CMS_MessageProducer.h
(original)
+++ activemq/activemq-cpp/trunk/activemq-c/src/main/c/CMS_MessageProducer.h Thu
Oct 21 12:58:06 2010
@@ -51,6 +51,130 @@ cms_status createProducer(CMS_Session* s
cms_status producerSendWithDefaults(CMS_MessageProducer* producer,
CMS_Message* message);
/**
+ * Sets the delivery mode used by the given producer.
+ *
+ * @param producer
+ * The Message Producer to use for this operation.
+ * @param mode
+ * The new delivery mode to assign to the Producer.
+ *
+ * @return result code indicating the success or failure of the operation.
+ */
+cms_status setProducerDeliveryMode(CMS_MessageProducer* producer, int mode);
+
+/**
+ * Gets the delivery mode used by the given producer.
+ *
+ * @param producer
+ * The Message Producer to use for this operation.
+ * @param mode
+ * The address where the delivery mode value is to be written.
+ *
+ * @return result code indicating the success or failure of the operation.
+ */
+cms_status getProducerDeliveryMode(CMS_MessageProducer* producer, int* mode);
+
+/**
+ * Sets the value of the Producer's disable Message Id setting. A value of
zero indicates
+ * that the disable message Id option is disabled, otherwise its enabled.
+ *
+ * @param producer
+ * The Message Producer to use for this operation.
+ * @param enabled
+ * The new disable message id setting for the given MessageProducer.
+ *
+ * @return result code indicating the success or failure of the operation.
+ */
+cms_status setProducerDisableMessageID(CMS_MessageProducer* producer, int
enabled);
+
+/**
+ * Gets the value of the Producer's disable Message Id setting. A value of
zero indicates
+ * that the disable message Id option is disabled, otherwise its enabled.
+ *
+ * @param producer
+ * The Message Producer to use for this operation.
+ * @param enabled
+ * The address where the disable message id setting is to be written.
+ *
+ * @return result code indicating the success or failure of the operation.
+ */
+cms_status getProducerDisableMessageID(CMS_MessageProducer* producer, int*
enabled);
+
+/**
+ * Sets the value of the Producer's disable time stamp setting. A value of
zero indicates
+ * that the disable time stamp option is disabled, otherwise its enabled.
+ *
+ * @param producer
+ * The Message Producer to use for this operation.
+ * @param enabled
+ * The new disable time stamp setting for the given MessageProducer.
+ *
+ * @return result code indicating the success or failure of the operation.
+ */
+cms_status setProducerDisableMessageTimeStamp(CMS_MessageProducer* producer,
int enabled);
+
+/**
+ * Gets the value of the Producer's disable time stamps setting. A value of
zero indicates
+ * that the disable time stamp option is disabled, otherwise its enabled.
+ *
+ * @param producer
+ * The Message Producer to use for this operation.
+ * @param enabled
+ * The address where the disable time stamp setting is to be written.
+ *
+ * @return result code indicating the success or failure of the operation.
+ */
+cms_status getProducerDisableMessageTimeStamp(CMS_MessageProducer* producer,
int* enabled);
+
+/**
+ * Sets the value of the Producer's Message Priority setting.
+ *
+ * @param producer
+ * The Message Producer to use for this operation.
+ * @param priority
+ * The new message priority setting for the given MessageProducer.
+ *
+ * @return result code indicating the success or failure of the operation.
+ */
+cms_status setProducerPriority(CMS_MessageProducer* producer, int priority);
+
+/**
+ * Gets the value of the Producer's Message Priority setting.
+ *
+ * @param producer
+ * The Message Producer to use for this operation.
+ * @param priority
+ * The address where the message priority setting is to be written.
+ *
+ * @return result code indicating the success or failure of the operation.
+ */
+cms_status getProducerPriority(CMS_MessageProducer* producer, int* priority);
+
+/**
+ * Sets the value of the Producer's Message Time to Live setting.
+ *
+ * @param producer
+ * The Message Producer to use for this operation.
+ * @param priority
+ * The new message time to live for the given MessageProducer.
+ *
+ * @return result code indicating the success or failure of the operation.
+ */
+cms_status setProducerTimeToLive(CMS_MessageProducer* producer, int
timeToLive);
+
+/**
+ * Gets the value of the Producer's Message Time to Live setting.
+ *
+ * @param producer
+ * The Message Producer to use for this operation.
+ * @param priority
+ * The address where the message time to live setting is to be written.
+ *
+ * @return result code indicating the success or failure of the operation.
+ */
+cms_status getProducerTimeToLive(CMS_MessageProducer* producer, int*
timeToLive);
+
+/**
* Closes the MessageProducer.
*
* @param producer
Modified: activemq/activemq-cpp/trunk/activemq-c/src/main/c/cms.h
URL:
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-c/src/main/c/cms.h?rev=1025982&r1=1025981&r2=1025982&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-c/src/main/c/cms.h (original)
+++ activemq/activemq-cpp/trunk/activemq-c/src/main/c/cms.h Thu Oct 21 12:58:06
2010
@@ -79,6 +79,12 @@ typedef enum {
INDIVIDUAL_ACKNOWLEDGE
} ACKNOWLEDGMENT_MODE;
+/** Enum that defines the delivery modes available to a MessageProducer. */
+typedef enum {
+ PERSISTENT = 0,
+ NON_PERSISTENT = 1
+} DELIVERY_MODE;
+
/** Result code returned from wrapper functions to indicate success or
failure. */
typedef int cms_status;