1
22
23 package com.liferay.portal.monitoring.jmx;
24
25 import com.liferay.portal.kernel.util.ArrayUtil;
26 import com.liferay.portal.monitoring.MonitoringException;
27 import com.liferay.portal.monitoring.statistics.portlet.PortletSummaryStatistics;
28 import com.liferay.portal.monitoring.statistics.portlet.ServerStatistics;
29
30 import java.util.Set;
31
32
39 public class PortletManager implements PortletManagerMBean {
40
41 public PortletManager(
42 ServerStatistics serverStatistics,
43 PortletSummaryStatistics portletSummaryStatistics) {
44
45 _serverStatistics = serverStatistics;
46 _portletSummaryStatistics = portletSummaryStatistics;
47 }
48
49 public long getAverageTime() throws MonitoringException {
50 return _portletSummaryStatistics.getAverageTime();
51 }
52
53 public long getAverageTimeByCompany(long companyId)
54 throws MonitoringException {
55
56 return _portletSummaryStatistics.getAverageTimeByCompany(companyId);
57 }
58
59 public long getAverageTimeByCompany(String webId)
60 throws MonitoringException {
61
62 return _portletSummaryStatistics.getAverageTimeByCompany(webId);
63 }
64
65 public long getAverageTimeByPortlet(String portletId)
66 throws MonitoringException {
67
68 return _portletSummaryStatistics.getAverageTimeByPortlet(portletId);
69 }
70
71 public long getAverageTimeByPortlet(String portletId, long companyId)
72 throws MonitoringException {
73
74 return _portletSummaryStatistics.getAverageTimeByPortlet(
75 portletId, companyId);
76 }
77
78 public long getAverageTimeByPortlet(String portletId, String webId)
79 throws MonitoringException {
80
81 return _portletSummaryStatistics.getAverageTimeByPortlet(
82 portletId, webId);
83 }
84
85 public long[] getCompanyIds() {
86 Set<Long> companyIds = _serverStatistics.getCompanyIds();
87
88 return ArrayUtil.toArray(
89 companyIds.toArray(new Long[companyIds.size()]));
90 }
91
92 public long getErrorCount() throws MonitoringException {
93 return _portletSummaryStatistics.getErrorCount();
94 }
95
96 public long getErrorCountByCompany(long companyId)
97 throws MonitoringException {
98
99 return _portletSummaryStatistics.getErrorCountByCompany(companyId);
100 }
101
102 public long getErrorCountByCompany(String webId)
103 throws MonitoringException {
104
105 return _portletSummaryStatistics.getErrorCountByCompany(webId);
106 }
107
108 public long getErrorCountByPortlet(String portletId)
109 throws MonitoringException {
110
111 return _portletSummaryStatistics.getErrorCountByPortlet(portletId);
112 }
113
114 public long getErrorCountByPortlet(String portletId, long companyId)
115 throws MonitoringException {
116
117 return _portletSummaryStatistics.getErrorCountByPortlet(
118 portletId, companyId);
119 }
120
121 public long getErrorCountByPortlet(String portletId, String webId)
122 throws MonitoringException {
123
124 return _portletSummaryStatistics.getErrorCountByPortlet(
125 portletId, webId);
126 }
127
128 public long getMaxTime() throws MonitoringException {
129 return _portletSummaryStatistics.getMaxTime();
130 }
131
132 public long getMaxTimeByCompany(long companyId) throws MonitoringException {
133 return _portletSummaryStatistics.getMaxTimeByCompany(companyId);
134 }
135
136 public long getMaxTimeByCompany(String webId) throws MonitoringException {
137 return _portletSummaryStatistics.getMaxTimeByCompany(webId);
138 }
139
140 public long getMaxTimeByPortlet(String portletId)
141 throws MonitoringException {
142
143 return _portletSummaryStatistics.getMaxTimeByPortlet(portletId);
144 }
145
146 public long getMaxTimeByPortlet(String portletId, long companyId)
147 throws MonitoringException {
148
149 return _portletSummaryStatistics.getMaxTimeByPortlet(
150 portletId, companyId);
151 }
152
153 public long getMaxTimeByPortlet(String portletId, String webId)
154 throws MonitoringException {
155
156 return _portletSummaryStatistics.getMaxTimeByPortlet(portletId, webId);
157 }
158
159 public long getMinTime() throws MonitoringException {
160 return _portletSummaryStatistics.getMinTime();
161 }
162
163 public long getMinTimeByCompany(long companyId) throws MonitoringException {
164 return _portletSummaryStatistics.getMinTimeByCompany(companyId);
165 }
166
167 public long getMinTimeByCompany(String webId) throws MonitoringException {
168 return _portletSummaryStatistics.getMinTimeByCompany(webId);
169 }
170
171 public long getMinTimeByPortlet(String portletId)
172 throws MonitoringException {
173
174 return _portletSummaryStatistics.getMinTimeByPortlet(portletId);
175 }
176
177 public long getMinTimeByPortlet(String portletId, long companyId)
178 throws MonitoringException {
179
180 return _portletSummaryStatistics.getMinTimeByPortlet(
181 portletId, companyId);
182 }
183
184 public long getMinTimeByPortlet(String portletId, String webId)
185 throws MonitoringException {
186
187 return _portletSummaryStatistics.getMinTimeByPortlet(portletId, webId);
188 }
189
190 public String[] getPortletIds() {
191 Set<String> portletIds = _serverStatistics.getPortletIds();
192
193 return portletIds.toArray(new String[portletIds.size()]);
194 }
195
196 public long getRequestCount() throws MonitoringException {
197 return _portletSummaryStatistics.getRequestCount();
198 }
199
200 public long getRequestCountByCompany(long companyId)
201 throws MonitoringException {
202
203 return _portletSummaryStatistics.getRequestCountByCompany(companyId);
204 }
205
206 public long getRequestCountByCompany(String webId)
207 throws MonitoringException {
208
209 return _portletSummaryStatistics.getRequestCountByCompany(webId);
210 }
211
212 public long getRequestCountByPortlet(String portletId)
213 throws MonitoringException {
214
215 return _portletSummaryStatistics.getRequestCountByPortlet(portletId);
216 }
217
218 public long getRequestCountByPortlet(String portletId, long companyId)
219 throws MonitoringException {
220
221 return _portletSummaryStatistics.getRequestCountByPortlet(
222 portletId, companyId);
223 }
224
225 public long getRequestCountByPortlet(String portletId, String webId)
226 throws MonitoringException {
227
228 return _portletSummaryStatistics.getRequestCountByPortlet(
229 portletId, webId);
230 }
231
232 public long getSuccessCount() throws MonitoringException {
233 return _portletSummaryStatistics.getSuccessCount();
234 }
235
236 public long getSuccessCountByCompany(long companyId)
237 throws MonitoringException {
238
239 return _portletSummaryStatistics.getSuccessCountByCompany(companyId);
240 }
241
242 public long getSuccessCountByCompany(String webId)
243 throws MonitoringException {
244
245 return _portletSummaryStatistics.getSuccessCountByCompany(webId);
246 }
247
248 public long getSuccessCountByPortlet(String portletId)
249 throws MonitoringException {
250
251 return _portletSummaryStatistics.getSuccessCountByPortlet(portletId);
252 }
253
254 public long getSuccessCountByPortlet(String portletId, long companyId)
255 throws MonitoringException {
256
257 return _portletSummaryStatistics.getSuccessCountByPortlet(
258 portletId, companyId);
259 }
260
261 public long getSuccessCountByPortlet(String portletId, String webId)
262 throws MonitoringException {
263
264 return _portletSummaryStatistics.getSuccessCountByPortlet(
265 portletId, webId);
266 }
267
268 public long getTimeoutCount() throws MonitoringException {
269 return _portletSummaryStatistics.getTimeoutCount();
270 }
271
272 public long getTimeoutCountByCompany(long companyId)
273 throws MonitoringException {
274
275 return _portletSummaryStatistics.getTimeoutCountByCompany(companyId);
276 }
277
278 public long getTimeoutCountByCompany(String webId)
279 throws MonitoringException {
280
281 return _portletSummaryStatistics.getTimeoutCountByCompany(webId);
282 }
283
284 public long getTimeoutCountByPortlet(String portletId)
285 throws MonitoringException {
286
287 return _portletSummaryStatistics.getTimeoutCountByPortlet(portletId);
288 }
289
290 public long getTimeoutCountByPortlet(String portletId, long companyId)
291 throws MonitoringException {
292
293 return _portletSummaryStatistics.getTimeoutCountByPortlet(
294 portletId, companyId);
295 }
296
297 public long getTimeoutCountByPortlet(String portletId, String webId)
298 throws MonitoringException {
299
300 return _portletSummaryStatistics.getTimeoutCountByPortlet(
301 portletId, webId);
302 }
303
304 public String[] getWebIds() {
305 Set<String> webIds = _serverStatistics.getWebIds();
306
307 return webIds.toArray(new String[webIds.size()]);
308 }
309
310 public void reset() {
311 _serverStatistics.reset();
312 }
313
314 public void reset(long companyId) {
315 _serverStatistics.reset(companyId);
316 }
317
318 public void reset(String webId) {
319 _serverStatistics.reset(webId);
320 }
321
322 private PortletSummaryStatistics _portletSummaryStatistics;
323 private ServerStatistics _serverStatistics;
324
325 }