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