00001 #ifndef QPID_CLUSTER_DUMPCLIENT_H
00002 #define QPID_CLUSTER_DUMPCLIENT_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include "ClusterMap.h"
00026 #include "qpid/client/Connection.h"
00027 #include "qpid/client/AsyncSession.h"
00028 #include "qpid/broker/SemanticState.h"
00029 #include "qpid/sys/Runnable.h"
00030 #include <boost/shared_ptr.hpp>
00031
00032
00033 namespace qpid {
00034
00035 class Url;
00036
00037 namespace broker {
00038
00039 class Broker;
00040 class Queue;
00041 class Exchange;
00042 class QueueBindings;
00043 class QueueBinding;
00044 class QueuedMessage;
00045 class SessionHandler;
00046
00047 }
00048
00049 namespace cluster {
00050
00051 class Cluster;
00052 class Connection;
00053 class ClusterMap;
00054
00058 class DumpClient : public sys::Runnable {
00059 public:
00060 DumpClient(const MemberId& dumper, const MemberId& dumpee, const Url&,
00061 broker::Broker& donor, const ClusterMap& map, const std::vector<boost::intrusive_ptr<Connection> >& ,
00062 const boost::function<void()>& done,
00063 const boost::function<void(const std::exception&)>& fail);
00064
00065 ~DumpClient();
00066 void dump();
00067 void run();
00068
00069 private:
00070 void dumpQueue(const boost::shared_ptr<broker::Queue>&);
00071 void dumpExchange(const boost::shared_ptr<broker::Exchange>&);
00072 void dumpMessage(const broker::QueuedMessage&);
00073 void dumpBinding(const std::string& queue, const broker::QueueBinding& binding);
00074 void dumpConnection(const boost::intrusive_ptr<Connection>& connection);
00075 void dumpSession(broker::SessionHandler& s);
00076 void dumpConsumer(broker::SemanticState::ConsumerImpl*);
00077
00078 private:
00079 MemberId dumperId;
00080 MemberId dumpeeId;
00081 Url dumpeeUrl;
00082 broker::Broker& dumperBroker;
00083 ClusterMap map;
00084 std::vector<boost::intrusive_ptr<Connection> > connections;
00085 client::Connection connection, shadowConnection;
00086 client::AsyncSession session, shadowSession;
00087 boost::function<void()> done;
00088 boost::function<void(const std::exception& e)> failed;
00089 };
00090
00091 }}
00092
00093 #endif