]> git.ipfire.org Git - thirdparty/squid.git/blob - src/adaptation/Config.h
eCAP support, phase 2: Implemented libecap interfaces, added eCAP
[thirdparty/squid.git] / src / adaptation / Config.h
1 #ifndef SQUID_ADAPTATION__CONFIG_H
2 #define SQUID_ADAPTATION__CONFIG_H
3
4 #include "event.h"
5 #include "AsyncCall.h"
6 #include "adaptation/Elements.h"
7
8 class acl_access;
9 class ConfigParser;
10
11 template <class C>
12 class RefCount;
13
14 namespace Adaptation {
15
16 class Service;
17 class ServiceConfig;
18 class Class;
19
20 typedef RefCount<Service> ServicePointer;
21
22 class ServiceGroup;
23 class AccessRule;
24
25 class Config
26 {
27 public:
28 static void Finalize(bool enable);
29
30 static void ParseServiceSet(void);
31 static void FreeServiceSet(void);
32 static void DumpServiceSet(StoreEntry *, const char *);
33
34 static void ParseAccess(ConfigParser &parser);
35 static void FreeAccess(void);
36 static void DumpAccess(StoreEntry *, const char *);
37
38 friend class AccessCheck;
39
40 public:
41 static bool Enabled; // true if at least one adaptation mechanism is
42
43 int onoff;
44 int send_client_ip;
45 int send_client_username;
46 int service_failure_limit;
47 int service_revival_delay;
48
49 Vector<ServiceConfig*> serviceConfigs;
50
51 Config();
52 virtual ~Config();
53
54 void parseService(void);
55 void freeService(void);
56 void dumpService(StoreEntry *, const char *) const;
57 ServicePointer findService(const String&);
58 Class * findClass(const String& key);
59
60 virtual void finalize();
61
62 private:
63 Config(const Config &); // unsupported
64 Config &operator =(const Config &); // unsupported
65
66 virtual ServicePointer createService(const ServiceConfig &cfg) = 0;
67 };
68
69 } // namespace Adaptation
70
71 #endif /* SQUID_ADAPTATION__CONFIG_H */