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.apache.synapse.SynapseConstants;
19: import org.wso2.esb.persistence.dataobject.StatisticsDO;
20:
21: /**
22: *
23: */
24:
25: public class SynapseServiceStatisticsView extends
26: AbstractStatisticsView implements
27: SynapseServiceStatisticsViewMBean {
28:
29: public SynapseServiceStatisticsView() {
30: super ();
31: }
32:
33: public int viewTotalCount(String direction) {
34: StatisticsDO[] resultSet = serviceAdmin
35: .getProxyServiceStatistics(SynapseConstants.SYNAPSE_SERVICE_NAME);
36: return getTotalCount(resultSet, direction);
37: }
38:
39: public int viewFaultCount(String direction) {
40: StatisticsDO[] resultSet = serviceAdmin
41: .getProxyServiceStatistics(SynapseConstants.SYNAPSE_SERVICE_NAME);
42: return getFaultCount(resultSet, direction);
43: }
44:
45: public double viewMaxTime(String direction) {
46: StatisticsDO[] resultSet = serviceAdmin
47: .getProxyServiceStatistics(SynapseConstants.SYNAPSE_SERVICE_NAME);
48: return getMaxTime(resultSet, direction);
49: }
50:
51: public double viewMinTime(String direction) {
52: StatisticsDO[] resultSet = serviceAdmin
53: .getProxyServiceStatistics(SynapseConstants.SYNAPSE_SERVICE_NAME);
54: return getMinTime(resultSet, direction);
55: }
56:
57: public double viewAvgTime(String direction) {
58: StatisticsDO[] resultSet = serviceAdmin
59: .getProxyServiceStatistics(SynapseConstants.SYNAPSE_SERVICE_NAME);
60: return getAvgTime(resultSet, direction);
61: }
62: }
|