#include <Inquirer.h>

Inheritance diagram for Snmp::Inquirer:
Collaboration diagram for Snmp::Inquirer:

Public Types

typedef CbcPointer< AsyncJobPointer
 

Public Member Functions

 Inquirer (const Request &aRequest, const Ipc::StrandCoords &coords)
 
virtual void callException (const std::exception &e)
 called when the job throws during an async call More...
 
bool canBeCalled (AsyncCall &call) const
 whether we can be called More...
 
void callStart (AsyncCall &call)
 
virtual void callEnd ()
 called right after the called job method More...
 
virtual void * toCbdata ()=0
 

Static Public Member Functions

static void HandleRemoteAck (const Response &response)
 finds and calls the right Inquirer upon strand's response More...
 
static Pointer Start (AsyncJob *job)
 starts a freshly created job (i.e., makes the job asynchronous) More...
 

Protected Types

typedef std::map< unsigned int,
AsyncCall::Pointer
RequestsMap
 maps request->id to Inquirer::handleRemoteAck callback More...
 

Protected Member Functions

virtual void start ()
 called by AsyncStart; do not call directly More...
 
virtual bool doneAll () const
 whether positive goal has been reached More...
 
virtual void cleanup ()
 closes our copy of the client connection socket More...
 
virtual void handleException (const std::exception &e)
 do specific exception handling More...
 
virtual void sendResponse ()
 send response to client More...
 
virtual bool aggregate (Ipc::Response::Pointer aResponse)
 perform aggregating of responses and returns true if need to continue More...
 
virtual void swanSong ()
 
virtual const char * status () const
 internal cleanup; do not call directly More...
 
virtual void inquire ()
 inquire the next strand More...
 
void deleteThis (const char *aReason)
 
void mustStop (const char *aReason)
 
bool done () const
 the job is destroyed in callEnd() when done() More...
 

Protected Attributes

Request::Pointer request
 cache manager request received from client More...
 
Ipc::StrandCoords strands
 all strands we want to query, in order More...
 
Ipc::StrandCoords::const_iterator pos
 strand we should query now More...
 
const double timeout
 number of seconds to wait for strand response More...
 
const char * stopReason
 reason for forcing done() to be true More...
 
const char * typeName
 kid (leaf) class name, for debugging More...
 
AsyncCall::Pointer inCall
 the asynchronous call being handled, if any More...
 
const InstanceId< AsyncJobid
 job identifier More...
 

Static Protected Attributes

static RequestsMap TheRequestsMap
 pending strand requests More...
 
static unsigned int LastRequestId = 0
 last requestId used More...
 

Private Member Functions

 CBDATA_CLASS (Inquirer)
 
void noteCommClosed (const CommCloseCbParams &params)
 called when the some external force closed our socket More...
 

Private Attributes

Pdu aggrPdu
 aggregated pdu More...
 
Comm::ConnectionPointer conn
 client connection descriptor More...
 
AsyncCall::Pointer writer
 comm_write callback More...
 
AsyncCall::Pointer closer
 comm_close handler More...
 

Detailed Description

Coordinator's job that sends a PDU request to each strand, aggregates strand responses and send back the result to client

Definition at line 26 of file Inquirer.h.

Member Typedef Documentation

Definition at line 34 of file AsyncJob.h.

typedef std::map<unsigned int, AsyncCall::Pointer> Ipc::Inquirer::RequestsMap
protectedinherited

Definition at line 79 of file Inquirer.h.

Constructor & Destructor Documentation

Member Function Documentation

bool Snmp::Inquirer::aggregate ( Ipc::Response::Pointer  aResponse)
protectedvirtual
void AsyncJob::callEnd ( )
virtualinherited
void Ipc::Inquirer::callException ( const std::exception &  e)
virtualinherited

Reimplemented from AsyncJob.

Definition at line 128 of file Inquirer.cc.

References AsyncJob::callException(), DBG_CRITICAL, debugs, and HERE().

void AsyncJob::callStart ( AsyncCall call)
inherited
bool AsyncJob::canBeCalled ( AsyncCall call) const
inherited

Definition at line 101 of file AsyncJob.cc.

References AsyncCall::cancel(), debugs, HERE(), AsyncJob::inCall, and NULL.

Snmp::Inquirer::CBDATA_CLASS ( Inquirer  )
private
void Snmp::Inquirer::cleanup ( )
protectedvirtual

Reimplemented from Ipc::Inquirer.

Definition at line 44 of file Inquirer.cc.

References comm_remove_close_handler(), conn, Comm::IsConnOpen(), and NULL.

void AsyncJob::deleteThis ( const char *  aReason)
protectedinherited
bool AsyncJob::done ( ) const
protectedinherited

Definition at line 90 of file AsyncJob.cc.

References AsyncJob::doneAll(), NULL, and AsyncJob::stopReason.

Referenced by AsyncJob::callEnd(), and Downloader::downloadFinished().

bool Snmp::Inquirer::doneAll ( ) const
protectedvirtual

Reimplemented from Ipc::Inquirer.

Definition at line 96 of file Inquirer.cc.

References Ipc::Inquirer::doneAll().

void Snmp::Inquirer::handleException ( const std::exception &  e)
protectedvirtual

Reimplemented from Ipc::Inquirer.

Definition at line 66 of file Inquirer.cc.

References Ipc::Inquirer::handleException(), and SNMP_ERR_GENERR.

void Ipc::Inquirer::inquire ( )
protectedvirtualinherited
void Snmp::Inquirer::noteCommClosed ( const CommCloseCbParams params)
private

Definition at line 87 of file Inquirer.cc.

References conn, CommCommonCbParams::conn, debugs, Comm::Connection::fd, HERE(), Comm::IsConnOpen(), Must, and NULL.

Referenced by Inquirer().

void Snmp::Inquirer::sendResponse ( )
protectedvirtual
void Snmp::Inquirer::start ( )
protectedvirtual

Reimplemented from Ipc::Inquirer.

Definition at line 57 of file Inquirer.cc.

References conn, debugs, HERE(), Comm::IsConnOpen(), Must, and Ipc::Inquirer::start().

const char * Ipc::Inquirer::status ( ) const
protectedvirtualinherited

for debugging, starts with space

Reimplemented from AsyncJob.

Definition at line 202 of file Inquirer.cc.

References Packable::appendf(), buf, MemBuf::content(), request(), MemBuf::reset(), and MemBuf::terminate().

void Ipc::Inquirer::swanSong ( )
protectedvirtualinherited

Reimplemented from AsyncJob.

Definition at line 102 of file Inquirer.cc.

References debugs, HERE(), and request().

virtual void* CbdataParent::toCbdata ( )
pure virtualinherited

Member Data Documentation

Pdu Snmp::Inquirer::aggrPdu
private

Definition at line 48 of file Inquirer.h.

AsyncCall::Pointer Snmp::Inquirer::closer
private

Definition at line 52 of file Inquirer.h.

Referenced by Inquirer().

Comm::ConnectionPointer Snmp::Inquirer::conn
private

Definition at line 49 of file Inquirer.h.

Referenced by Inquirer().

const InstanceId<AsyncJob> AsyncJob::id
protectedinherited

Definition at line 70 of file AsyncJob.h.

AsyncCall::Pointer AsyncJob::inCall
protectedinherited
unsigned int Ipc::Inquirer::LastRequestId = 0
staticprotectedinherited

Definition at line 82 of file Inquirer.h.

Ipc::StrandCoords::const_iterator Ipc::Inquirer::pos
protectedinherited

Definition at line 74 of file Inquirer.h.

Request::Pointer Ipc::Inquirer::request
protectedinherited

Definition at line 71 of file Inquirer.h.

Referenced by Inquirer().

const char* AsyncJob::stopReason
protectedinherited
Ipc::StrandCoords Ipc::Inquirer::strands
protectedinherited

Definition at line 73 of file Inquirer.h.

Referenced by Ipc::Inquirer::Inquirer().

Ipc::Inquirer::RequestsMap Ipc::Inquirer::TheRequestsMap
staticprotectedinherited

Definition at line 80 of file Inquirer.h.

const double Ipc::Inquirer::timeout
protectedinherited

Definition at line 76 of file Inquirer.h.

AsyncCall::Pointer Snmp::Inquirer::writer
private

Definition at line 51 of file Inquirer.h.


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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors