metaproxy  1.13.0
Classes | Public Member Functions | Private Types | Private Attributes | List of all members
metaproxy_1::filter::Multi Class Reference

#include <filter_multi.hpp>

Inheritance diagram for metaproxy_1::filter::Multi:
Inheritance graph
Collaboration diagram for metaproxy_1::filter::Multi:
Collaboration graph

Classes

struct  Backend
 
struct  BackendSet
 
struct  Frontend
 
struct  FrontendSet
 
class  Map
 
class  Rep
 
struct  ScanTermInfo
 

Public Member Functions

 ~Multi ()
 
 Multi ()
 
void process (metaproxy_1::Package &package) const
 
void configure (const xmlNode *ptr, bool test_only, const char *path)
 
void add_map_host2hosts (std::string host, std::list< std::string > hosts, std::string route)
 

Private Types

typedef std::list< ScanTermInfoScanTermInfoList
 
typedef boost::shared_ptr< BackendBackendPtr
 
typedef boost::shared_ptr< FrontendFrontendPtr
 
typedef boost::shared_ptr< Package > PackagePtr
 
typedef std::map< std::string, FrontendSet >::iterator Sets_it
 

Private Attributes

boost::scoped_ptr< Repm_p
 

Detailed Description

Definition at line 32 of file filter_multi.hpp.

Member Typedef Documentation

typedef boost::shared_ptr<Backend> metaproxy_1::filter::Multi::BackendPtr
private

Definition at line 41 of file filter_multi.hpp.

typedef boost::shared_ptr<Frontend> metaproxy_1::filter::Multi::FrontendPtr
private

Definition at line 42 of file filter_multi.hpp.

typedef boost::shared_ptr<Package> metaproxy_1::filter::Multi::PackagePtr
private

Definition at line 43 of file filter_multi.hpp.

Definition at line 39 of file filter_multi.hpp.

typedef std::map<std::string,FrontendSet>::iterator metaproxy_1::filter::Multi::Sets_it
private

Definition at line 44 of file filter_multi.hpp.

Constructor & Destructor Documentation

metaproxy_1::filter::Multi::~Multi ( )
metaproxy_1::filter::Multi::Multi ( )

Member Function Documentation

void metaproxy_1::filter::Multi::add_map_host2hosts ( std::string  host,
std::list< std::string >  hosts,
std::string  route 
)
void metaproxy_1::filter::Multi::configure ( const xmlNode *  ptr,
bool  test_only,
const char *  path 
)

Definition at line 1283 of file filter_multi.cpp.

References m_p, metaproxy_1::filter::round_robin, and metaproxy_1::filter::serve_order.

1285 {
1286  for (ptr = ptr->children; ptr; ptr = ptr->next)
1287  {
1288  if (ptr->type != XML_ELEMENT_NODE)
1289  continue;
1290  if (!strcmp((const char *) ptr->name, "target"))
1291  {
1292  std::string auth;
1293  std::string route = mp::xml::get_route(ptr, auth);
1294  std::string target = mp::xml::get_text(ptr);
1295  if (target.length() == 0)
1296  target = route;
1297  m_p->m_route_patterns.push_back(Multi::Map(target, route, auth));
1298  }
1299  else if (!strcmp((const char *) ptr->name, "hideunavailable"))
1300  {
1301  m_p->m_hide_unavailable = true;
1302  }
1303  else if (!strcmp((const char *) ptr->name, "hideerrors"))
1304  {
1305  m_p->m_hide_errors = true;
1306  }
1307  else if (!strcmp((const char *) ptr->name, "mergetype"))
1308  {
1309  std::string mergetype = mp::xml::get_text(ptr);
1310  if (mergetype == "roundrobin")
1311  m_p->m_merge_type = round_robin;
1312  else if (mergetype == "serveorder")
1313  m_p->m_merge_type = serve_order;
1314  else
1315  throw mp::filter::FilterException
1316  ("Bad mergetype " + mergetype + " in multi filter");
1317 
1318  }
1319  else
1320  {
1321  throw mp::filter::FilterException
1322  ("Bad element "
1323  + std::string((const char *) ptr->name)
1324  + " in multi filter");
1325  }
1326  }
1327 }
boost::scoped_ptr< Rep > m_p
void metaproxy_1::filter::Multi::process ( metaproxy_1::Package &  package) const

Member Data Documentation

boost::scoped_ptr<Rep> metaproxy_1::filter::Multi::m_p
private

Definition at line 55 of file filter_multi.hpp.

Referenced by configure().


The documentation for this class was generated from the following files: