00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef _MessageBuilder_
00022 #define _MessageBuilder_
00023
00024 #include <memory>
00025 #include "qpid/QpidError.h"
00026 #include "BrokerExchange.h"
00027 #include "BrokerMessage.h"
00028 #include "MessageStore.h"
00029 #include "qpid/framing/AMQContentBody.h"
00030 #include "qpid/framing/AMQHeaderBody.h"
00031 #include "qpid/framing/BasicPublishBody.h"
00032 #include "CompletionHandler.h"
00033
00034 namespace qpid {
00035 namespace broker {
00036 class MessageBuilder{
00037 public:
00038 MessageBuilder(CompletionHandler* _handler,
00039 MessageStore* const store = 0,
00040 uint64_t stagingThreshold = 0);
00041 void initialise(Message::shared_ptr& msg);
00042 void setHeader(framing::AMQHeaderBody::shared_ptr& header);
00043 void addContent(framing::AMQContentBody::shared_ptr& content);
00044 Message::shared_ptr getMessage() { return message; }
00045 private:
00046 Message::shared_ptr message;
00047 CompletionHandler* handler;
00048 MessageStore* const store;
00049 const uint64_t stagingThreshold;
00050
00051 void route();
00052 };
00053 }
00054 }
00055
00056
00057 #endif