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
;
30 void noteService(const AdapterService
&s
);
32 virtual void finalize();
34 // call when the service is no longer needed or valid
35 virtual void invalidate();
37 virtual bool probed() const;
38 virtual bool up() const;
40 Adaptation::Initiate
*makeXactLauncher(Adaptation::Initiator
*, HttpMsg
*virginHeader
, HttpRequest
*virginCause
);
42 // the methods below can only be called on an up() service
43 virtual bool wantsUrl(const String
&urlPath
) const;
45 // called by transactions to report service failure
46 virtual void noteFailure();
48 virtual const char *status() const;
51 AdapterService theService
; // the actual adaptation service we represent
55 } // namespace Adaptation
57 #endif /* SQUID_ECAP_SERVICE_REP_H */