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
64
65 CacheConfiguration(String name, CachePolicy cachePolicy, FlushPolicy flushPolicy) {
66 this.name = name;
67 this.cachePolicy = cachePolicy;
68 this.flushPolicy = flushPolicy;
69 }
70
71 public String getName() {
72 return name;
73 }
74
75 public void setName(String name) {
76 this.name = name;
77 }
78
79 public CachePolicy getCachePolicy() {
80 return cachePolicy;
81 }
82
83 public void setCachePolicy(CachePolicy cachePolicy) {
84 this.cachePolicy = cachePolicy;
85 }
86
87 public FlushPolicy getFlushPolicy() {
88 return flushPolicy;
89 }
90
91 public void setFlushPolicy(FlushPolicy flushPolicy) {
92 this.flushPolicy = flushPolicy;
93 }
94
95 public CachePolicyExecutor getExecutor(CachePolicyResult.CachePolicyBehaviour behaviour) {
96 return (CachePolicyExecutor) executors.get(behaviour.getName());
97 }
98
99 public BrowserCachePolicy getBrowserCachePolicy() {
100 return browserCachePolicy;
101 }
102
103 public void setBrowserCachePolicy(BrowserCachePolicy browserCachePolicy) {
104 this.browserCachePolicy = browserCachePolicy;
105 }
106
107 public Map getExecutors() {
108 return executors;
109 }
110
111 public void setExecutors(Map executors) {
112 this.executors = executors;
113 }
114
115 public void addExecutor(String name, CachePolicyExecutor executor){
116 executor.setCacheConfiguration(this);
117 this.executors.put(name, executor);
118 }
119
120 }