1 package ist.coach.coachEmfClientComponents.gui; 2 3 import javax.swing.ImageIcon ; 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 [] subordinate_names = new String [0]; 14 15 static boolean canRefresh = false; 16 static String object_type = "IpProtocolMonitor"; 17 static String emsClassName = "ist.coach.coachEmsMib.IpProtocolMonitor_F"; 18 19 static String DISPLAY_TYPE = "IP Protocol Monitor"; 20 21 static String [] create_arg_name = new String [0]; 25 static String [] create_arg_editor = new String [0]; 26 static String [] create_arg_renderer = new String [0]; 27 31 static String [] attributes_name = { "Name", 33 "Element Type", 34 "Creation Source", 35 "Delete Policy", 36 "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 key) { 87 super(key); 88 leafIcon = new ImageIcon (VisualIpProtocolMonitor.class.getResource( 89 "images/protocol_icon.gif")); 90 nodeIcon = new ImageIcon (VisualIpProtocolMonitor.class.getResource( 91 "images/protocol_icon.gif")); 92 toolTipText = new String (DISPLAY_TYPE); 93 } 94 95 public Object [] translate_values(ManagedObjectValueType original_value_type) { 96 97 Object [] values = new Object [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 [] 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 ("Off"); 115 break; 116 case 1: 117 values[i++] = new String ("On"); 118 break; 119 default: 120 values[i++] = new String ("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 translate_updates(java.util.Hashtable values) { 151 152 return new java.util.Vector (); 153 } 154 } 155 | Popular Tags |