2 * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
9 /* DEBUG: section 93 eCAP Interface */
11 #ifndef SQUID_ECAP_SERVICE_REP_H
12 #define SQUID_ECAP_SERVICE_REP_H
14 #include "adaptation/forward.h"
15 #include "adaptation/Service.h"
16 #include <libecap/common/forward.h>
17 #include <libecap/common/memory.h>
24 /* The eCAP service representative maintains information about a single eCAP
25 service that Squid communicates with. One eCAP module may register many
28 class ServiceRep
: public Adaptation::Service
31 explicit ServiceRep(const ServiceConfigPointer
&aConfig
);
32 virtual ~ServiceRep();
34 typedef libecap::shared_ptr
<libecap::adapter::Service
> AdapterService
;
36 /* Adaptation::Service API */
37 virtual void finalize();
38 virtual bool probed() const;
39 virtual bool up() const;
40 virtual Adaptation::Initiate
*makeXactLauncher(HttpMsg
*virginHeader
, HttpRequest
*virginCause
, AccessLogEntry::Pointer
&alp
);
41 virtual bool wantsUrl(const String
&urlPath
) const;
42 virtual void noteFailure();
43 virtual const char *status() const;
44 virtual void detach();
45 virtual bool detached() const;
48 void tryConfigureAndStart();
49 bool handleFinalizeFailure(const char *error
);
52 AdapterService theService
; // the actual adaptation service we represent
56 /// register loaded eCAP module service
57 void RegisterAdapterService(const ServiceRep::AdapterService
& adapterService
);
58 /// unregister loaded eCAP module service by service uri
59 void UnregisterAdapterService(const String
& serviceUri
);
61 /// returns loaded eCAP module service by service uri
62 ServiceRep::AdapterService
FindAdapterService(const String
& serviceUri
);
64 /// check for loaded eCAP services without matching ecap_service in squid.conf
65 void CheckUnusedAdapterServices(const Services
& services
);
67 } // namespace Adaptation
69 #endif /* SQUID_ECAP_SERVICE_REP_H */