2
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
4
* Copyright (C) 2008-2009 Sun Microsystems
5
* Copyright (c) 2010 Jay Pipes
9
* Jay Pipes <jaypipes@gmail.com>
8
* Jay Pipes <joinfu@sun.com>
11
10
* This program is free software; you can redistribute it and/or modify
12
11
* it under the terms of the GNU General Public License as published by
22
21
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
#ifndef DRIZZLED_PLUGIN_TRANSACTION_APPLIER_H
26
#define DRIZZLED_PLUGIN_TRANSACTION_APPLIER_H
24
#ifndef DRIZZLED_PLUGIN_APPLIER_H
25
#define DRIZZLED_PLUGIN_APPLIER_H
29
* @file Defines the API for a TransactionApplier
28
* @file Defines the API for an Applier
31
* A TransactionApplier applies an event it has received from a TransactionReplicator (via
32
* a replicator's replicate() call, or it has read using a TransactionReader's read()
30
* An Applier applies an event it has received from a Replicator (via
31
* a replicator's replicate() call, or it has read using a Reader's read()
36
#include "drizzled/plugin/plugin.h"
37
#include "drizzled/plugin/replication.h"
44
namespace message { class Transaction; }
35
/* some forward declarations needed */
50
* Base class for appliers of Transaction messages
50
* Base class for appliers of Command messages
52
class TransactionApplier : public Plugin
55
TransactionApplier(const TransactionApplier &);
56
TransactionApplier& operator=(const TransactionApplier &);
58
explicit TransactionApplier(std::string name_arg)
59
: Plugin(name_arg, "TransactionApplier")
62
virtual ~TransactionApplier() {}
64
58
* Apply something to a target.
73
67
* the supplied message to their own controlled memory storage
76
* @param Transaction message to be replicated
78
virtual ReplicationReturnCode apply(Session &in_session,
79
const message::Transaction &to_apply)= 0;
81
static bool addPlugin(TransactionApplier *applier);
82
static void removePlugin(TransactionApplier *applier);
70
* @param Command message to be replicated
72
virtual void apply(drizzled::message::Command *to_apply)= 0;
74
* An applier plugin should override this with its
75
* internal method for determining if it is active or not.
77
virtual bool isActive() {return false;}
85
} /* namespace plugin */
86
} /* namespace drizzled */
80
} /* end namespace drizzled::plugin */
81
} /* end namespace drizzled */
88
#endif /* DRIZZLED_PLUGIN_TRANSACTION_APPLIER_H */
83
#endif /* DRIZZLED_PLUGIN_APPLIER_H */