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.entry; |
35 |
|
|
36 |
|
import info.magnolia.module.cache.filter.CachedEntry; |
37 |
|
|
38 |
|
import java.io.IOException; |
39 |
|
|
40 |
|
import javax.servlet.FilterChain; |
41 |
|
import javax.servlet.ServletException; |
42 |
|
import javax.servlet.http.HttpServletRequest; |
43 |
|
import javax.servlet.http.HttpServletResponse; |
44 |
|
|
45 |
|
|
46 |
|
|
47 |
|
|
48 |
|
|
|
|
| 84.6% |
Uncovered Elements: 2 (13) |
Complexity: 3 |
Complexity Density: 0.33 |
|
49 |
|
public class SingleReplayCacheEntryWrapper implements CachedEntry { |
50 |
|
|
51 |
|
private CachedEntry delegate; |
52 |
|
private final long lastModificationTime; |
53 |
|
private final String originalURL; |
54 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
55 |
8 |
public SingleReplayCacheEntryWrapper(CachedEntry delegate) {... |
56 |
8 |
this.delegate = delegate; |
57 |
|
|
58 |
8 |
this.lastModificationTime = delegate.getLastModificationTime(); |
59 |
8 |
this.originalURL = delegate.getOriginalURL(); |
60 |
|
} |
61 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
62 |
|
@Override... |
63 |
|
public int getTimeToLiveInSeconds() { |
64 |
|
return -1; |
65 |
|
} |
66 |
|
|
|
|
| 75% |
Uncovered Elements: 2 (8) |
Complexity: 2 |
Complexity Density: 0.33 |
|
67 |
3 |
@Override... |
68 |
|
public void replay(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException { |
69 |
|
|
70 |
|
|
71 |
3 |
synchronized (this) { |
72 |
3 |
if (delegate != null) { |
73 |
3 |
delegate.replay(request, response, chain); |
74 |
3 |
delegate = null; |
75 |
3 |
return; |
76 |
|
} |
77 |
|
} |
78 |
0 |
throw new IllegalStateException("Already replayed !"); |
79 |
|
} |
80 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
81 |
|
@Override... |
82 |
|
public String getOriginalURL() { |
83 |
|
return originalURL; |
84 |
|
} |
85 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
86 |
|
@Override... |
87 |
|
public long getLastModificationTime() { |
88 |
|
return lastModificationTime; |
89 |
|
} |
90 |
|
} |