1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34 package info.magnolia.module.cache;
35
36 import java.util.HashMap;
37 import java.util.Map;
38
39
40
41
42
43
44
45
46
47
48
49
50 public class CacheConfiguration {
51
52 private String name;
53 private CachePolicy cachePolicy;
54 private FlushPolicy flushPolicy;
55 private BrowserCachePolicy browserCachePolicy;
56
57 private Map executors = new HashMap();
58
59 public CacheConfiguration() {
60 }
61
62
63 CacheConfiguration(String name, CachePolicy cachePolicy, FlushPolicy flushPolicy) {
64 this.name = name;
65 this.cachePolicy = cachePolicy;
66 this.flushPolicy = flushPolicy;
67 }
68
69 public String getName() {
70 return name;
71 }
72
73 public void setName(String name) {
74 this.name = name;
75 }
76
77 public CachePolicy getCachePolicy() {
78 return cachePolicy;
79 }
80
81 public void setCachePolicy(CachePolicy cachePolicy) {
82 this.cachePolicy = cachePolicy;
83 }
84
85 public FlushPolicy getFlushPolicy() {
86 return flushPolicy;
87 }
88
89 public void setFlushPolicy(FlushPolicy flushPolicy) {
90 this.flushPolicy = flushPolicy;
91 }
92
93 public CachePolicyExecutor getExecutor(CachePolicyResult.CachePolicyBehaviour behaviour) {
94 return (CachePolicyExecutor) executors.get(behaviour.getName());
95 }
96
97 public BrowserCachePolicy getBrowserCachePolicy() {
98 return browserCachePolicy;
99 }
100
101 public void setBrowserCachePolicy(BrowserCachePolicy browserCachePolicy) {
102 this.browserCachePolicy = browserCachePolicy;
103 }
104
105 public Map getExecutors() {
106 return executors;
107 }
108
109 public void setExecutors(Map executors) {
110 this.executors = executors;
111 }
112
113 public void addExecutor(String name, CachePolicyExecutor executor){
114 executor.setCacheConfiguration(this);
115 this.executors.put(name, executor);
116 }
117
118 }