3 * DEBUG: section 93 eCAP Interface
6 #ifndef SQUID_ECAP_SERVICE_REP_H
7 #define SQUID_ECAP_SERVICE_REP_H
9 #include "adaptation/Service.h"
10 #include "adaptation/forward.h"
11 #include <libecap/common/forward.h>
12 #include <libecap/common/memory.h>
19 /* The eCAP service representative maintains information about a single eCAP
20 service that Squid communicates with. One eCAP module may register many
23 class ServiceRep
: public Adaptation::Service
26 ServiceRep(const Adaptation::ServiceConfig
&config
);
27 virtual ~ServiceRep();
29 typedef libecap::shared_ptr
<libecap::adapter::Service
> AdapterService
;
31 virtual void finalize();
33 virtual bool probed() const;
34 virtual bool up() const;
36 Adaptation::Initiate
*makeXactLauncher(Adaptation::Initiator
*, HttpMsg
*virginHeader
, HttpRequest
*virginCause
);
38 // the methods below can only be called on an up() service
39 virtual bool wantsUrl(const String
&urlPath
) const;
41 // called by transactions to report service failure
42 virtual void noteFailure();
44 virtual const char *status() const;
46 virtual void detach();
47 virtual bool detached() const;
50 AdapterService theService
; // the actual adaptation service we represent
54 /// register loaded eCAP module service
55 extern void RegisterAdapterService(const ServiceRep::AdapterService
& adapterService
);
56 /// unregister loaded eCAP module service by service uri
57 extern void UnregisterAdapterService(const String
& serviceUri
);
59 /// returns loaded eCAP module service by service uri
60 extern ServiceRep::AdapterService
FindAdapterService(const String
& serviceUri
);
62 /// check for loaded eCAP services without matching ecap_service in squid.conf
63 extern void CheckUnusedAdapterServices(const Services
& services
);
65 } // namespace Adaptation
67 #endif /* SQUID_ECAP_SERVICE_REP_H */