summaryrefslogtreecommitdiff
path: root/cpp/lib/broker/BrokerMessageMessage.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2007-02-06 21:38:30 +0000
committerAlan Conway <aconway@apache.org>2007-02-06 21:38:30 +0000
commit877e7ae368d4320bd60ba5750be207a5cac13f43 (patch)
tree9f0777c5e6069b537e13d1c1f88cc08560f47de3 /cpp/lib/broker/BrokerMessageMessage.cpp
parenta0c19714ccb547c401e598189a36573ac750e809 (diff)
downloadqpid-python-877e7ae368d4320bd60ba5750be207a5cac13f43.tar.gz
* cpp/lib/broker/BrokerQueue.cpp (): Centralized exceptions.
* cpp/lib/broker/BrokerAdapter.cpp (consume): Moved exceptions to Queue * cpp/lib/broker/BrokerChannel.cpp (consume): Moved exceptions to Queue * cpp/lib/broker/BrokerMessageBase.cpp: - Added getApplicationHeaders. * cpp/lib/broker/BrokerMessageMessage.cpp: - Fixed exchangeName/destination mix up. - Removed redundant constructor. - Added getApplicationHeaders * cpp/lib/broker/MessageHandlerImpl.cpp: - Added missing acknowledgements - Replaced assert(0) with throw "unimplemented". - Moved exchange existence exceptions to ExchangeRegistry - Handle transfers with references. * cpp/tests/Makefile.am (check): Don't run tests unless all libs built OK. * cpp/tests/python_tests: Re-enabled python tests. Not all passing. * python/tests/message.py (MessageTests.test_get): Replace get-ok with ok. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/qpid.0-9@504305 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/lib/broker/BrokerMessageMessage.cpp')
-rw-r--r--cpp/lib/broker/BrokerMessageMessage.cpp68
1 files changed, 37 insertions, 31 deletions
diff --git a/cpp/lib/broker/BrokerMessageMessage.cpp b/cpp/lib/broker/BrokerMessageMessage.cpp
index 459a0e69e7..d7020b8923 100644
--- a/cpp/lib/broker/BrokerMessageMessage.cpp
+++ b/cpp/lib/broker/BrokerMessageMessage.cpp
@@ -18,11 +18,13 @@
* under the License.
*
*/
+#include "QpidError.h"
#include "BrokerMessageMessage.h"
#include "ChannelAdapter.h"
#include "MessageTransferBody.h"
#include "MessageAppendBody.h"
#include "Reference.h"
+#include "framing/FieldTable.h"
#include <iostream>
@@ -30,24 +32,15 @@ using namespace std;
using namespace qpid::broker;
using namespace qpid::framing;
-MessageMessage::MessageMessage(
- const boost::shared_ptr<MessageTransferBody> _methodBody,
- const std::string& _exchange, const std::string& _routingKey,
- bool _mandatory, bool _immediate) :
- Message(_exchange, _routingKey, _mandatory, _immediate, _methodBody),
- methodBody(_methodBody)
-{
-}
-
MessageMessage::MessageMessage(TransferPtr transfer_)
- : Message(transfer_->getExchange(), transfer_->getRoutingKey(),
+ : Message(transfer_->getDestination(), transfer_->getRoutingKey(),
transfer_->getMandatory(), transfer_->getImmediate(),
transfer_),
transfer(transfer_)
{}
MessageMessage::MessageMessage(TransferPtr transfer_, const Reference& ref)
- : Message(transfer_->getExchange(), transfer_->getRoutingKey(),
+ : Message(transfer_->getDestination(), transfer_->getRoutingKey(),
transfer_->getMandatory(), transfer_->getImmediate(),
transfer_),
transfer(transfer_),
@@ -62,29 +55,29 @@ void MessageMessage::deliver(
{
channel.send(
new MessageTransferBody(channel.getVersion(),
- methodBody->getTicket(),
+ transfer->getTicket(),
consumerTag,
getRedelivered(),
- methodBody->getImmediate(),
- methodBody->getTtl(),
- methodBody->getPriority(),
- methodBody->getTimestamp(),
- methodBody->getDeliveryMode(),
- methodBody->getExpiration(),
+ transfer->getImmediate(),
+ transfer->getTtl(),
+ transfer->getPriority(),
+ transfer->getTimestamp(),
+ transfer->getDeliveryMode(),
+ transfer->getExpiration(),
getExchange(),
getRoutingKey(),
- methodBody->getMessageId(),
- methodBody->getCorrelationId(),
- methodBody->getReplyTo(),
- methodBody->getContentType(),
- methodBody->getContentEncoding(),
- methodBody->getUserId(),
- methodBody->getAppId(),
- methodBody->getTransactionId(),
- methodBody->getSecurityToken(),
- methodBody->getApplicationHeaders(),
- methodBody->getBody(),
- methodBody->getMandatory()));
+ transfer->getMessageId(),
+ transfer->getCorrelationId(),
+ transfer->getReplyTo(),
+ transfer->getContentType(),
+ transfer->getContentEncoding(),
+ transfer->getUserId(),
+ transfer->getAppId(),
+ transfer->getTransactionId(),
+ transfer->getSecurityToken(),
+ transfer->getApplicationHeaders(),
+ transfer->getBody(),
+ transfer->getMandatory()));
}
void MessageMessage::sendGetOk(
@@ -98,11 +91,12 @@ void MessageMessage::sendGetOk(
bool MessageMessage::isComplete()
{
- return true; // FIXME aconway 2007-02-05:
+ return true;
}
u_int64_t MessageMessage::contentSize() const
{
+ THROW_QPID_ERROR(INTERNAL_ERROR, "Unfinished");
return 0; // FIXME aconway 2007-02-05:
}
@@ -110,33 +104,45 @@ qpid::framing::BasicHeaderProperties* MessageMessage::getHeaderProperties()
{
return 0; // FIXME aconway 2007-02-05:
}
+
+const FieldTable& MessageMessage::getApplicationHeaders()
+{
+ THROW_QPID_ERROR(INTERNAL_ERROR, "Unfinished");
+ return transfer->getApplicationHeaders();
+}
bool MessageMessage::isPersistent()
{
+ THROW_QPID_ERROR(INTERNAL_ERROR, "Unfinished");
return false; // FIXME aconway 2007-02-05:
}
const ConnectionToken* const MessageMessage::getPublisher()
{
+ THROW_QPID_ERROR(INTERNAL_ERROR, "Unfinished");
return 0; // FIXME aconway 2007-02-05:
}
u_int32_t MessageMessage::encodedSize()
{
+ THROW_QPID_ERROR(INTERNAL_ERROR, "Unfinished");
return 0; // FIXME aconway 2007-02-05:
}
u_int32_t MessageMessage::encodedHeaderSize()
{
+ THROW_QPID_ERROR(INTERNAL_ERROR, "Unfinished");
return 0; // FIXME aconway 2007-02-05:
}
u_int32_t MessageMessage::encodedContentSize()
{
+ THROW_QPID_ERROR(INTERNAL_ERROR, "Unfinished");
return 0; // FIXME aconway 2007-02-05:
}
u_int64_t MessageMessage::expectedContentSize()
{
+ THROW_QPID_ERROR(INTERNAL_ERROR, "Unfinished");
return 0; // FIXME aconway 2007-02-05:
}