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