01: package com.sun.portal.netlet.monitoring.statistics;
02:
03: import com.sun.portal.monitoring.statistics.StatisticWrapper;
04: import com.sun.portal.monitoring.statistics.CountStatisticImpl;
05:
06: import javax.management.openmbean.OpenType;
07: import javax.management.openmbean.SimpleType;
08:
09: /**
10: * author: Noble Paul
11: * Date: Feb 15, 2005, 12:08:23 PM
12: */
13: public class NetletConnectionStatisticWrapper extends StatisticWrapper {
14: public static final String USER_ID = "UserId";
15: public static final String DESTINATION = "Destination";
16: public static final String BYTES_SENT = "BytesSent";
17: public static final String BYTES_RECVD = "BytesReceived";
18: public static final String DURATION = "Duration";
19: public static final String NETLET_RULE = "NetletRule";
20:
21: public String[] getItemNames() {
22: return new String[] { USER_ID, DESTINATION, BYTES_SENT,
23: BYTES_RECVD, DURATION, NETLET_RULE, "Description",
24: "LastSampleTime", "Name", "StartTime", "Unit" };
25: }
26:
27: public String getCompositeTypeName() {
28: return getClass().getName();
29: }
30:
31: public OpenType[] getItemTypes() {
32: return new OpenType[] {
33: SimpleType.STRING,//UserID
34: SimpleType.STRING,//Destination
35: SimpleType.LONG,//BytesSent
36: SimpleType.LONG,//BytesReceived
37: SimpleType.LONG,//Duration
38: SimpleType.STRING,//NetletRule
39: SimpleType.STRING,//Common Properties
40: SimpleType.LONG, SimpleType.STRING, SimpleType.LONG,
41: SimpleType.STRING };
42: }
43:
44: public String[] getItemDescriptions() {
45: return getItemNames();
46: }
47:
48: public Object[] getItemValues() {
49: NetletConnectionStatisticImpl statistic = (NetletConnectionStatisticImpl) getStatisticImpl();
50: return new Object[] { statistic.getUserId(),
51: statistic.getDestination(),
52: new Long(statistic.getBytesSent()),
53: new Long(statistic.getBytesReceived()),
54: new Long(statistic.getDuration()),
55: statistic.getNetletRule(), statistic.getDescription(),
56: new Long(statistic.getLastSampleTime()),
57: statistic.getName(),
58: new Long(statistic.getStartTime()), statistic.getUnit() };
59: }
60:
61: }
|