#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...
void handleStopRequest ()
 process external request to terminate now (i.e. during this async call) 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 void Start (const Pointer &job)

Public Attributes

CodeContextPointer codeContext
const InstanceId< AsyncJobid
 job identifier More...

Protected Types

typedef std::map< RequestId::Index, AsyncCall::PointerRequestsMap
 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...
bool started_ = false
 Start() has finished successfully. More...
bool swanSang_ = false
 swanSong() was called More...

Static Protected Attributes

static RequestsMap TheRequestsMap
 pending strand requests More...
static RequestId::Index LastRequestId = 0
 last requestId used More...

Private Types

typedef UnaryMemFunT< Inquirer, Response::Pointer, Response::PointerHandleAckDialer

Private Member Functions

 CBDATA_CLASS (Inquirer)
void noteCommClosed (const CommCloseCbParams &params)
 called when the some external force closed our socket More...
void handleRemoteAck (Response::Pointer response)
 called when a strand is done writing its output More...
void requestTimedOut ()
 called when the strand failed to respond (or finish responding) in time More...
void removeTimeoutEvent ()
 called when we are no longer waiting for the strand to respond More...

Static Private Member Functions

static AsyncCall::Pointer DequeueRequest (RequestId::Index)
 returns and forgets the right Inquirer callback for strand request More...
static void RequestTimedOut (void *param)
 Ipc::Inquirer::requestTimedOut wrapper. 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

◆ HandleAckDialer

Definition at line 63 of file Inquirer.h.

◆ Pointer

Definition at line 34 of file AsyncJob.h.

◆ RequestsMap

typedef std::map<RequestId::Index, AsyncCall::Pointer> Ipc::Inquirer::RequestsMap

Definition at line 82 of file Inquirer.h.

Constructor & Destructor Documentation

◆ Inquirer()

Member Function Documentation

◆ aggregate()

bool Snmp::Inquirer::aggregate ( Ipc::Response::Pointer  aResponse)

◆ callEnd()

void AsyncJob::callEnd ( )

◆ callException()

void Ipc::Inquirer::callException ( const std::exception &  e)

Reimplemented from AsyncJob.

Definition at line 129 of file Inquirer.cc.

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

◆ callStart()

void AsyncJob::callStart ( AsyncCall call)

◆ canBeCalled()

bool AsyncJob::canBeCalled ( AsyncCall call) const

Definition at line 102 of file AsyncJob.cc.

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


Snmp::Inquirer::CBDATA_CLASS ( Inquirer  )

◆ cleanup()

void Snmp::Inquirer::cleanup ( )

Reimplemented from Ipc::Inquirer.

Definition at line 44 of file Inquirer.cc.

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

◆ deleteThis()

void AsyncJob::deleteThis ( const char *  aReason)

◆ DequeueRequest()

AsyncCall::Pointer Ipc::Inquirer::DequeueRequest ( RequestId::Index  requestId)

Definition at line 142 of file Inquirer.cc.

References debugs, Must, and request().

◆ done()

bool AsyncJob::done ( ) const

◆ doneAll()

bool Snmp::Inquirer::doneAll ( ) const

Reimplemented from Ipc::Inquirer.

Definition at line 100 of file Inquirer.cc.

References Ipc::Inquirer::doneAll().

◆ handleException()

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

Reimplemented from Ipc::Inquirer.

Definition at line 66 of file Inquirer.cc.

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

◆ HandleRemoteAck()

void Ipc::Inquirer::HandleRemoteAck ( const Response response)

◆ handleRemoteAck()

void Ipc::Inquirer::handleRemoteAck ( Response::Pointer  response)

Definition at line 88 of file Inquirer.cc.

References debugs, Must, and request().

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

◆ handleStopRequest()

void AsyncJob::handleStopRequest ( )

Definition at line 71 of file AsyncJob.h.

References AsyncJob::mustStop().

◆ inquire()

void Ipc::Inquirer::inquire ( )

◆ mustStop()

◆ noteCommClosed()

void Snmp::Inquirer::noteCommClosed ( const CommCloseCbParams params)

Definition at line 87 of file Inquirer.cc.

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

Referenced by Inquirer().

◆ removeTimeoutEvent()

void Ipc::Inquirer::removeTimeoutEvent ( )

Definition at line 171 of file Inquirer.cc.

References eventDelete(), eventFind(), and Ipc::Inquirer::RequestTimedOut().

◆ requestTimedOut()

void Ipc::Inquirer::requestTimedOut ( )

Definition at line 192 of file Inquirer.cc.

References debugs, Must, MYNAME, and request().

◆ RequestTimedOut()

void Ipc::Inquirer::RequestTimedOut ( void *  param)

◆ sendResponse()

void Snmp::Inquirer::sendResponse ( )

◆ start()

void Snmp::Inquirer::start ( )

Reimplemented from Ipc::Inquirer.

Definition at line 57 of file Inquirer.cc.

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

◆ Start()

◆ status()

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

for debugging, starts with space

Reimplemented from AsyncJob.

Definition at line 205 of file Inquirer.cc.

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

◆ swanSong()

void Ipc::Inquirer::swanSong ( )

Reimplemented from AsyncJob.

Definition at line 103 of file Inquirer.cc.

References debugs, MYNAME, and request().

◆ toCbdata()

virtual void * CbdataParent::toCbdata ( )
pure virtualinherited

Member Data Documentation

◆ aggrPdu

Pdu Snmp::Inquirer::aggrPdu

Definition at line 48 of file Inquirer.h.

◆ closer

AsyncCall::Pointer Snmp::Inquirer::closer

Definition at line 52 of file Inquirer.h.

Referenced by Inquirer().

◆ codeContext

CodeContextPointer Ipc::Inquirer::codeContext

Definition at line 42 of file Inquirer.h.

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

◆ conn

Comm::ConnectionPointer Snmp::Inquirer::conn

Definition at line 49 of file Inquirer.h.

Referenced by Inquirer().

◆ id

const InstanceId<AsyncJob> AsyncJob::id

Definition at line 73 of file AsyncJob.h.

◆ inCall

AsyncCall::Pointer AsyncJob::inCall

◆ LastRequestId

Ipc::RequestId::Index Ipc::Inquirer::LastRequestId = 0

Definition at line 85 of file Inquirer.h.

◆ pos

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

Definition at line 77 of file Inquirer.h.

◆ request

Request::Pointer Ipc::Inquirer::request

Definition at line 74 of file Inquirer.h.

Referenced by Inquirer().

◆ started_

bool AsyncJob::started_ = false

Definition at line 83 of file AsyncJob.h.

Referenced by AsyncJob::~AsyncJob(), AsyncJob::callEnd(), and AsyncJob::Start().

◆ stopReason

const char* AsyncJob::stopReason

◆ strands

Ipc::StrandCoords Ipc::Inquirer::strands

Definition at line 76 of file Inquirer.h.

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

◆ swanSang_

bool AsyncJob::swanSang_ = false

Definition at line 84 of file AsyncJob.h.

Referenced by AsyncJob::~AsyncJob(), and AsyncJob::callEnd().

◆ TheRequestsMap

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

Definition at line 83 of file Inquirer.h.

◆ timeout

const double Ipc::Inquirer::timeout

Definition at line 79 of file Inquirer.h.

◆ typeName

◆ writer

AsyncCall::Pointer Snmp::Inquirer::writer

Definition at line 51 of file Inquirer.h.

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






Web Site Translations