]> git.ipfire.org Git - thirdparty/squid.git/blob - src/mgr/Inquirer.h
Boilerplate: update copyright blurbs on src/
[thirdparty/squid.git] / src / mgr / Inquirer.h
1 /*
2 * Copyright (C) 1996-2014 The Squid Software Foundation and contributors
3 *
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
7 */
8
9 /* DEBUG: section 16 Cache Manager API */
10
11 #ifndef SQUID_MGR_INQUIRER_H
12 #define SQUID_MGR_INQUIRER_H
13
14 #include "comm/forward.h"
15 #include "ipc/Inquirer.h"
16 #include "mgr/Action.h"
17
18 class CommIoCbParams;
19 class CommCloseCbParams;
20
21 namespace Mgr
22 {
23
24 /// Coordinator's job that sends a cache manage request to each strand,
25 /// aggregating individual strand responses and dumping the result if needed
26 class Inquirer: public Ipc::Inquirer
27 {
28 public:
29 Inquirer(Action::Pointer anAction, const Request &aCause,
30 const Ipc::StrandCoords &coords);
31
32 protected:
33 /* AsyncJob API */
34 virtual void start();
35 virtual bool doneAll() const;
36
37 /* Ipc::Inquirer API */
38 virtual void cleanup();
39 virtual void sendResponse();
40 virtual bool aggregate(Ipc::Response::Pointer aResponse);
41
42 private:
43 void noteWroteHeader(const CommIoCbParams& params);
44 void noteCommClosed(const CommCloseCbParams& params);
45 void removeCloseHandler();
46 Ipc::StrandCoords applyQueryParams(const Ipc::StrandCoords& aStrands,
47 const QueryParams& aParams);
48 private:
49 Action::Pointer aggrAction; //< action to aggregate
50
51 Comm::ConnectionPointer conn; ///< HTTP client socket descriptor
52
53 AsyncCall::Pointer writer; ///< comm_write callback
54 AsyncCall::Pointer closer; ///< comm_close handler
55
56 CBDATA_CLASS2(Inquirer);
57 };
58
59 } // namespace Mgr
60
61 #endif /* SQUID_MGR_INQUIRER_H */