00001 /* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*- 00002 * vim:expandtab:shiftwidth=2:tabstop=2:smarttab: 00003 * 00004 * Copyright (C) 2010 Marcus Eriksson 00005 * 00006 * Authors: 00007 * 00008 * Marcus Eriksson <krummas@gmail.com> 00009 * 00010 * This program is free software; you can redistribute it and/or modify 00011 * it under the terms of the GNU General Public License as published by 00012 * the Free Software Foundation; either version 2 of the License, or 00013 * (at your option) any later version. 00014 * 00015 * This program is distributed in the hope that it will be useful, 00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 * GNU General Public License for more details. 00019 * 00020 * You should have received a copy of the GNU General Public License 00021 * along with this program; if not, write to the Free Software 00022 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00023 */ 00024 00025 00026 #pragma once 00027 00028 #include <drizzled/replication_services.h> 00029 #include <drizzled/plugin/transaction_applier.h> 00030 #include <string> 00031 #include "rabbitmq_handler.h" 00032 00033 namespace drizzle_plugin 00034 { 00035 00045 class RabbitMQLog : 00046 public drizzled::plugin::TransactionApplier 00047 { 00048 private: 00049 RabbitMQHandler* _rabbitMQHandler; 00050 const std::string _exchange; 00051 const std::string _routingkey; 00052 public: 00053 00063 RabbitMQLog(const std::string &name, 00064 RabbitMQHandler* mqHandler); 00065 ~RabbitMQLog(); 00066 00076 drizzled::plugin::ReplicationReturnCode 00077 apply(drizzled::Session &session, const drizzled::message::Transaction &to_apply); 00078 00079 }; 00080 00081 } /* namespace drizzle_plugin */ 00082