]> git.ipfire.org Git - thirdparty/squid.git/blob - src/adaptation/ecap/ServiceRep.h
Merged from trunk.
[thirdparty/squid.git] / src / adaptation / ecap / ServiceRep.h
1
2 /*
3 * $Id$
4 */
5
6 #ifndef SQUID_ECAP_SERVICE_REP_H
7 #define SQUID_ECAP_SERVICE_REP_H
8
9 #include "adaptation/Service.h"
10 #include "adaptation/forward.h"
11 #include <libecap/common/forward.h>
12 #include <libecap/common/memory.h>
13
14 namespace Adaptation
15 {
16 namespace Ecap {
17
18 /* The eCAP service representative maintains information about a single eCAP
19 service that Squid communicates with. One eCAP module may register many
20 eCAP services. */
21
22 class ServiceRep : public Adaptation::Service
23 {
24 public:
25 ServiceRep(const Adaptation::ServiceConfig &config);
26 virtual ~ServiceRep();
27
28 typedef libecap::shared_ptr<libecap::adapter::Service> AdapterService;
29 void noteService(const AdapterService &s);
30
31 virtual void finalize();
32
33 // call when the service is no longer needed or valid
34 virtual void invalidate();
35
36 virtual bool probed() const;
37 virtual bool up() const;
38
39 Adaptation::Initiate *makeXactLauncher(Adaptation::Initiator *, HttpMsg *virginHeader, HttpRequest *virginCause);
40
41 // the methods below can only be called on an up() service
42 virtual bool wantsUrl(const String &urlPath) const;
43
44 // called by transactions to report service failure
45 virtual void noteFailure();
46
47 virtual const char *status() const;
48
49 private:
50 AdapterService theService; // the actual adaptation service we represent
51 };
52
53 } // namespace Ecap
54 } // namespace Adaptation
55
56 #endif /* SQUID_ECAP_SERVICE_REP_H */