ServiceRep.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2023 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 ~ServiceRep() override;
33
34 typedef libecap::shared_ptr<libecap::adapter::Service> AdapterService;
35
36 /* Adaptation::Service API */
37 void finalize() override;
38 bool probed() const override;
39 bool up() const override;
41 bool wantsUrl(const SBuf &urlPath) const override;
42 void noteFailure() override;
43 virtual const char *status() const;
44 void detach() override;
45 bool detached() const override;
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
bool probed() const override
Definition: ServiceRep.cc:232
void tryConfigureAndStart()
attempts to configure and start eCAP service; the caller handles exceptions
Definition: ServiceRep.cc:195
bool wantsUrl(const SBuf &urlPath) const override
Definition: ServiceRep.cc:242
Adaptation::Initiate * makeXactLauncher(Http::Message *virginHeader, HttpRequest *virginCause, AccessLogEntry::Pointer &alp) override
Definition: ServiceRep.cc:251
bool handleFinalizeFailure(const char *error)
Definition: ServiceRep.cc:213
bool up() const override
Definition: ServiceRep.cc:237
virtual const char * status() const
Definition: ServiceRep.cc:272
void noteFailure() override
Definition: ServiceRep.cc:164
AdapterService theService
Definition: ServiceRep.h:52
bool detached() const override
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