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