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.IpRoutingEntryValueType; 7 import ist.coach.coachEmfClientComponents.InvokeSetData; 8 9 import ist.coach.coachEmfCommon.Utils; 10 public class VisualIpRoutingEntry 11 extends MOTreeObject { 12 13 static String [] subordinate_names = new String [0]; 14 15 static boolean canRefresh = false; 16 static String object_type = "IpRoutingEntry"; 17 static String emsClassName = "ist.coach.coachEmsMib.IpRoutingEntry_F"; 18 19 static String DISPLAY_TYPE = "IP Routing Entry"; 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 "Destination IP Address", 38 "Logical Interface Index", 39 "Primary Routing Metric", 40 "Alternate Routing Metric", 41 "Alternate Routing Metric", 42 "Alternate Routing Metric", 43 "IP Address of Next Hop", 44 "Type of Route", 45 "Routing Protocol", 46 "Seconds since Last Update", 47 "Subnet Mask", 48 "Alternate Routing Metric", 49 "MIB Object Identifier" 50 51 }; 52 53 static boolean[] attributes_readonly = { 54 false, 56 false, 57 false, 58 false, 59 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 74 }; 75 76 public VisualIpRoutingEntry(String key) { 77 super(key); 78 leafIcon = new ImageIcon (VisualIpRoutingEntry.class.getResource( 79 "images/iproutingentry_icon.gif")); 80 nodeIcon = new ImageIcon (VisualIpRoutingEntry.class.getResource( 81 "images/iproutingentry_icon.gif")); 82 toolTipText = new String (DISPLAY_TYPE); 83 } 84 85 public Object [] translate_values(ManagedObjectValueType original_value_type) { 86 87 Object [] values = new Object [attributes_name.length]; 88 for (int i = 0; i < values.length; i++) 89 values[i] = "unspecified"; 90 91 if (original_value_type == null) 92 return values; 93 94 Object [] mo_values = super.translate_values(original_value_type); 95 int i = 0; 96 for (i = 0; i < mo_values.length; i++) 97 values[i] = mo_values[i]; 98 99 IpRoutingEntryValueType value_type; 100 value_type = (IpRoutingEntryValueType) original_value_type; 101 102 if (value_type.ipRouteDest != null && value_type.ipRouteDest.length > 0) 103 values[i] = new String (value_type.ipRouteDest); 104 i++; 105 106 values[i++] = String.valueOf(value_type.ipRouteIfIndex); 107 values[i++] = String.valueOf(value_type.ipRouteMetric1); 108 109 if (value_type.ipRouteMetric2 > 0) 110 values[i] = String.valueOf(value_type.ipRouteMetric2); 111 i++; 112 113 if (value_type.ipRouteMetric3 > 0) 114 values[i] = String.valueOf(value_type.ipRouteMetric3); 115 i++; 116 117 if (value_type.ipRouteMetric4 > 0) 118 values[i] = String.valueOf(value_type.ipRouteMetric4); 119 i++; 120 121 if (value_type.ipRouteNextHop != null && value_type.ipRouteNextHop.length > 0) 122 values[i] = new String (value_type.ipRouteNextHop); 123 i++; 124 125 switch(value_type.ipRouteType) { 127 case 1: 128 values[i] = new String ("Other (neither direct/indirect/invalid)"); 129 break; 130 case 2: 131 values[i] = new String ("Invalidated Route"); 132 break; 133 case 3: 134 values[i] = new String ("Route to directly connected sub-network"); 135 break; 136 case 4: 137 values[i] = new String ("Route to a non-local host/network/sub-network"); 138 break; 139 default: 140 break; 141 } 142 i++; 143 144 switch(value_type.ipRouteProto) { 146 case 1: 147 values[i] = new String ("Other (neither local/setted by management/routing protocol)"); 148 break; 149 case 2: 150 values[i] = new String ("Local (manually configured)"); 151 break; 152 case 3: 153 values[i] = new String ("Set via management protocol"); 154 break; 155 case 4: 156 values[i] = new String ("ICMP obtained"); 157 break; 158 case 5: 159 values[i] = new String ("EGP gateway routing protocol"); 160 break; 161 case 6: 162 values[i] = new String ("GGP gateway routing protocol"); 163 break; 164 case 7: 165 values[i] = new String ("HELLO gateway routing protocol"); 166 break; 167 case 8: 168 values[i] = new String ("RIP gateway routing protocol"); 169 break; 170 case 9: 171 values[i] = new String ("IS-IS gateway routing protocol"); 172 break; 173 case 10: 174 values[i] = new String ("ES-IS ateway routing protocol"); 175 break; 176 case 11: 177 values[i] = new String ("CISCO IGRP gateway routing protocol"); 178 break; 179 case 12: 180 values[i] = new String ("BbnSpfIGP gateway routing protocol"); 181 break; 182 case 13: 183 values[i] = new String ("OSPF gateway routing protocol"); 184 break; 185 case 14: 186 values[i] = new String ("BGP gateway routing protocol"); 187 break; 188 default: 189 break; 190 } 191 i++; 192 if (value_type.ipRouteAge > 0) 193 values[i] = String.valueOf(value_type.ipRouteAge); 194 i++; 195 196 if (value_type.ipRouteMask != null && value_type.ipRouteMask.length > 0) 197 values[i] = new String (value_type.ipRouteMask); 198 i++; 199 200 if (value_type.ipRouteMetric5 > 0) 201 values[i] = String.valueOf(value_type.ipRouteMetric5); 202 i++; 203 if (value_type.ipRouteInfo != null && value_type.ipRouteInfo.length() > 0) 204 values[i] = value_type.ipRouteInfo; 205 i++; 206 207 218 219 return values; 220 } 221 222 java.util.Vector translate_updates(java.util.Hashtable values) { 223 224 return new java.util.Vector (); 225 } 226 } 227 | Popular Tags |