1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package com.xpn.xwiki.api; |
21 |
|
|
22 |
|
import java.util.Collections; |
23 |
|
import java.util.List; |
24 |
|
import java.util.Map; |
25 |
|
|
26 |
|
import com.xpn.xwiki.XWikiContext; |
27 |
|
import com.xpn.xwiki.criteria.impl.Duration; |
28 |
|
import com.xpn.xwiki.criteria.impl.Period; |
29 |
|
import com.xpn.xwiki.criteria.impl.Range; |
30 |
|
import com.xpn.xwiki.criteria.impl.Scope; |
31 |
|
import com.xpn.xwiki.stats.api.XWikiStatsService; |
32 |
|
import com.xpn.xwiki.stats.impl.StatsUtil; |
33 |
|
|
34 |
|
|
35 |
|
|
36 |
|
|
37 |
|
@version |
38 |
|
|
|
|
| 3.6% |
Uncovered Elements: 54 (56) |
Complexity: 16 |
Complexity Density: 0.47 |
|
39 |
|
public class StatsService extends Api |
40 |
|
{ |
41 |
|
|
42 |
|
|
43 |
|
|
44 |
|
@param |
45 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
46 |
17738 |
public StatsService(XWikiContext context)... |
47 |
|
{ |
48 |
17741 |
super(context); |
49 |
|
} |
50 |
|
|
51 |
|
|
52 |
|
|
53 |
|
|
54 |
|
|
55 |
|
@link |
56 |
|
|
57 |
|
|
58 |
|
|
59 |
|
|
60 |
|
@return |
61 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
62 |
0 |
public boolean isEnabledGlobally()... |
63 |
|
{ |
64 |
0 |
return StatsUtil.isStatsEnabled(this.context); |
65 |
|
} |
66 |
|
|
67 |
|
|
68 |
|
|
69 |
|
|
70 |
|
|
71 |
|
|
72 |
|
|
73 |
|
|
74 |
|
|
75 |
|
|
76 |
|
|
77 |
|
@return |
78 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
79 |
0 |
public boolean isEnabledForCurrentWiki()... |
80 |
|
{ |
81 |
0 |
return StatsUtil.isWikiStatsEnabled(this.context); |
82 |
|
} |
83 |
|
|
84 |
|
|
85 |
|
|
86 |
|
|
87 |
|
|
88 |
|
|
89 |
|
|
90 |
|
|
91 |
|
|
92 |
|
|
93 |
|
|
94 |
|
@return |
95 |
|
@deprecated@link |
96 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
97 |
0 |
@Deprecated... |
98 |
|
public boolean isEnabled() |
99 |
|
{ |
100 |
0 |
return StatsUtil.isWikiStatsEnabled(this.context); |
101 |
|
} |
102 |
|
|
103 |
|
|
104 |
|
|
105 |
|
|
106 |
|
@param |
107 |
|
|
108 |
|
@param |
109 |
|
@param |
110 |
|
@param |
111 |
|
@return |
112 |
|
|
|
|
| 0% |
Uncovered Elements: 7 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
113 |
0 |
public List<?> getDocumentStatistics(String action, Scope scope, Period period, Range range)... |
114 |
|
{ |
115 |
0 |
List<?> stats = Collections.emptyList(); |
116 |
|
|
117 |
0 |
XWikiStatsService statsService = getXWikiContext().getWiki().getStatsService(getXWikiContext()); |
118 |
0 |
if (statsService != null) { |
119 |
0 |
stats = statsService.getDocumentStatistics(action, scope, period, range, getXWikiContext()); |
120 |
|
} |
121 |
|
|
122 |
0 |
return stats; |
123 |
|
} |
124 |
|
|
125 |
|
|
126 |
|
|
127 |
|
|
128 |
|
@param |
129 |
|
|
130 |
|
@param |
131 |
|
@param |
132 |
|
@return |
133 |
|
|
|
|
| 0% |
Uncovered Elements: 7 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
134 |
0 |
public List<?> getVisitStatistics(String action, Period period, Range range)... |
135 |
|
{ |
136 |
0 |
List<?> stats = Collections.emptyList(); |
137 |
|
|
138 |
0 |
XWikiStatsService statsService = getXWikiContext().getWiki().getStatsService(getXWikiContext()); |
139 |
0 |
if (statsService != null) { |
140 |
0 |
stats = statsService.getVisitStatistics(action, period, range, getXWikiContext()); |
141 |
|
} |
142 |
|
|
143 |
0 |
return stats; |
144 |
|
} |
145 |
|
|
146 |
|
|
147 |
|
|
148 |
|
|
149 |
|
@param |
150 |
|
|
151 |
|
@param |
152 |
|
@param |
153 |
|
@param |
154 |
|
@return |
155 |
|
|
|
|
| 0% |
Uncovered Elements: 7 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
156 |
0 |
public List<?> getRefererStatistics(String domain, Scope scope, Period period, Range range)... |
157 |
|
{ |
158 |
0 |
List<?> stats = Collections.emptyList(); |
159 |
|
|
160 |
0 |
XWikiStatsService statsService = getXWikiContext().getWiki().getStatsService(getXWikiContext()); |
161 |
0 |
if (statsService != null) { |
162 |
0 |
stats = statsService.getRefererStatistics(domain, scope, period, range, getXWikiContext()); |
163 |
|
} |
164 |
|
|
165 |
0 |
return stats; |
166 |
|
} |
167 |
|
|
168 |
|
|
169 |
|
|
170 |
|
|
171 |
|
@param |
172 |
|
@param |
173 |
|
@param |
174 |
|
@param |
175 |
|
@return |
176 |
|
|
|
|
| 0% |
Uncovered Elements: 7 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
177 |
0 |
public List<?> getBackLinkStatistics(String domain, Scope scope, Period period, Range range)... |
178 |
|
{ |
179 |
0 |
List<?> stats = Collections.emptyList(); |
180 |
|
|
181 |
0 |
XWikiStatsService statsService = getXWikiContext().getWiki().getStatsService(getXWikiContext()); |
182 |
0 |
if (statsService != null) { |
183 |
0 |
stats = statsService.getBackLinkStatistics(domain, scope, period, range, getXWikiContext()); |
184 |
|
} |
185 |
|
|
186 |
0 |
return stats; |
187 |
|
} |
188 |
|
|
189 |
|
|
190 |
|
|
191 |
|
|
192 |
|
@param |
193 |
|
@param |
194 |
|
@param |
195 |
|
@param |
196 |
|
@return |
197 |
|
|
|
|
| 0% |
Uncovered Elements: 7 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
198 |
0 |
public Map<?, ?> getActionStatistics(String action, Scope scope, Period period,... |
199 |
|
Duration step) |
200 |
|
{ |
201 |
0 |
Map<?, ?> stats = Collections.emptyMap(); |
202 |
|
|
203 |
0 |
XWikiStatsService statsService = getXWikiContext().getWiki().getStatsService(getXWikiContext()); |
204 |
0 |
if (statsService != null) { |
205 |
0 |
stats = statsService.getActionStatistics(action, scope, period, step, getXWikiContext()); |
206 |
|
} |
207 |
|
|
208 |
0 |
return stats; |
209 |
|
} |
210 |
|
|
211 |
|
|
212 |
|
|
213 |
|
|
214 |
|
@param |
215 |
|
@param |
216 |
|
@return |
217 |
|
|
|
|
| 0% |
Uncovered Elements: 7 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
218 |
0 |
public java.util.Collection<?> getRecentActions(String action, int size)... |
219 |
|
{ |
220 |
0 |
java.util.Collection<?> stats = Collections.emptyList(); |
221 |
|
|
222 |
0 |
XWikiStatsService statsService = getXWikiContext().getWiki().getStatsService(getXWikiContext()); |
223 |
0 |
if (statsService != null) { |
224 |
0 |
stats = statsService.getRecentActions(action, size, getXWikiContext()); |
225 |
|
} |
226 |
|
|
227 |
0 |
return stats; |
228 |
|
} |
229 |
|
} |