KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > ist > coach > coachEmfClientComponents > gui > VisualIpProtocolMonitor


1 package ist.coach.coachEmfClientComponents.gui;
2
3 import javax.swing.ImageIcon JavaDoc;
4
5 import intt.itu.itut_x780.ManagedObjectValueType;
6 import ist.coach.coachEmsMib.IpProtocolMonitorValueType;
7 import ist.coach.coachEmfClientComponents.InvokeSetData;
8
9 import ist.coach.coachEmfCommon.Utils;
10 public class VisualIpProtocolMonitor
11 extends MOTreeObject {
12
13     static String JavaDoc[] subordinate_names = new String JavaDoc[0];
14
15     static boolean canRefresh = false;
16     static String JavaDoc object_type = "IpProtocolMonitor";
17     static String JavaDoc emsClassName = "ist.coach.coachEmsMib.IpProtocolMonitor_F";
18
19     static String JavaDoc DISPLAY_TYPE = "IP Protocol Monitor";
20
21         //
22
// create arguments
23
//
24
static String JavaDoc[] create_arg_name = new String JavaDoc[0];
25     static String JavaDoc[] create_arg_editor = new String JavaDoc[0];
26     static String JavaDoc[] create_arg_renderer = new String JavaDoc[0];
27     //
28
// get/set arguments
29
//
30

31     static String JavaDoc[] attributes_name = { //ManagedObject
32
"Name",
33                                         "Element Type",
34                                         "Creation Source",
35                                         "Delete Policy",
36                                             //IpProtocolMonitor
37
"IP Forwarding",
38                                         "Outgoing Default TTL",
39                                         "Incoming IP Datagrams Received",
40                                         "Incoming IP datagrams Discarded due to IP Header Errors",
41                                         "Incoming IP datagrams Discarded due to Address Errors",
42                                         "Incoming IP datagrams Forwarded",
43                                         "Incoming IP datagrams Discarded due to Unknown Protocols",
44                                         "Incoming IP datagrams Discarded not due to Error",
45                                         "Incoming IP datagrams Delivered",
46                                         "Outgoing IP datagrams Received",
47                                         "Outgoing IP datagrams Discarded not due to Error",
48                                         "Outgoing IP datagrams Discarded due to Destination Routing Errors",
49                                         "Maximum IP datagram Reassembly Time",
50                                         "IP datagrams Needing Reassembly",
51                                         "Successfully Reassembled IP datagrams",
52                                         "IP Layer Reassembly Failures",
53                                         "Successfully Fragmented IP datagrams",
54                                         "Failed to Fragment IP datagrams",
55                                         "IP Fragments",
56                                         "IP datagrams Discarded due to Routing Errors"
57                     };
58
59      static boolean[] attributes_readonly = {
60                     false,
61                     false,
62                     false,
63                     false,
64                     false,
65                     false,
66                     false,
67                     false,
68                     false,
69                     false,
70                     false,
71                     false,
72                     false,
73                     false,
74                     false,
75                     false,
76                     false,
77                     false,
78                     false,
79                     false,
80                     false,
81                     false,
82                     false,
83                     false
84     };
85
86     public VisualIpProtocolMonitor(String JavaDoc key) {
87         super(key);
88         leafIcon = new ImageIcon JavaDoc(VisualIpProtocolMonitor.class.getResource(
89                 "images/protocol_icon.gif"));
90         nodeIcon = new ImageIcon JavaDoc(VisualIpProtocolMonitor.class.getResource(
91                 "images/protocol_icon.gif"));
92          toolTipText = new String JavaDoc(DISPLAY_TYPE);
93     }
94
95     public Object JavaDoc[] translate_values(ManagedObjectValueType original_value_type) {
96
97         Object JavaDoc[] values = new Object JavaDoc[attributes_name.length];
98         for (int i = 0; i < values.length; i++)
99             values[i] = "unspecified";
100
101         if (original_value_type == null)
102             return values;
103
104         Object JavaDoc[] mo_values = super.translate_values(original_value_type);
105         int i = 0;
106         for (i = 0; i < mo_values.length; i++)
107             values[i] = mo_values[i];
108
109         IpProtocolMonitorValueType value_type;
110         value_type = (IpProtocolMonitorValueType) original_value_type;
111
112         switch(value_type.ipForwarding) {
113         case 2:
114             values[i++] = new String JavaDoc("Off");
115             break;
116         case 1:
117             values[i++] = new String JavaDoc("On");
118             break;
119         default:
120             values[i++] = new String JavaDoc("Unknown");
121             break;
122         }
123
124         if (value_type.ipDefaultTTL >= 0)
125             values[i] = String.valueOf(value_type.ipDefaultTTL);
126         i++;
127
128         values[i++] = String.valueOf(value_type.ipInReceives);
129         values[i++] = String.valueOf(value_type.ipInHdrErrors);
130         values[i++] = String.valueOf(value_type.ipInAddrErrors);
131         values[i++] = String.valueOf(value_type.ipForwDatagrams);
132         values[i++] = String.valueOf(value_type.ipInUnknownProtos);
133         values[i++] = String.valueOf(value_type.ipInDiscards);
134         values[i++] = String.valueOf(value_type.ipInDelivers);
135         values[i++] = String.valueOf(value_type.ipOutRequests);
136         values[i++] = String.valueOf(value_type.ipOutDiscards);
137         values[i++] = String.valueOf(value_type.ipNoRoutes);
138         values[i++] = String.valueOf(value_type.ipReasmTimeout);
139         values[i++] = String.valueOf(value_type.ipReasmReqds);
140         values[i++] = String.valueOf(value_type.ipReasmOKs);
141         values[i++] = String.valueOf(value_type.ipReasmFails);
142         values[i++] = String.valueOf(value_type.ipFragsOKs);
143         values[i++] = String.valueOf(value_type.ipFragFails);
144         values[i++] = String.valueOf(value_type.ipFragCreates);
145         values[i++] = String.valueOf(value_type.ipRoutingDiscards);
146
147         return values;
148     }
149
150     java.util.Vector JavaDoc translate_updates(java.util.Hashtable JavaDoc values) {
151
152         return new java.util.Vector JavaDoc();
153     }
154 }
155
Popular Tags