]> 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 "base/AsyncCall.h"
6 #include "adaptation/forward.h"
7 #include "adaptation/Elements.h"
8
9 class acl_access;
10 class ConfigParser;
11
12 namespace Adaptation
13 {
14
15 class Config
16 {
17 public:
18 static void Finalize(bool enable);
19
20 static void ParseServiceSet(void);
21 static void ParseServiceChain(void);
22
23 static void ParseAccess(ConfigParser &parser);
24 static void FreeAccess(void);
25 static void DumpAccess(StoreEntry *, const char *);
26
27 friend class AccessCheck;
28
29 public:
30 static bool Enabled; // true if at least one adaptation mechanism is
31
32 // these are global squid.conf options, documented elsewhere
33 static char *masterx_shared_name; // global TODO: do we need TheConfig?
34 static int service_iteration_limit;
35 // Options below are accessed via Icap::TheConfig or Ecap::TheConfig
36 // TODO: move ICAP-specific options to Icap::Config and add TheConfig
37 int onoff;
38 int send_client_ip;
39 int send_client_username;
40 int service_failure_limit;
41 time_t oldest_service_failure;
42 int service_revival_delay;
43 int icap_uses_indirect_client;
44
45 Vector<ServiceConfig*> serviceConfigs;
46
47 Config();
48 virtual ~Config();
49
50 void parseService(void);
51 void freeService(void);
52 void dumpService(StoreEntry *, const char *) const;
53 ServicePointer findService(const String&);
54
55 virtual void finalize();
56
57 private:
58 Config(const Config &); // unsupported
59 Config &operator =(const Config &); // unsupported
60
61 virtual ServicePointer createService(const ServiceConfig &cfg) = 0;
62
63 static void ParseServiceGroup(ServiceGroupPointer group);
64 static void FreeServiceGroups(void);
65 static void DumpServiceGroups(StoreEntry *, const char *);
66 };
67
68 } // namespace Adaptation
69
70 #endif /* SQUID_ADAPTATION__CONFIG_H */