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 explicit ServiceRep(const ServiceConfigPointer
&aConfig
);
27 virtual ~ServiceRep();
29 typedef libecap::shared_ptr
<libecap::adapter::Service
> AdapterService
;
31 /* Adaptation::Service API */
32 virtual void finalize();
33 virtual bool probed() const;
34 virtual bool up() const;
35 virtual Adaptation::Initiate
*makeXactLauncher(HttpMsg
*virginHeader
, HttpRequest
*virginCause
);
36 virtual bool wantsUrl(const String
&urlPath
) const;
37 virtual void noteFailure();
38 virtual const char *status() const;
39 virtual void detach();
40 virtual bool detached() const;
43 void tryConfigureAndStart();
44 bool handleFinalizeFailure(const char *error
);
47 AdapterService theService
; // the actual adaptation service we represent
51 /// register loaded eCAP module service
52 void RegisterAdapterService(const ServiceRep::AdapterService
& adapterService
);
53 /// unregister loaded eCAP module service by service uri
54 void UnregisterAdapterService(const String
& serviceUri
);
56 /// returns loaded eCAP module service by service uri
57 ServiceRep::AdapterService
FindAdapterService(const String
& serviceUri
);
59 /// check for loaded eCAP services without matching ecap_service in squid.conf
60 void CheckUnusedAdapterServices(const Services
& services
);
62 } // namespace Adaptation
64 #endif /* SQUID_ECAP_SERVICE_REP_H */