ServiceRep.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2022 The Squid Software Foundation and contributors
3 *
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.
7 */
8
9/* DEBUG: section 93 eCAP Interface */
10
11#ifndef SQUID_ECAP_SERVICE_REP_H
12#define SQUID_ECAP_SERVICE_REP_H
13
14#include "adaptation/forward.h"
15#include "adaptation/Service.h"
16#include <libecap/common/forward.h>
17#include <libecap/common/memory.h>
18
19namespace Adaptation
20{
21namespace Ecap
22{
23
24/* The eCAP service representative maintains information about a single eCAP
25 service that Squid communicates with. One eCAP module may register many
26 eCAP services. */
27
29{
30public:
31 explicit ServiceRep(const ServiceConfigPointer &aConfig);
32 virtual ~ServiceRep();
33
34 typedef libecap::shared_ptr<libecap::adapter::Service> AdapterService;
35
36 /* Adaptation::Service API */
37 virtual void finalize();
38 virtual bool probed() const;
39 virtual bool up() const;
41 virtual bool wantsUrl(const SBuf &urlPath) const;
42 virtual void noteFailure();
43 virtual const char *status() const;
44 virtual void detach();
45 virtual bool detached() const;
46
47protected:
49 bool handleFinalizeFailure(const char *error);
50
51private:
52 AdapterService theService; // the actual adaptation service we represent
54};
55
57void RegisterAdapterService(const ServiceRep::AdapterService& adapterService);
59void UnregisterAdapterService(const String& serviceUri);
60
63
65void CheckUnusedAdapterServices(const Services& services);
66} // namespace Ecap
67} // namespace Adaptation
68
69#endif /* SQUID_ECAP_SERVICE_REP_H */
70
void error(char *format,...)
ServiceRep(const ServiceConfigPointer &aConfig)
Definition: ServiceRep.cc:154
virtual bool wantsUrl(const SBuf &urlPath) const
Definition: ServiceRep.cc:242
void tryConfigureAndStart()
attempts to configure and start eCAP service; the caller handles exceptions
Definition: ServiceRep.cc:195
bool handleFinalizeFailure(const char *error)
Definition: ServiceRep.cc:213
virtual bool probed() const
Definition: ServiceRep.cc:232
virtual const char * status() const
Definition: ServiceRep.cc:272
virtual Adaptation::Initiate * makeXactLauncher(Http::Message *virginHeader, HttpRequest *virginCause, AccessLogEntry::Pointer &alp)
Definition: ServiceRep.cc:251
AdapterService theService
Definition: ServiceRep.h:52
virtual bool up() const
Definition: ServiceRep.cc:237
virtual bool detached() const
whether detached() was called
Definition: ServiceRep.cc:299
libecap::shared_ptr< libecap::adapter::Service > AdapterService
Definition: ServiceRep.h:34
common parts of HttpRequest and HttpReply
Definition: Message.h:26
Definition: SBuf.h:94
void RegisterAdapterService(const ServiceRep::AdapterService &adapterService)
register loaded eCAP module service
Definition: ServiceRep.cc:316
void CheckUnusedAdapterServices(const Services &services)
check for loaded eCAP services without matching ecap_service in squid.conf
Definition: ServiceRep.cc:335
ServiceRep::AdapterService FindAdapterService(const String &serviceUri)
returns loaded eCAP module service by service uri
Definition: ServiceRep.cc:305
void UnregisterAdapterService(const String &serviceUri)
unregister loaded eCAP module service by service uri
Definition: ServiceRep.cc:324
std::vector< Adaptation::ServicePointer > Services
Definition: Service.h:70

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors