Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 72986 invoked from network); 21 Oct 2010 12:59:07 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 21 Oct 2010 12:59:07 -0000 Received: (qmail 61348 invoked by uid 500); 21 Oct 2010 12:59:07 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 61275 invoked by uid 500); 21 Oct 2010 12:59:05 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 60971 invoked by uid 99); 21 Oct 2010 12:59:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Oct 2010 12:59:04 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Oct 2010 12:59:03 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 8A6CD2388980; Thu, 21 Oct 2010 12:58:06 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1025982 - in /activemq/activemq-cpp/trunk/activemq-c/src/main/c: CMS_MessageProducer.cpp CMS_MessageProducer.h cms.h Date: Thu, 21 Oct 2010 12:58:06 -0000 To: commits@activemq.apache.org From: tabish@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20101021125806.8A6CD2388980@eris.apache.org> 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;