2 * DEBUG: section 93 eCAP Interface
5 #ifndef SQUID_ECAP_SERVICE_REP_H
6 #define SQUID_ECAP_SERVICE_REP_H
8 #include "adaptation/forward.h"
9 #include "adaptation/Service.h"
10 #include <libecap/common/forward.h>
11 #include <libecap/common/memory.h>
18 /* The eCAP service representative maintains information about a single eCAP
19 service that Squid communicates with. One eCAP module may register many
22 class ServiceRep
: public Adaptation::Service
25 explicit ServiceRep(const ServiceConfigPointer
&aConfig
);
26 virtual ~ServiceRep();
28 typedef libecap::shared_ptr
<libecap::adapter::Service
> AdapterService
;
30 /* Adaptation::Service API */
31 virtual void finalize();
32 virtual bool probed() const;
33 virtual bool up() const;
34 virtual Adaptation::Initiate
*makeXactLauncher(HttpMsg
*virginHeader
, HttpRequest
*virginCause
, AccessLogEntry::Pointer
&alp
);
35 virtual bool wantsUrl(const String
&urlPath
) const;
36 virtual void noteFailure();
37 virtual const char *status() const;
38 virtual void detach();
39 virtual bool detached() const;
42 void tryConfigureAndStart();
43 bool handleFinalizeFailure(const char *error
);
46 AdapterService theService
; // the actual adaptation service we represent
50 /// register loaded eCAP module service
51 void RegisterAdapterService(const ServiceRep::AdapterService
& adapterService
);
52 /// unregister loaded eCAP module service by service uri
53 void UnregisterAdapterService(const String
& serviceUri
);
55 /// returns loaded eCAP module service by service uri
56 ServiceRep::AdapterService
FindAdapterService(const String
& serviceUri
);
58 /// check for loaded eCAP services without matching ecap_service in squid.conf
59 void CheckUnusedAdapterServices(const Services
& services
);
61 } // namespace Adaptation
63 #endif /* SQUID_ECAP_SERVICE_REP_H */