01: /*
02: * Copyright (c) 2006, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.wso2.esb.jmx.mbean;
17:
18: import org.wso2.esb.persistence.dataobject.StatisticsDO;
19:
20: /**
21: *
22: */
23:
24: public class SequenceStatisticsView extends AbstractStatisticsView
25: implements SequenceStatisticsViewMBean {
26: public SequenceStatisticsView() {
27: super ();
28: }
29:
30: public String[] listSequences() {
31: String[] names = serviceAdmin.listSequence();
32: if (names != null && names.length != 0) {
33: return names;
34: } else {
35: return new String[] { NODATA };
36: }
37: }
38:
39: public int getTotalCount(String sequenceName, String direction) {
40: StatisticsDO[] resultSet = serviceAdmin
41: .getSequenceStatistics(sequenceName);
42: return getTotalCount(resultSet, direction);
43: }
44:
45: public int getFaultCount(String sequenceName, String direction) {
46: StatisticsDO[] resultSet = serviceAdmin
47: .getSequenceStatistics(sequenceName);
48: return getFaultCount(resultSet, direction);
49: }
50:
51: public double getMaxTime(String sequenceName, String direction) {
52: StatisticsDO[] resultSet = serviceAdmin
53: .getSequenceStatistics(sequenceName);
54: return getMaxTime(resultSet, direction);
55: }
56:
57: public double getMinTime(String sequenceName, String direction) {
58: StatisticsDO[] resultSet = serviceAdmin
59: .getSequenceStatistics(sequenceName);
60: return getMinTime(resultSet, direction);
61: }
62:
63: public double getAvgTime(String sequenceName, String direction) {
64: StatisticsDO[] resultSet = serviceAdmin
65: .getSequenceStatistics(sequenceName);
66: return getAvgTime(resultSet, direction);
67: }
68:
69: }
|