]> git.ipfire.org Git - thirdparty/squid.git/blob - src/adaptation/Config.h
Merged from trunk
[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
17 class Service;
18 class ServiceConfig;
19 class Class;
20
21 typedef RefCount<Service> ServicePointer;
22
23 class ServiceGroup;
24 class AccessRule;
25
26 class Config
27 {
28 public:
29 static void Finalize(bool enable);
30
31 static void ParseServiceSet(void);
32 static void FreeServiceSet(void);
33 static void DumpServiceSet(StoreEntry *, const char *);
34
35 static void ParseAccess(ConfigParser &parser);
36 static void FreeAccess(void);
37 static void DumpAccess(StoreEntry *, const char *);
38
39 friend class AccessCheck;
40
41 public:
42 static bool Enabled; // true if at least one adaptation mechanism is
43
44 int onoff;
45 int send_client_ip;
46 int send_client_username;
47 int service_failure_limit;
48 int service_revival_delay;
49
50 Vector<ServiceConfig*> serviceConfigs;
51
52 Config();
53 virtual ~Config();
54
55 void parseService(void);
56 void freeService(void);
57 void dumpService(StoreEntry *, const char *) const;
58 ServicePointer findService(const String&);
59 Class * findClass(const String& key);
60
61 virtual void finalize();
62
63 private:
64 Config(const Config &); // unsupported
65 Config &operator =(const Config &); // unsupported
66
67 virtual ServicePointer createService(const ServiceConfig &cfg) = 0;
68 };
69
70 } // namespace Adaptation
71
72 #endif /* SQUID_ADAPTATION__CONFIG_H */