]>
Commit | Line | Data |
---|---|---|
51ea0904 CT |
1 | /* |
2 | * $Id$ | |
3 | * | |
4 | * DEBUG: section 49 SNMP Interface | |
5 | * | |
6 | */ | |
7 | ||
8 | #ifndef SQUID_SNMPX_INQUIRER_H | |
9 | #define SQUID_SNMPX_INQUIRER_H | |
10 | ||
1b76e6c1 | 11 | #include "comm/forward.h" |
51ea0904 | 12 | #include "ipc/Inquirer.h" |
d6e3ad20 CT |
13 | #include "snmp/forward.h" |
14 | #include "snmp/Pdu.h" | |
51ea0904 | 15 | |
51ea0904 CT |
16 | class CommCloseCbParams; |
17 | ||
18 | namespace Snmp | |
19 | { | |
20 | ||
21 | /// Coordinator's job that sends a PDU request to each strand, | |
22 | /// aggregates strand responses and send back the result to client | |
23 | class Inquirer: public Ipc::Inquirer | |
24 | { | |
25 | public: | |
26 | Inquirer(const Request& aRequest, const Ipc::StrandCoords& coords); | |
27 | ||
28 | protected: | |
29 | /* AsyncJob API */ | |
30 | virtual void start(); | |
31 | virtual bool doneAll() const; | |
32 | ||
33 | /* Ipc::Inquirer API */ | |
34 | virtual void cleanup(); | |
35 | virtual void handleException(const std::exception& e); | |
36 | virtual void sendResponse(); | |
37 | virtual bool aggregate(Ipc::Response::Pointer aResponse); | |
38 | ||
39 | private: | |
40 | void noteCommClosed(const CommCloseCbParams& params); | |
41 | ||
42 | private: | |
43 | Pdu aggrPdu; ///< aggregated pdu | |
1b76e6c1 | 44 | Comm::ConnectionPointer conn; ///< client connection descriptor |
51ea0904 CT |
45 | |
46 | AsyncCall::Pointer writer; ///< comm_write callback | |
47 | AsyncCall::Pointer closer; ///< comm_close handler | |
48 | ||
49 | CBDATA_CLASS2(Inquirer); | |
50 | }; | |
51 | ||
52 | } // namespace Snmp | |
53 | ||
54 | #endif /* SQUID_SNMPX_INQUIRER_H */ |