From 4bfec20c393570a81471c644fad6268eed3dba29 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 21 Jul 2011 14:54:43 +0200 Subject: [PATCH] Add path to configure method of filter. This changes the API. --- include/metaproxy/filter.hpp | 3 ++- src/ex_filter_frontend_net.cpp | 2 ++ src/filter.cpp | 7 ------- src/filter_auth_simple.cpp | 3 ++- src/filter_auth_simple.hpp | 3 ++- src/filter_backend_test.cpp | 6 ++++++ src/filter_backend_test.hpp | 2 ++ src/filter_bounce.cpp | 6 ++++++ src/filter_bounce.hpp | 2 ++ src/filter_cgi.cpp | 2 +- src/filter_cgi.hpp | 3 ++- src/filter_cql_to_rpn.cpp | 3 ++- src/filter_cql_to_rpn.hpp | 3 ++- src/filter_dl.cpp | 8 ++++++++ src/filter_frontend_net.cpp | 3 ++- src/filter_frontend_net.hpp | 3 ++- src/filter_http_file.cpp | 3 ++- src/filter_http_file.hpp | 3 ++- src/filter_limit.cpp | 3 ++- src/filter_limit.hpp | 3 ++- src/filter_load_balance.cpp | 3 ++- src/filter_load_balance.hpp | 3 ++- src/filter_log.cpp | 3 ++- src/filter_log.hpp | 4 ++-- src/filter_multi.cpp | 3 ++- src/filter_multi.hpp | 3 ++- src/filter_query_rewrite.cpp | 3 ++- src/filter_query_rewrite.hpp | 3 ++- src/filter_record_transform.cpp | 3 ++- src/filter_record_transform.hpp | 3 ++- src/filter_session_shared.cpp | 3 ++- src/filter_session_shared.hpp | 3 ++- src/filter_sru_to_z3950.cpp | 3 ++- src/filter_sru_to_z3950.hpp | 3 ++- src/filter_template.cpp | 3 ++- src/filter_template.hpp | 3 ++- src/filter_virt_db.cpp | 3 ++- src/filter_virt_db.hpp | 3 ++- src/filter_z3950_client.cpp | 3 ++- src/filter_z3950_client.hpp | 3 ++- src/filter_zeerex_explain.cpp | 3 ++- src/filter_zeerex_explain.hpp | 3 ++- src/filter_zoom.cpp | 3 ++- src/filter_zoom.hpp | 3 ++- src/router_flexml.cpp | 4 ++-- src/test_filter1.cpp | 2 ++ src/test_filter2.cpp | 9 ++++++--- src/test_filter_auth_simple.cpp | 1 + src/test_filter_factory.cpp | 2 ++ src/test_filter_frontend_net.cpp | 1 + src/test_filter_log.cpp | 1 + src/test_filter_multi.cpp | 1 + src/test_filter_query_rewrite.cpp | 2 +- src/test_filter_record_transform.cpp | 2 +- src/test_router_flexml.cpp | 1 + 55 files changed, 118 insertions(+), 52 deletions(-) diff --git a/include/metaproxy/filter.hpp b/include/metaproxy/filter.hpp index a3310ec..b9afe42 100644 --- a/include/metaproxy/filter.hpp +++ b/include/metaproxy/filter.hpp @@ -37,7 +37,8 @@ namespace metaproxy_1 { virtual void process(Package & package) const = 0; /// configuration during filter load - virtual void configure(const xmlNode * ptr, bool test_only); + virtual void configure(const xmlNode * ptr, bool test_only, + const char *path) = 0; virtual void start() const; }; diff --git a/src/ex_filter_frontend_net.cpp b/src/ex_filter_frontend_net.cpp index 565b73d..3a4f00c 100644 --- a/src/ex_filter_frontend_net.cpp +++ b/src/ex_filter_frontend_net.cpp @@ -61,6 +61,8 @@ public: } return package.move(); }; + void configure(const xmlNode * ptr, bool test_only, + const char *path) { }; }; int main(int argc, char **argv) diff --git a/src/filter.cpp b/src/filter.cpp index 1767022..429947d 100644 --- a/src/filter.cpp +++ b/src/filter.cpp @@ -23,17 +23,10 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA namespace mp = metaproxy_1; -void mp::filter::Base::configure(const xmlNode * ptr, bool test_only) -{ - mp::xml::check_empty(ptr); -} - void mp::filter::Base::start() const { - } - /* * Local variables: * c-basic-offset: 4 diff --git a/src/filter_auth_simple.cpp b/src/filter_auth_simple.cpp index a381ced..609deff 100644 --- a/src/filter_auth_simple.cpp +++ b/src/filter_auth_simple.cpp @@ -73,7 +73,8 @@ static void die(std::string s) { throw mp::filter::FilterException(s); } // Read XML config.. Put config info in m_p. -void mp::filter::AuthSimple::configure(const xmlNode * ptr, bool test_only) +void mp::filter::AuthSimple::configure(const xmlNode * ptr, bool test_only, + const char *path) { std::string userRegisterName; std::string targetRegisterName; diff --git a/src/filter_auth_simple.hpp b/src/filter_auth_simple.hpp index be3503e..52c9838 100644 --- a/src/filter_auth_simple.hpp +++ b/src/filter_auth_simple.hpp @@ -31,7 +31,8 @@ namespace metaproxy_1 { public: AuthSimple(); ~AuthSimple(); - void configure(const xmlNode * ptr, bool test_only); + void configure(const xmlNode * ptr, bool test_only, + const char *path); void process(metaproxy_1::Package & package) const; private: void config_userRegister(std::string filename); diff --git a/src/filter_backend_test.cpp b/src/filter_backend_test.cpp index e1f0000..3e96407 100644 --- a/src/filter_backend_test.cpp +++ b/src/filter_backend_test.cpp @@ -389,6 +389,12 @@ void yf::BackendTest::process(Package &package) const m_p->m_sessions.release(package.session()); } +void mp::filter::BackendTest::configure(const xmlNode * ptr, bool test_only, + const char *path) +{ + mp::xml::check_empty(ptr); +} + static mp::filter::Base* filter_creator() { return new mp::filter::BackendTest; diff --git a/src/filter_backend_test.hpp b/src/filter_backend_test.hpp index bae985c..0565e90 100644 --- a/src/filter_backend_test.hpp +++ b/src/filter_backend_test.hpp @@ -31,6 +31,8 @@ namespace metaproxy_1 { ~BackendTest(); BackendTest(); void process(metaproxy_1::Package & package) const; + void configure(const xmlNode * ptr, bool test_only, + const char *path); private: boost::scoped_ptr m_p; }; diff --git a/src/filter_bounce.cpp b/src/filter_bounce.cpp index 2b22813..d23dd63 100644 --- a/src/filter_bounce.cpp +++ b/src/filter_bounce.cpp @@ -100,6 +100,12 @@ void yf::Bounce::process(mp::Package &package) const return; } +void mp::filter::Bounce::configure(const xmlNode * ptr, bool test_only, + const char *path) +{ + mp::xml::check_empty(ptr); +} + static mp::filter::Base* filter_creator() { return new mp::filter::Bounce; diff --git a/src/filter_bounce.hpp b/src/filter_bounce.hpp index 12dda16..cd76575 100644 --- a/src/filter_bounce.hpp +++ b/src/filter_bounce.hpp @@ -34,6 +34,8 @@ namespace metaproxy_1 { Bounce(); ~Bounce(); void process(metaproxy_1::Package & package) const; + void configure(const xmlNode * ptr, bool test_only, + const char *path); }; } } diff --git a/src/filter_cgi.cpp b/src/filter_cgi.cpp index fd844c7..b4d12a6 100644 --- a/src/filter_cgi.cpp +++ b/src/filter_cgi.cpp @@ -146,7 +146,7 @@ void yf::CGI::process(mp::Package &package) const package.move(); } -void yf::CGI::configure(const xmlNode *ptr, bool test_only) +void yf::CGI::configure(const xmlNode *ptr, bool test_only, const char *path) { for (ptr = ptr->children; ptr; ptr = ptr->next) { diff --git a/src/filter_cgi.hpp b/src/filter_cgi.hpp index f9fd202..81f3685 100644 --- a/src/filter_cgi.hpp +++ b/src/filter_cgi.hpp @@ -33,7 +33,8 @@ namespace metaproxy_1 { CGI(); ~CGI(); void process(metaproxy_1::Package & package) const; - void configure(const xmlNode * ptr, bool test_only); + void configure(const xmlNode * ptr, bool test_only, + const char *path); }; } } diff --git a/src/filter_cql_to_rpn.cpp b/src/filter_cql_to_rpn.cpp index 4fa308f..547a9d3 100644 --- a/src/filter_cql_to_rpn.cpp +++ b/src/filter_cql_to_rpn.cpp @@ -60,7 +60,8 @@ yf::CQLtoRPN::~CQLtoRPN() { // must have a destructor because of boost::scoped_ptr } -void yf::CQLtoRPN::configure(const xmlNode *xmlnode, bool test_only) +void yf::CQLtoRPN::configure(const xmlNode *xmlnode, bool test_only, + const char *path) { m_p->configure(xmlnode); } diff --git a/src/filter_cql_to_rpn.hpp b/src/filter_cql_to_rpn.hpp index e668a95..3841815 100644 --- a/src/filter_cql_to_rpn.hpp +++ b/src/filter_cql_to_rpn.hpp @@ -33,7 +33,8 @@ namespace metaproxy_1 { CQLtoRPN(); ~CQLtoRPN(); void process(metaproxy_1::Package & package) const; - void configure(const xmlNode * ptr, bool test_only); + void configure(const xmlNode * ptr, bool test_only, + const char *path); private: }; } diff --git a/src/filter_dl.cpp b/src/filter_dl.cpp index 5c2738f..1a83526 100644 --- a/src/filter_dl.cpp +++ b/src/filter_dl.cpp @@ -28,6 +28,8 @@ namespace metaproxy_1 { class Filter_dl: public mp::filter::Base { public: void process(mp::Package & package) const; + void configure(const xmlNode * ptr, bool test_only, + const char *path); }; } } @@ -36,6 +38,12 @@ void mp::filter::Filter_dl::process(mp::Package & package) const { } +void mp::filter::Filter_dl::configure(const xmlNode * ptr, bool test_only, + const char *path) +{ + mp::xml::check_empty(ptr); +} + static mp::filter::Base* filter_creator() { return new mp::filter::Filter_dl; diff --git a/src/filter_frontend_net.cpp b/src/filter_frontend_net.cpp index f19e6d4..715eb58 100644 --- a/src/filter_frontend_net.cpp +++ b/src/filter_frontend_net.cpp @@ -385,7 +385,8 @@ void mp::filter::FrontendNet::process(Package &package) const delete tt; } -void mp::filter::FrontendNet::configure(const xmlNode * ptr, bool test_only) +void mp::filter::FrontendNet::configure(const xmlNode * ptr, bool test_only, + const char *path) { if (!ptr || !ptr->children) { diff --git a/src/filter_frontend_net.hpp b/src/filter_frontend_net.hpp index 14a0b1b..ee91e54 100644 --- a/src/filter_frontend_net.hpp +++ b/src/filter_frontend_net.hpp @@ -36,7 +36,8 @@ namespace metaproxy_1 { FrontendNet(); ~FrontendNet(); void process(metaproxy_1::Package & package) const; - void configure(const xmlNode * ptr, bool test_only); + void configure(const xmlNode * ptr, bool test_only, + const char *path); public: /// set ports void set_ports(std::vector &ports); diff --git a/src/filter_http_file.cpp b/src/filter_http_file.cpp index e021b03..863fe66 100644 --- a/src/filter_http_file.cpp +++ b/src/filter_http_file.cpp @@ -218,7 +218,8 @@ void yf::HttpFile::process(mp::Package &package) const package.move(); } -void mp::filter::HttpFile::configure(const xmlNode * ptr, bool test_only) +void mp::filter::HttpFile::configure(const xmlNode * ptr, bool test_only, + const char *path) { for (ptr = ptr->children; ptr; ptr = ptr->next) { diff --git a/src/filter_http_file.hpp b/src/filter_http_file.hpp index c1a2930..e57ce92 100644 --- a/src/filter_http_file.hpp +++ b/src/filter_http_file.hpp @@ -34,7 +34,8 @@ namespace metaproxy_1 { HttpFile(); ~HttpFile(); void process(metaproxy_1::Package & package) const; - void configure(const xmlNode * ptr, bool test_only); + void configure(const xmlNode * ptr, bool test_only, + const char *path); }; } } diff --git a/src/filter_limit.cpp b/src/filter_limit.cpp index 5b64c36..a165bba 100644 --- a/src/filter_limit.cpp +++ b/src/filter_limit.cpp @@ -68,7 +68,8 @@ yf::Limit::~Limit() { // must have a destructor because of boost::scoped_ptr } -void yf::Limit::configure(const xmlNode *xmlnode, bool test_only) +void yf::Limit::configure(const xmlNode *xmlnode, bool test_only, + const char *path) { m_p->configure(xmlnode); } diff --git a/src/filter_limit.hpp b/src/filter_limit.hpp index 7a3d5e3..9a4622f 100644 --- a/src/filter_limit.hpp +++ b/src/filter_limit.hpp @@ -33,7 +33,8 @@ namespace metaproxy_1 { Limit(); ~Limit(); void process(metaproxy_1::Package & package) const; - void configure(const xmlNode * ptr, bool test_only); + void configure(const xmlNode * ptr, bool test_only, + const char *path); }; } } diff --git a/src/filter_load_balance.cpp b/src/filter_load_balance.cpp index 183acf8..b7e112f 100644 --- a/src/filter_load_balance.cpp +++ b/src/filter_load_balance.cpp @@ -97,7 +97,8 @@ yf::LoadBalance::~LoadBalance() { // must have a destructor because of boost::scoped_ptr } -void yf::LoadBalance::configure(const xmlNode *xmlnode, bool test_only) +void yf::LoadBalance::configure(const xmlNode *xmlnode, bool test_only, + const char *path) { m_p->configure(xmlnode); } diff --git a/src/filter_load_balance.hpp b/src/filter_load_balance.hpp index 5909fec..68a5c28 100644 --- a/src/filter_load_balance.hpp +++ b/src/filter_load_balance.hpp @@ -33,7 +33,8 @@ namespace metaproxy_1 { LoadBalance(); ~LoadBalance(); void process(metaproxy_1::Package & package) const; - void configure(const xmlNode * ptr, bool test_only); + void configure(const xmlNode * ptr, bool test_only, + const char *path); }; } } diff --git a/src/filter_log.cpp b/src/filter_log.cpp index 2e128f3..76b6cc5 100644 --- a/src/filter_log.cpp +++ b/src/filter_log.cpp @@ -109,7 +109,8 @@ yf::Log::~Log() { // must have a destructor because of boost::scoped_ptr } -void yf::Log::configure(const xmlNode *xmlnode, bool test_only) +void yf::Log::configure(const xmlNode *xmlnode, bool test_only, + const char *path) { m_p->configure(xmlnode); } diff --git a/src/filter_log.hpp b/src/filter_log.hpp index 2c5d0d9..90ab9dd 100644 --- a/src/filter_log.hpp +++ b/src/filter_log.hpp @@ -32,8 +32,8 @@ namespace metaproxy_1 { Log(const std::string &x); ~Log(); void process(metaproxy_1::Package & package) const; - void configure(const xmlNode * ptr, bool test_only); - //class LFile; + void configure(const xmlNode * ptr, bool test_only, + const char *path); private: class Impl; boost::scoped_ptr m_p; diff --git a/src/filter_multi.cpp b/src/filter_multi.cpp index 9349be2..33de6a4 100644 --- a/src/filter_multi.cpp +++ b/src/filter_multi.cpp @@ -1235,7 +1235,8 @@ void yf::Multi::process(mp::Package &package) const m_p->release_frontend(package); } -void mp::filter::Multi::configure(const xmlNode * ptr, bool test_only) +void mp::filter::Multi::configure(const xmlNode * ptr, bool test_only, + const char *path) { for (ptr = ptr->children; ptr; ptr = ptr->next) { diff --git a/src/filter_multi.hpp b/src/filter_multi.hpp index 7f3bb6c..1aae80f 100644 --- a/src/filter_multi.hpp +++ b/src/filter_multi.hpp @@ -46,7 +46,8 @@ namespace metaproxy_1 { ~Multi(); Multi(); void process(metaproxy_1::Package & package) const; - void configure(const xmlNode * ptr, bool test_only); + void configure(const xmlNode * ptr, bool test_only, + const char *path); void add_map_host2hosts(std::string host, std::list hosts, std::string route); diff --git a/src/filter_query_rewrite.cpp b/src/filter_query_rewrite.cpp index 1ad7d52..1d405a5 100644 --- a/src/filter_query_rewrite.cpp +++ b/src/filter_query_rewrite.cpp @@ -71,7 +71,8 @@ void yf::QueryRewrite::process(mp::Package &package) const m_p->process(package); } -void mp::filter::QueryRewrite::configure(const xmlNode *ptr, bool test_only) +void mp::filter::QueryRewrite::configure(const xmlNode *ptr, bool test_only, + const char *path) { m_p->configure(ptr); } diff --git a/src/filter_query_rewrite.hpp b/src/filter_query_rewrite.hpp index a28ef2e..4a3b9c4 100644 --- a/src/filter_query_rewrite.hpp +++ b/src/filter_query_rewrite.hpp @@ -33,7 +33,8 @@ namespace metaproxy_1 { QueryRewrite(); ~QueryRewrite(); void process(metaproxy_1::Package & package) const; - void configure(const xmlNode * ptr, bool test_only); + void configure(const xmlNode * ptr, bool test_only, + const char *path); }; } } diff --git a/src/filter_record_transform.cpp b/src/filter_record_transform.cpp index f95d040..8e43e1e 100644 --- a/src/filter_record_transform.cpp +++ b/src/filter_record_transform.cpp @@ -56,7 +56,8 @@ yf::RecordTransform::~RecordTransform() { // must have a destructor because of boost::scoped_ptr } -void yf::RecordTransform::configure(const xmlNode *xmlnode, bool test_only) +void yf::RecordTransform::configure(const xmlNode *xmlnode, bool test_only, + const char *path) { m_p->configure(xmlnode); } diff --git a/src/filter_record_transform.hpp b/src/filter_record_transform.hpp index e3a2016..33eef61 100644 --- a/src/filter_record_transform.hpp +++ b/src/filter_record_transform.hpp @@ -33,7 +33,8 @@ namespace metaproxy_1 { RecordTransform(); ~RecordTransform(); void process(metaproxy_1::Package & package) const; - void configure(const xmlNode * ptr, bool test_only); + void configure(const xmlNode * ptr, bool test_only, + const char *path); }; } } diff --git a/src/filter_session_shared.cpp b/src/filter_session_shared.cpp index dbbd0fc..c243dea 100644 --- a/src/filter_session_shared.cpp +++ b/src/filter_session_shared.cpp @@ -1162,7 +1162,8 @@ void yf::SessionShared::process(mp::Package &package) const m_p->release_frontend(package); } -void yf::SessionShared::configure(const xmlNode *ptr, bool test_only) +void yf::SessionShared::configure(const xmlNode *ptr, bool test_only, + const char *path) { for (ptr = ptr->children; ptr; ptr = ptr->next) { diff --git a/src/filter_session_shared.hpp b/src/filter_session_shared.hpp index dffd26e..73d96ae 100644 --- a/src/filter_session_shared.hpp +++ b/src/filter_session_shared.hpp @@ -52,7 +52,8 @@ namespace metaproxy_1 { ~SessionShared(); SessionShared(); void process(metaproxy_1::Package & package) const; - void configure(const xmlNode * ptr, bool test_only); + void configure(const xmlNode * ptr, bool test_only, + const char *path); void start() const; private: boost::scoped_ptr m_p; diff --git a/src/filter_sru_to_z3950.cpp b/src/filter_sru_to_z3950.cpp index a95f40b..cf81f0b 100644 --- a/src/filter_sru_to_z3950.cpp +++ b/src/filter_sru_to_z3950.cpp @@ -116,7 +116,8 @@ yf::SRUtoZ3950::~SRUtoZ3950() { // must have a destructor because of boost::scoped_ptr } -void yf::SRUtoZ3950::configure(const xmlNode *xmlnode, bool test_only) +void yf::SRUtoZ3950::configure(const xmlNode *xmlnode, bool test_only, + const char *path) { m_p->configure(xmlnode); } diff --git a/src/filter_sru_to_z3950.hpp b/src/filter_sru_to_z3950.hpp index 993e66b..7d8b8eb 100644 --- a/src/filter_sru_to_z3950.hpp +++ b/src/filter_sru_to_z3950.hpp @@ -32,7 +32,8 @@ namespace metaproxy_1 { public: SRUtoZ3950(); ~SRUtoZ3950(); - void configure(const xmlNode *xmlnode, bool test_only); + void configure(const xmlNode *xmlnode, bool test_only, + const char *path); void process(metaproxy_1::Package & package) const; }; } diff --git a/src/filter_template.cpp b/src/filter_template.cpp index 42ffc44..f85491f 100644 --- a/src/filter_template.cpp +++ b/src/filter_template.cpp @@ -52,7 +52,8 @@ yf::Template::~Template() { // must have a destructor because of boost::scoped_ptr } -void yf::Template::configure(const xmlNode *xmlnode, bool test_only) +void yf::Template::configure(const xmlNode *xmlnode, bool test_only, + const char *path) { m_p->configure(xmlnode); } diff --git a/src/filter_template.hpp b/src/filter_template.hpp index 2e2ef6f..1b61e98 100644 --- a/src/filter_template.hpp +++ b/src/filter_template.hpp @@ -33,7 +33,8 @@ namespace metaproxy_1 { Template(); ~Template(); void process(metaproxy_1::Package & package) const; - void configure(const xmlNode * ptr, bool test_only); + void configure(const xmlNode * ptr, bool test_only, + const char *path); }; } } diff --git a/src/filter_virt_db.cpp b/src/filter_virt_db.cpp index 93ed3d0..808538d 100644 --- a/src/filter_virt_db.cpp +++ b/src/filter_virt_db.cpp @@ -867,7 +867,8 @@ void yf::VirtualDB::process(mp::Package &package) const m_p->release_frontend(package); } -void mp::filter::VirtualDB::configure(const xmlNode * ptr, bool test_only) +void mp::filter::VirtualDB::configure(const xmlNode * ptr, bool test_only, + const char *path) { for (ptr = ptr->children; ptr; ptr = ptr->next) { diff --git a/src/filter_virt_db.hpp b/src/filter_virt_db.hpp index e4cb028..1293640 100644 --- a/src/filter_virt_db.hpp +++ b/src/filter_virt_db.hpp @@ -40,7 +40,8 @@ namespace metaproxy_1 { ~VirtualDB(); VirtualDB(); void process(metaproxy_1::Package & package) const; - void configure(const xmlNode * ptr, bool test_only); + void configure(const xmlNode * ptr, bool test_only, + const char *path); void add_map_db2targets(std::string db, std::list targets, std::string route); diff --git a/src/filter_z3950_client.cpp b/src/filter_z3950_client.cpp index 06f58e1..0dcadcb 100644 --- a/src/filter_z3950_client.cpp +++ b/src/filter_z3950_client.cpp @@ -457,7 +457,8 @@ void yf::Z3950Client::process(Package &package) const } } -void yf::Z3950Client::configure(const xmlNode *ptr, bool test_only) +void yf::Z3950Client::configure(const xmlNode *ptr, bool test_only, + const char *path) { for (ptr = ptr->children; ptr; ptr = ptr->next) { diff --git a/src/filter_z3950_client.hpp b/src/filter_z3950_client.hpp index 48ebabc..5d296ab 100644 --- a/src/filter_z3950_client.hpp +++ b/src/filter_z3950_client.hpp @@ -32,7 +32,8 @@ namespace metaproxy_1 { ~Z3950Client(); Z3950Client(); void process(metaproxy_1::Package & package) const; - void configure(const xmlNode * ptr, bool test_only); + void configure(const xmlNode * ptr, bool test_only, + const char *path); private: boost::scoped_ptr m_p; }; diff --git a/src/filter_zeerex_explain.cpp b/src/filter_zeerex_explain.cpp index 2f6160b..db50b83 100644 --- a/src/filter_zeerex_explain.cpp +++ b/src/filter_zeerex_explain.cpp @@ -61,7 +61,8 @@ yf::ZeeRexExplain::~ZeeRexExplain() { // must have a destructor because of boost::scoped_ptr } -void yf::ZeeRexExplain::configure(const xmlNode *xmlnode, bool test_only) +void yf::ZeeRexExplain::configure(const xmlNode *xmlnode, bool test_only, + const char *path) { m_p->configure(xmlnode); } diff --git a/src/filter_zeerex_explain.hpp b/src/filter_zeerex_explain.hpp index 23f93e9..d0ac223 100644 --- a/src/filter_zeerex_explain.hpp +++ b/src/filter_zeerex_explain.hpp @@ -32,7 +32,8 @@ namespace metaproxy_1 { public: ZeeRexExplain(); ~ZeeRexExplain(); - void configure(const xmlNode *xmlnode, bool test_only); + void configure(const xmlNode *xmlnode, bool test_only, + const char *path); void process(metaproxy_1::Package & package) const; }; } diff --git a/src/filter_zoom.cpp b/src/filter_zoom.cpp index 76992fa..b625898 100644 --- a/src/filter_zoom.cpp +++ b/src/filter_zoom.cpp @@ -154,7 +154,8 @@ yf::Zoom::~Zoom() { // must have a destructor because of boost::scoped_ptr } -void yf::Zoom::configure(const xmlNode *xmlnode, bool test_only) +void yf::Zoom::configure(const xmlNode *xmlnode, bool test_only, + const char *path) { m_p->configure(xmlnode, test_only); } diff --git a/src/filter_zoom.hpp b/src/filter_zoom.hpp index d10f28b..7c73a70 100644 --- a/src/filter_zoom.hpp +++ b/src/filter_zoom.hpp @@ -39,7 +39,8 @@ namespace metaproxy_1 { Zoom(); ~Zoom(); void process(metaproxy_1::Package & package) const; - void configure(const xmlNode * ptr, bool test_only); + void configure(const xmlNode * ptr, bool test_only, + const char *path); }; } } diff --git a/src/router_flexml.cpp b/src/router_flexml.cpp index 7aca757..6fb36e7 100644 --- a/src/router_flexml.cpp +++ b/src/router_flexml.cpp @@ -127,7 +127,7 @@ void mp::RouterFleXML::Rep::parse_xml_filters(xmlDocPtr doc, } mp::filter::Base* filter_base = m_factory->create(type_value); - filter_base->configure(node, test_only); + filter_base->configure(node, test_only, file_include_path); if (m_id_filter_map.find(id_value) != m_id_filter_map.end()) throw mp::XMLError("Filter " + id_value + " already defined"); @@ -220,7 +220,7 @@ void mp::RouterFleXML::Rep::parse_xml_routes(xmlDocPtr doc, } mp::filter::Base* filter_base = m_factory->create(type_value); - filter_base->configure(node3, test_only); + filter_base->configure(node3, test_only, file_include_path); route.m_list.push_back( boost::shared_ptr(filter_base)); diff --git a/src/test_filter1.cpp b/src/test_filter1.cpp index 088a1ec..07a1942 100644 --- a/src/test_filter1.cpp +++ b/src/test_filter1.cpp @@ -32,6 +32,8 @@ namespace mp = metaproxy_1; class TFilter: public mp::filter::Base { public: void process(mp::Package & package) const {}; + void configure(const xmlNode * ptr, bool test_only, + const char *path) { }; }; diff --git a/src/test_filter2.cpp b/src/test_filter2.cpp index ed33113..40f0e5f 100644 --- a/src/test_filter2.cpp +++ b/src/test_filter2.cpp @@ -41,7 +41,7 @@ public: void process(mp::Package & package) const { package.move(); }; - void configure(const xmlNode* ptr, bool test_only); + void configure(const xmlNode* ptr, bool test_only, const char *path); int get_constant() const { return m_constant; }; private: const xmlNode *m_ptr; @@ -49,7 +49,8 @@ private: }; -void FilterConstant::configure(const xmlNode* ptr, bool test_only) +void FilterConstant::configure(const xmlNode* ptr, bool test_only, + const char *path) { m_ptr = ptr; @@ -93,6 +94,8 @@ public: void process(mp::Package & package) const { package.move(); }; + void configure(const xmlNode * ptr, bool test_only, + const char *path) { }; }; @@ -170,7 +173,7 @@ BOOST_AUTO_TEST_CASE( testfilter2_2 ) { xmlNodePtr root_element = xmlDocGetRootElement(doc); - base->configure(root_element, true); + base->configure(root_element, true, 0); xmlFreeDoc(doc); } diff --git a/src/test_filter_auth_simple.cpp b/src/test_filter_auth_simple.cpp index 5c44f06..9872e2e 100644 --- a/src/test_filter_auth_simple.cpp +++ b/src/test_filter_auth_simple.cpp @@ -51,6 +51,7 @@ public: } package.move(); }; + void configure(const xmlNode* ptr, bool test_only, const char *path) {}; }; diff --git a/src/test_filter_factory.cpp b/src/test_filter_factory.cpp index 2ecba64..7735d50 100644 --- a/src/test_filter_factory.cpp +++ b/src/test_filter_factory.cpp @@ -36,6 +36,7 @@ namespace mp = metaproxy_1; class XFilter: public mp::filter::Base { public: void process(mp::Package & package) const; + void configure(const xmlNode* ptr, bool test_only, const char *path) {}; }; void XFilter::process(mp::Package & package) const @@ -51,6 +52,7 @@ static mp::filter::Base* xfilter_creator(){ class YFilter: public mp::filter::Base { public: void process(mp::Package & package) const; + void configure(const xmlNode* ptr, bool test_only, const char *path) {}; }; void YFilter::process(mp::Package & package) const diff --git a/src/test_filter_frontend_net.cpp b/src/test_filter_frontend_net.cpp index 945a242..15aec92 100644 --- a/src/test_filter_frontend_net.cpp +++ b/src/test_filter_frontend_net.cpp @@ -52,6 +52,7 @@ public: } return package.move(); }; + void configure(const xmlNode* ptr, bool test_only, const char *path) {}; }; diff --git a/src/test_filter_log.cpp b/src/test_filter_log.cpp index 796b9b5..27aad45 100644 --- a/src/test_filter_log.cpp +++ b/src/test_filter_log.cpp @@ -51,6 +51,7 @@ public: } return package.move(); }; + void configure(const xmlNode* ptr, bool test_only, const char *path) {}; }; diff --git a/src/test_filter_multi.cpp b/src/test_filter_multi.cpp index fcffab5..731210d 100644 --- a/src/test_filter_multi.cpp +++ b/src/test_filter_multi.cpp @@ -51,6 +51,7 @@ public: } package.move(); }; + void configure(const xmlNode* ptr, bool test_only, const char *path) {}; }; diff --git a/src/test_filter_query_rewrite.cpp b/src/test_filter_query_rewrite.cpp index 3145aaf..d63850f 100644 --- a/src/test_filter_query_rewrite.cpp +++ b/src/test_filter_query_rewrite.cpp @@ -213,7 +213,7 @@ BOOST_AUTO_TEST_CASE( test_filter_query_rewrite3 ) // creating and configuring filter mp::filter::QueryRewrite f_query_rewrite; - f_query_rewrite.configure(root_element, true); + f_query_rewrite.configure(root_element, true, 0); // remeber to free XML DOM xmlFreeDoc(doc); diff --git a/src/test_filter_record_transform.cpp b/src/test_filter_record_transform.cpp index e8b051c..264cf40 100644 --- a/src/test_filter_record_transform.cpp +++ b/src/test_filter_record_transform.cpp @@ -103,7 +103,7 @@ BOOST_AUTO_TEST_CASE( test_filter_record_transform_3 ) // creating and configuring filter mp::filter::RecordTransform f_rec_trans; - f_rec_trans.configure(root_element, true); + f_rec_trans.configure(root_element, true, 0); // remeber to free XML DOM xmlFreeDoc(doc); diff --git a/src/test_router_flexml.cpp b/src/test_router_flexml.cpp index 0059ab1..4ec826a 100644 --- a/src/test_router_flexml.cpp +++ b/src/test_router_flexml.cpp @@ -38,6 +38,7 @@ public: void process(mp::Package & package) const {}; TFilter() { tfilter_ref++; }; ~TFilter() { tfilter_ref--; }; + void configure(const xmlNode* ptr, bool test_only, const char *path) {}; }; static mp::filter::Base* filter_creator() -- 1.7.10.4