1 package org.apache.commons.jcs.auxiliary;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.io.IOException;
23 import java.util.HashMap;
24 import java.util.Map;
25 import java.util.Set;
26
27 import org.apache.commons.jcs.engine.CacheStatus;
28 import org.apache.commons.jcs.engine.behavior.ICacheElement;
29 import org.apache.commons.jcs.engine.stats.behavior.IStats;
30
31
32
33
34
35
36 public class MockAuxiliaryCache<K, V>
37 extends AbstractAuxiliaryCache<K, V>
38 {
39
40 public CacheType cacheType = CacheType.DISK_CACHE;
41
42
43 public CacheStatus status = CacheStatus.ALIVE;
44
45
46 public int getMatchingCallCount = 0;
47
48
49
50
51
52 @Override
53 public void update( ICacheElement<K, V> ce )
54 throws IOException
55 {
56
57
58 }
59
60
61
62
63
64
65 @Override
66 public ICacheElement<K, V> get( K key )
67 throws IOException
68 {
69
70 return null;
71 }
72
73
74
75
76
77
78 @Override
79 public Map<K, ICacheElement<K, V>> getMatching(String pattern)
80 throws IOException
81 {
82 getMatchingCallCount++;
83 return new HashMap<K, ICacheElement<K, V>>();
84 }
85
86
87
88
89
90
91
92
93 @Override
94 public Map<K, ICacheElement<K, V>> getMultiple(Set<K> keys)
95 {
96 return new HashMap<K, ICacheElement<K, V>>();
97 }
98
99
100
101
102
103
104 @Override
105 public boolean remove( K key )
106 throws IOException
107 {
108
109 return false;
110 }
111
112
113
114
115 @Override
116 public void removeAll()
117 throws IOException
118 {
119
120
121 }
122
123
124
125
126 @Override
127 public void dispose()
128 throws IOException
129 {
130
131
132 }
133
134
135
136
137 @Override
138 public int getSize()
139 {
140
141 return 0;
142 }
143
144
145
146
147 @Override
148 public CacheStatus getStatus()
149 {
150 return status;
151 }
152
153
154
155
156 @Override
157 public String getCacheName()
158 {
159 return null;
160 }
161
162
163
164
165
166
167 @Override
168 public Set<K> getKeySet() throws IOException
169 {
170 return null;
171 }
172
173
174
175
176 @Override
177 public IStats getStatistics()
178 {
179 return null;
180 }
181
182
183
184
185 @Override
186 public String getStats()
187 {
188 return null;
189 }
190
191
192
193
194 @Override
195 public CacheType getCacheType()
196 {
197 return cacheType;
198 }
199
200
201
202
203 @Override
204 public AuxiliaryCacheAttributes getAuxiliaryCacheAttributes()
205 {
206 return null;
207 }
208
209
210 @Override
211 public String getEventLoggingExtraInfo()
212 {
213 return null;
214 }
215 }