metaproxy  1.21.0
Classes | Public Member Functions | Private Attributes | List of all members
metaproxy_1::filter::Z3950Client Class Reference

#include <filter_z3950_client.hpp>

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

Classes

class  Assoc
 
class  Rep
 

Public Member Functions

 ~Z3950Client ()
 
 Z3950Client ()
 
void process (metaproxy_1::Package &package) const
 
void configure (const xmlNode *ptr, bool test_only, const char *path)
 

Private Attributes

boost::scoped_ptr< Repm_p
 

Detailed Description

Definition at line 28 of file filter_z3950_client.hpp.

Constructor & Destructor Documentation

◆ ~Z3950Client()

mp::filter::Z3950Client::~Z3950Client ( )

Definition at line 327 of file filter_z3950_client.cpp.

327  {
328 }

◆ Z3950Client()

mp::filter::Z3950Client::Z3950Client ( )

Definition at line 315 of file filter_z3950_client.cpp.

315  : m_p(new yf::Z3950Client::Rep)
316 {
317  m_p->m_connect_timeout_sec = 10;
318  m_p->m_init_timeout_sec = 10;
319  m_p->m_general_timeout_sec = 30;
320  m_p->m_max_sockets = 0;
321  m_p->m_max_sockets_timeout_sec = 15;
322  m_p->m_force_close = false;
323  m_p->m_client_ip = false;
324  m_p->m_bind_host = false;
325 }

References m_p.

Member Function Documentation

◆ configure()

void mp::filter::Z3950Client::configure ( const xmlNode *  ptr,
bool  test_only,
const char *  path 
)

Definition at line 665 of file filter_z3950_client.cpp.

667 {
668  for (ptr = ptr->children; ptr; ptr = ptr->next)
669  {
670  if (ptr->type != XML_ELEMENT_NODE)
671  continue;
672  if (!strcmp((const char *) ptr->name, "timeout"))
673  {
674  m_p->m_general_timeout_sec = mp::xml::get_int(ptr, 30);
675  }
676  else if (!strcmp((const char *) ptr->name, "connect-timeout"))
677  {
678  m_p->m_connect_timeout_sec = mp::xml::get_int(ptr, 10);
679  }
680  else if (!strcmp((const char *) ptr->name, "init-timeout"))
681  {
682  m_p->m_init_timeout_sec = mp::xml::get_int(ptr, 10);
683  }
684  else if (!strcmp((const char *) ptr->name, "max-sockets-timeout"))
685  {
686  m_p->m_max_sockets_timeout_sec = mp::xml::get_int(ptr, 15);
687  }
688  else if (!strcmp((const char *) ptr->name, "default_target"))
689  {
690  m_p->m_default_target = mp::xml::get_text(ptr);
691  }
692  else if (!strcmp((const char *) ptr->name, "force_target"))
693  {
694  m_p->m_force_target = mp::xml::get_text(ptr);
695  }
696  else if (!strcmp((const char *) ptr->name, "max-sockets"))
697  {
698  m_p->m_max_sockets = mp::xml::get_int(ptr, 0);
699  }
700  else if (!strcmp((const char *) ptr->name, "force_close"))
701  {
702  m_p->m_force_close = mp::xml::get_bool(ptr, 0);
703  }
704  else if (!strcmp((const char *) ptr->name, "client_ip"))
705  {
706  m_p->m_client_ip = mp::xml::get_bool(ptr, 0);
707  }
708  else if (!strcmp((const char *) ptr->name, "charset"))
709  {
710  m_p->m_charset = mp::xml::get_text(ptr);
711  }
712  else if (!strcmp((const char *) ptr->name, "bind_host"))
713  {
714  m_p->m_bind_host = mp::xml::get_bool(ptr, 0);
715  }
716  else
717  {
718  throw mp::filter::FilterException("Bad element "
719  + std::string((const char *)
720  ptr->name));
721  }
722  }
723 }

◆ process()

void mp::filter::Z3950Client::process ( metaproxy_1::Package &  package) const

Definition at line 655 of file filter_z3950_client.cpp.

656 {
657  yf::Z3950Client::Assoc *c = m_p->get_assoc(package);
658  if (c)
659  {
660  m_p->send_and_receive(package, c);
661  m_p->release_assoc(package);
662  }
663 }

Member Data Documentation

◆ m_p

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

Definition at line 38 of file filter_z3950_client.hpp.

Referenced by Z3950Client().


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