01: package com.sun.portal.rproxy.monitoring.statistics;
02:
03: import com.sun.portal.monitoring.statistics.StatisticWrapper;
04: import com.sun.portal.monitoring.statistics.StatisticImpl;
05:
06: import javax.management.openmbean.OpenType;
07: import javax.management.openmbean.SimpleType;
08:
09: /**
10: * author: Noble Paul
11: * Date: Feb 10, 2005, 10:22:15 AM
12: */
13: public class InternalServerStatisticWrapper extends StatisticWrapper {
14: public static final String DESTINATION = "Destination";
15:
16: public static final String TOTAL_REQUESTS = "TotalRequests";
17:
18: public static final String TOTAL_RESPONSES = "TotalResponses";
19:
20: public static final String BYTES_SENT = "BytesSent";
21:
22: public static final String BYTES_RECVD = "BytesReceived";
23:
24: public static final String BAD_REQ = "Badrequests";
25:
26: public static final String SERVER_ERR = "ServerErrors";
27:
28: public static final String AVG_RESP_TIME = "AvgResponseTime";
29:
30: public static final String MAX_RESP_TIME = "MaxResponseTime";
31:
32: public static final String MIN_RESP_TIME = "MinResponseTime";
33:
34: public String getCompositeTypeName() {
35: return getClass().getName();
36: }
37:
38: public String[] getItemNames() {
39: return new String[] { DESTINATION, TOTAL_REQUESTS,
40: TOTAL_RESPONSES, BYTES_SENT, BYTES_RECVD, BAD_REQ,
41: SERVER_ERR, AVG_RESP_TIME, MIN_RESP_TIME,
42: MAX_RESP_TIME, "Description", "LastSampleTime", "Name",
43: "StartTime", "Unit" };
44: }
45:
46: public String[] getItemDescriptions() {
47: return getItemNames();
48: }
49:
50: public OpenType[] getItemTypes() {
51: return new OpenType[] {
52: SimpleType.STRING, //destination
53: SimpleType.LONG, //Total Requests
54: SimpleType.LONG, //Totalresponsee
55: SimpleType.LONG, //BytesSent
56: SimpleType.LONG, //Bytesrecvd
57: SimpleType.LONG, //Badreq
58: SimpleType.LONG, //ServerError
59: SimpleType.LONG, //Average resp Time
60: SimpleType.LONG, //MinRespTime
61: SimpleType.LONG, //MaxRespTime
62: SimpleType.STRING, //Common Properties
63: SimpleType.LONG, SimpleType.STRING, SimpleType.LONG,
64: SimpleType.STRING };
65: }
66:
67: public StatisticImpl getStatisticImpl() {
68: if (statisticImpl == null) {
69: statisticImpl = new InternalServerStatisticImpl();
70: }
71: return statisticImpl;
72: }
73:
74: public Object[] getItemValues() {
75: InternalServerStatisticImpl internalServerStatistic = (InternalServerStatisticImpl) getStatisticImpl();
76: return new Object[] { internalServerStatistic.getDestination(),
77: new Long(internalServerStatistic.getTotalRequests()),
78: new Long(internalServerStatistic.getTotalResponses()),
79: new Long(internalServerStatistic.getBytesSent()),
80: new Long(internalServerStatistic.getBytesReceived()),
81: new Long(internalServerStatistic.getBadrequests()),
82: new Long(internalServerStatistic.getServerErrors()),
83: new Long(internalServerStatistic.getAvgResponseTime()),
84: new Long(internalServerStatistic.getMinResponseTime()),
85: new Long(internalServerStatistic.getMaxResponseTime()),
86: internalServerStatistic.getDescription(),
87: new Long(internalServerStatistic.getLastSampleTime()),
88: internalServerStatistic.getName(),
89: new Long(internalServerStatistic.getStartTime()),
90: internalServerStatistic.getUnit() };
91: }
92:
93: }
|