KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > ist > coach > coachEmsMibComponents > IpRoutingEntryProviderComposition > IpRoutingEntryProviderImpl


1 /*====================================================================
2
3 This file was produced by the OpenCCM CIF_JIMPL generator.
4
5 OpenCCM: The Open CORBA Component Model Platform
6 Copyright (C) 2000-2003 INRIA - USTL - LIFL - GOAL
7 Contact: openccm@objectweb.org
8
9 This library is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Lesser General Public
11 License as published by the Free Software Foundation; either
12 version 2.1 of the License, or any later version.
13
14 This library is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 Lesser General Public License for more details.
18
19 You should have received a copy of the GNU Lesser General Public
20 License along with this library; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22 USA
23
24 Initial developer(s): Christophe Demarey.
25 Contributor(s): ______________________________________.
26
27 ====================================================================*/

28
29 package ist.coach.coachEmsMibComponents.IpRoutingEntryProviderComposition;
30
31 import intt.itu.itut_x780.UIDType;
32 import intt.itu.itut_x780.CreateError;
33 import intt.itu.itut_x780.ApplicationError;
34 import intt.itu.itut_x780.SourceIndicatorType;
35 import intt.itu.itut_x780.AttributeValueType;
36
37 import ist.coach.coachEmfCommon.Utils;
38
39 import ist.coach.coachEmfCommon.ObjectDeletionImpl;
40 import ist.coach.coachEmfCommon.ExceptionMessages;
41
42 import ist.coach.coachEmfCommon.ApplicationErrorInfoTypeImpl;
43 import ist.coach.coachEmfCommon.DataTypeImpl;
44 import ist.coach.coachEmfServices.SnmpAdapter.DataType;
45 import ist.coach.coachEmfServices.SnmpAdapter.SnmpApplicationError;
46
47 import ist.coach.coachEmsMib.IpRoutingEntryValueType;
48 import ist.coach.coachEmsCommon.SnmpIdentifiers;
49 import ist.coach.coachEmsCommon.IpRoutingEntryValueTypeImpl;
50
51 import org.omg.CosNaming.NameComponent JavaDoc;
52 import org.omg.CORBA.TCKind JavaDoc;
53
54 import org.opennms.protocols.snmp.SnmpSMI;
55 import ist.coach.coachEmfServices.EmfBasicLog.*;
56 import java.util.Hashtable JavaDoc;
57 /**
58  * This is the CIDL-based implementation of the
59  * OMG IDL3 IDL:coach.ist/coachEmsMibComponents/IpRoutingEntryProvider:1.0 component type.
60  *
61  * @author OpenCCM CIF_Jimpl Compiler.
62  */

63 public class IpRoutingEntryProviderImpl
64      extends ist.coach.coachEmsMibComponents.IpRoutingEntryProviderComposition.IpRoutingEntryProvider_impl
65 {
66     // ==================================================================
67
//
68
// Internal states.
69
//
70
// ==================================================================
71
org.omg.CORBA.ORB JavaDoc orb = null;
72     private String JavaDoc _facade_name;
73
74     protected static Hashtable JavaDoc elements;
75     private static int notifId = 14000;
76     private BasicLog logSupport;
77
78     ist.coach.coachEmfServices.SnmpAdapter.SnmpConnector connector = null;
79
80     private static final String JavaDoc READ_COMMUNITY = SnmpIdentifiers.READ_COMMUNITY;
81     private static final String JavaDoc WRITE_COMMUNITY = SnmpIdentifiers.WRITE_COMMUNITY;
82     // ==================================================================
83
//
84
// Constructors.
85
//
86
// ==================================================================
87

88     public IpRoutingEntryProviderImpl()
89     {
90         elements = new Hashtable JavaDoc();
91     }
92     //
93
// IDL:omg.org/Components/EnterpriseComponent/configuration_complete:1.0
94
//
95
/**
96      ** Completes the component configuration.
97      **
98      ** @throws org.omg.Components.InvalidConfiguration
99      ** Thrown if the configuration is invalid.
100      **/

101     public void
102     configuration_complete()
103     throws org.omg.Components.InvalidConfiguration
104     {
105         //
106
// DONE : implement !!!
107
//
108

109         if ((connector = get_context().get_connection_connector()) == null)
110             throw new org.omg.Components.InvalidConfiguration();
111         if ((logSupport = get_context().get_connection_basic_log()) == null)
112             throw new org.omg.Components.InvalidConfiguration();
113
114         orb = org.objectweb.ccm.CORBA.TheORB.getORB();
115
116         System.err.println("IpRoutingEntryProvider configuration completed...");
117
118     }
119     // ==================================================================
120
//
121
// Methods.
122
//
123
// ==================================================================
124

125     /**
126      * Implementation of the ::itut_x780Components::CCM_NamedComponent_Executor::facade_name attribute as accessor operation.
127      */

128     public String JavaDoc
129     facade_name()
130     {
131         //
132
// DONE : Implement
133
//
134
return _facade_name;
135     }
136
137     /**
138      * Implementation of the ::itut_x780Components::CCM_NamedComponent_Executor::facade_name attribute as mutator operation.
139      */

140     public void
141     facade_name(String JavaDoc val)
142     {
143         //
144
// DONE : implement
145
//
146
if (val != null)
147             _facade_name = new String JavaDoc(val);
148     }
149
150     /**
151      * Implementation of the ::coachEmsMib::IpRoutingEntry_F::ipRouteDestGet operation.
152      */

153     public byte[]
154     ipRouteDestGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
155     throws intt.itu.itut_x780.ApplicationError
156     {
157         //
158
// DONE : implement
159
//
160
String JavaDoc key = Utils.name2string(name);
161
162         if (elements.containsKey(key) == false) {
163             ApplicationErrorInfoTypeImpl error_code =
164                 new ApplicationErrorInfoTypeImpl();
165
166             error_code.error = new UIDType(
167                 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
168                 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
169
170             error_code.details = new String JavaDoc("object with name " +
171                 key + " does not exist.");
172
173             throw new ApplicationError(error_code);
174         }
175
176         IpRoutingEntryStructure data =
177             (IpRoutingEntryStructure) elements.get(key);
178
179         return data.routeDest.getBytes();
180     }
181
182     /**
183      * Implementation of the ::coachEmsMib::IpRoutingEntry_F::ipRouteDestSet operation.
184      */

185     public void
186     ipRouteDestSet(org.omg.CosNaming.NameComponent JavaDoc[] name, byte[] ipRouteDest)
187     throws intt.itu.itut_x780.ApplicationError,
188
189            ist.coach.coachEmsMib.NOipRouteInfoSetPackageException
190     {
191         //
192
// TODO : Implement
193
//
194
}
195
196     /**
197      * Implementation of the ::coachEmsMib::IpRoutingEntry_F::ipRouteIfIndexGet operation.
198      */

199     public int
200     ipRouteIfIndexGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
201     throws intt.itu.itut_x780.ApplicationError
202     {
203         //
204
// DONE : Implement
205
//
206

207         String JavaDoc key = Utils.name2string(name);
208
209         if (elements.containsKey(key) == false) {
210             ApplicationErrorInfoTypeImpl error_code =
211                 new ApplicationErrorInfoTypeImpl();
212
213             error_code.error = new UIDType(
214                 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
215                 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
216
217             error_code.details = new String JavaDoc("object with name " +
218                 key + " does not exist.");
219
220             throw new ApplicationError(error_code);
221         }
222
223         IpRoutingEntryStructure data =
224             (IpRoutingEntryStructure) elements.get(key);
225
226         String JavaDoc ipRouteIfIndexOID = SnmpIdentifiers.IP_ROUTE_IFINDEX_OID + "." + data.routeDest;
227         DataType ipRouteIfIndexData = null;
228
229         try {
230             ipRouteIfIndexData = connector.get(
231                 ipRouteIfIndexOID,
232                 new String JavaDoc (data.getMgmtIpAddress()),
233                 data.getSnmpPort(),
234                 SnmpIdentifiers.READ_COMMUNITY);
235         }
236         catch (SnmpApplicationError e) {
237
238             ApplicationErrorInfoTypeImpl error_code =
239                 new ApplicationErrorInfoTypeImpl();
240
241             error_code.error = new UIDType(
242                 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
243                 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
244
245             if (e.reason.equals(ExceptionMessages.agent_response_error))
246                 error_code.details = ExceptionMessages.agent_response_error;
247             else
248                 error_code.details = new String JavaDoc ("Could not retrieve ipRouteIfIndex " +
249                     "for IpRoutingEntry Object with name " + key + ":" +
250                     "\n Object with Snmp Object Identifier " + ipRouteIfIndexOID +
251                     " does not exist.");
252
253             Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
254               (short) LogSeverity._Error,
255               "SNMP Error getting ipRouteIfIndex: " + e.reason);
256               throw new ApplicationError (error_code);
257         }
258
259         org.omg.CORBA.Any JavaDoc value = ipRouteIfIndexData.value;
260
261
262         if (value.type().kind().value() != TCKind._tk_long) {
263             ApplicationErrorInfoTypeImpl error_code =
264                 new ApplicationErrorInfoTypeImpl();
265
266             error_code.error = new UIDType(
267                 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
268                 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
269
270             error_code.details = new String JavaDoc ("IpRoutingEntry> Could not retrieve ipRouteIfIndex " +
271                 "for IpRoutingEntry Object with name " + key + ":" +
272                 "\n Object with Snmp Object Identifier " + ipRouteIfIndexOID +
273                 " is not of expected type.");
274             /***if (value.type().kind().value() == TCKind._tk_string) {
275                 System.err.println("ipRouteIfIndex = " +value.extract_string());
276                 return -1;
277             }
278             else
279             ******/

280             throw new ApplicationError (error_code);
281
282         }
283
284         int ipRouteIfIndex = value.extract_long();
285         return ipRouteIfIndex;
286
287     }
288
289     /**
290      * Implementation of the ::coachEmsMib::IpRoutingEntry_F::ipRouteIfIndexSet operation.
291      */

292     public void
293     ipRouteIfIndexSet(org.omg.CosNaming.NameComponent JavaDoc[] name, int ipRouteIfIndex)
294     throws intt.itu.itut_x780.ApplicationError,
295
296            ist.coach.coachEmsMib.NOipRouteInfoSetPackageException
297     {
298         //
299
// TODO : Implement
300
//
301
}
302
303     /**
304      * Implementation of the ::coachEmsMib::IpRoutingEntry_F::ipRouteMetric1Get operation.
305      */

306     public int
307     ipRouteMetric1Get(org.omg.CosNaming.NameComponent JavaDoc[] name)
308     throws intt.itu.itut_x780.ApplicationError
309     {
310         //
311
// DONE : Implement
312
//
313

314         String JavaDoc key = Utils.name2string(name);
315
316         if (elements.containsKey(key) == false) {
317             ApplicationErrorInfoTypeImpl error_code =
318                 new ApplicationErrorInfoTypeImpl();
319
320             error_code.error = new UIDType(
321                 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
322                 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
323
324             error_code.details = new String JavaDoc("object with name " +
325                 key + " does not exist.");
326
327             throw new ApplicationError(error_code);
328         }
329
330         IpRoutingEntryStructure data =
331             (IpRoutingEntryStructure) elements.get(key);
332
333         String JavaDoc ipRouteMetricOID = SnmpIdentifiers.IP_ROUTE_METRIC1_OID + "." + data.routeDest;
334         DataType ipRouteMetricData = null;
335
336         try {
337             ipRouteMetricData = connector.get(
338                 ipRouteMetricOID,
339                 new String JavaDoc (data.getMgmtIpAddress()),
340                 data.getSnmpPort(),
341                 SnmpIdentifiers.READ_COMMUNITY);
342         }
343         catch (SnmpApplicationError e) {
344
345             ApplicationErrorInfoTypeImpl error_code =
346                 new ApplicationErrorInfoTypeImpl();
347
348             error_code.error = new UIDType(
349                 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
350                 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
351
352             if (e.reason.equals(ExceptionMessages.agent_response_error))
353                 error_code.details = ExceptionMessages.agent_response_error;
354             else
355                 error_code.details = new String JavaDoc ("Could not retrieve ipRouteMetric1OID " +
356                     "for IpRoutingEntry Object with name " + key + ":" +
357                     "\n Object with Snmp Object Identifier " + ipRouteMetricOID +
358                     " does not exist.");
359
360             Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
361               (short) LogSeverity._Error,
362               "SNMP Error getting ipRouteMetric1OID: " + e.reason);
363
364             throw new ApplicationError (error_code);
365         }
366
367         org.omg.CORBA.Any JavaDoc value = ipRouteMetricData.value;
368
369
370         if (value.type().kind().value() != TCKind._tk_long) {
371             ApplicationErrorInfoTypeImpl error_code =
372                 new ApplicationErrorInfoTypeImpl();
373
374             error_code.error = new UIDType(
375                 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
376                 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
377
378             error_code.details = new String JavaDoc ("IpRoutingEntry> Could not retrieve ipRouteMetric1OID " +
379                 "for IpRoutingEntry Object with name " + key + ":" +
380                 " Object with Snmp Object Identifier " + ipRouteMetricOID +
381                 " is not of expected type.");
382
383             throw new ApplicationError (error_code);
384
385         }
386
387         int ipRouteMetric = value.extract_long();
388         return ipRouteMetric;
389
390     }
391
392     /**
393      * Implementation of the ::coachEmsMib::IpRoutingEntry_F::ipRouteMetric1Set operation.
394      */

395     public void
396     ipRouteMetric1Set(org.omg.CosNaming.NameComponent JavaDoc[] name, int ipRouteMetric1)
397     throws intt.itu.itut_x780.ApplicationError,
398
399            ist.coach.coachEmsMib.NOipRouteMetricsPackageException
400     {
401         //
402
// TODO : Implement
403
//
404
}
405
406     /**
407      * Implementation of the ::coachEmsMib::IpRoutingEntry_F::ipRouteMetric2Get operation.
408      */

409     public int
410     ipRouteMetric2Get(org.omg.CosNaming.NameComponent JavaDoc[] name)
411     throws intt.itu.itut_x780.ApplicationError,
412
413            ist.coach.coachEmsMib.NOipRouteMetricsPackageException
414     {
415        //
416
// DONE : Implement
417
//
418

419         String JavaDoc key = Utils.name2string(name);
420
421         if (elements.containsKey(key) == false) {
422             ApplicationErrorInfoTypeImpl error_code =
423                 new ApplicationErrorInfoTypeImpl();
424
425             error_code.error = new UIDType(
426                 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
427                 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
428
429             error_code.details = new String JavaDoc("object with name " +
430                 key + " does not exist.");
431
432             throw new ApplicationError(error_code);
433         }
434
435         IpRoutingEntryStructure data =
436             (IpRoutingEntryStructure) elements.get(key);
437
438         String JavaDoc ipRouteMetricOID = SnmpIdentifiers.IP_ROUTE_METRIC2_OID + "." + data.routeDest;
439         DataType ipRouteMetricData = null;
440
441         try {
442             ipRouteMetricData = connector.get(
443                 ipRouteMetricOID,
444                 new String JavaDoc (data.getMgmtIpAddress()),
445                 data.getSnmpPort(),
446                 SnmpIdentifiers.READ_COMMUNITY);
447         }
448         catch (SnmpApplicationError e) {
449
450             ApplicationErrorInfoTypeImpl error_code =
451                 new ApplicationErrorInfoTypeImpl();
452
453             error_code.error = new UIDType(
454                 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
455                 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
456
457             if (e.reason.equals(ExceptionMessages.agent_response_error))
458                 error_code.details = ExceptionMessages.agent_response_error;
459             else
460                 error_code.details = new String JavaDoc ("Could not retrieve ipRouteMetric2OID " +
461                     "for IpRoutingEntry Object with name " + key + ":" +
462                     "\n Object with Snmp Object Identifier " + ipRouteMetricOID +
463                     " does not exist.");
464
465             Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
466               (short) LogSeverity._Error,
467               "SNMP Error getting ipRouteMetric2OID: " + e.reason);
468
469             throw new ApplicationError (error_code);
470         }
471
472         org.omg.CORBA.Any JavaDoc value = ipRouteMetricData.value;
473
474
475         if (value.type().kind().value() != TCKind._tk_long) {
476             ApplicationErrorInfoTypeImpl error_code =
477                 new ApplicationErrorInfoTypeImpl();
478
479             error_code.error = new UIDType(
480                 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
481                 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
482
483             error_code.details = new String JavaDoc ("IpRoutingEntry> Could not retrieve ipRouteMetric2OID " +
484                 "for IpRoutingEntry Object with name " + key + ":" +
485                 " Object with Snmp Object Identifier " + ipRouteMetricOID +
486                 " is not of expected type.");
487
488             throw new ApplicationError (error_code);
489
490         }
491
492         int ipRouteMetric = value.extract_long();
493         return ipRouteMetric;
494
495     }
496
497     /**
498      * Implementation of the ::coachEmsMib::IpRoutingEntry_F::ipRouteMetric2Set operation.
499      */

500     public void
501     ipRouteMetric2Set(org.omg.CosNaming.NameComponent JavaDoc[] name, int ipRouteMetric2)
502     throws intt.itu.itut_x780.ApplicationError,
503
504            ist.coach.coachEmsMib.NOipRouteMetricsPackageException,
505
506            ist.coach.coachEmsMib.NOipRouteInfoSetPackageException
507     {
508         //
509
// TODO : Implement
510
//
511
}
512
513     /**
514      * Implementation of the ::coachEmsMib::IpRoutingEntry_F::ipRouteMetric3Get operation.
515      */

516     public int
517     ipRouteMetric3Get(org.omg.CosNaming.NameComponent JavaDoc[] name)
518     throws intt.itu.itut_x780.ApplicationError,
519
520            ist.coach.coachEmsMib.NOipRouteMetricsPackageException
521     {
522        //
523
// DONE : Implement
524
//
525

526         String JavaDoc key = Utils.name2string(name);
527
528         if (elements.containsKey(key) == false) {
529             ApplicationErrorInfoTypeImpl error_code =
530                 new ApplicationErrorInfoTypeImpl();
531
532             error_code.error = new UIDType(
533                 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
534                 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
535
536             error_code.details = new String JavaDoc("object with name " +
537                 key + " does not exist.");
538
539             throw new ApplicationError(error_code);
540         }
541
542         IpRoutingEntryStructure data =
543             (IpRoutingEntryStructure) elements.get(key);
544
545         String JavaDoc ipRouteMetricOID = SnmpIdentifiers.IP_ROUTE_METRIC3_OID + "." + data.routeDest;
546         DataType ipRouteMetricData = null;
547
548         try {
549             ipRouteMetricData = connector.get(
550                 ipRouteMetricOID,
551                 new String JavaDoc (data.getMgmtIpAddress()),
552                 data.getSnmpPort(),
553                 SnmpIdentifiers.READ_COMMUNITY);
554         }
555         catch (SnmpApplicationError e) {
556
557             ApplicationErrorInfoTypeImpl error_code =
558                 new ApplicationErrorInfoTypeImpl();
559
560             error_code.error = new UIDType(
561                 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
562                 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
563
564             if (e.reason.equals(ExceptionMessages.agent_response_error))
565                 error_code.details = ExceptionMessages.agent_response_error;
566             else
567                 error_code.details = new String JavaDoc ("Could not retrieve ipRouteMetric3OID " +
568                     "for IpRoutingEntry Object with name " + key + ":" +
569                     "\n Object with Snmp Object Identifier " + ipRouteMetricOID +
570                     " does not exist.");
571
572             Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
573               (short) LogSeverity._Error,
574               "SNMP Error getting ipRouteMetric3OID: " + e.reason);
575
576             throw new ApplicationError (error_code);
577         }
578
579         org.omg.CORBA.Any JavaDoc value = ipRouteMetricData.value;
580
581
582         if (value.type().kind().value() != TCKind._tk_long) {
583             ApplicationErrorInfoTypeImpl error_code =
584                 new ApplicationErrorInfoTypeImpl();
585
586             error_code.error = new UIDType(
587                 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
588                 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
589
590             error_code.details = new String JavaDoc ("IpRoutingEntry> Could not retrieve ipRouteMetric3OID " +
591                 "for IpRoutingEntry Object with name " + key + ":" +
592                 " Object with Snmp Object Identifier " + ipRouteMetricOID +
593                 " is not of expected type.");
594
595             throw new ApplicationError (error_code);
596
597         }
598
599         int ipRouteMetric = value.extract_long();
600         return ipRouteMetric;
601
602     }
603
604     /**
605      * Implementation of the ::coachEmsMib::IpRoutingEntry_F::ipRouteMetric3Set operation.
606      */

607     public void
608     ipRouteMetric3Set(org.omg.CosNaming.NameComponent JavaDoc[] name, int ipRouteMetric3)
609     throws intt.itu.itut_x780.ApplicationError,
610
611            ist.coach.coachEmsMib.NOipRouteMetricsPackageException,
612
613            ist.coach.coachEmsMib.NOipRouteInfoSetPackageException
614     {
615         //
616
// TODO : Implement
617
//
618
}
619
620     /**
621      * Implementation of the ::coachEmsMib::IpRoutingEntry_F::ipRouteMetric4Get operation.
622      */

623     public int
624     ipRouteMetric4Get(org.omg.CosNaming.NameComponent JavaDoc[] name)
625     throws intt.itu.itut_x780.ApplicationError,
626
627            ist.coach.coachEmsMib.NOipRouteMetricsPackageException
628     {
629        //
630
// DONE : Implement
631
//
632

633         String JavaDoc key = Utils.name2string(name);
634
635         if (elements.containsKey(key) == false) {
636             ApplicationErrorInfoTypeImpl error_code =
637                 new ApplicationErrorInfoTypeImpl();
638
639             error_code.error = new UIDType(
640                 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
641                 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
642
643             error_code.details = new String JavaDoc("object with name " +
644                 key + " does not exist.");
645
646             throw new ApplicationError(error_code);
647         }
648
649         IpRoutingEntryStructure data =
650             (IpRoutingEntryStructure) elements.get(key);
651
652         String JavaDoc ipRouteMetricOID = SnmpIdentifiers.IP_ROUTE_METRIC4_OID + "." + data.routeDest;
653         DataType ipRouteMetricData = null;
654
655         try {
656             ipRouteMetricData = connector.get(
657                 ipRouteMetricOID,
658                 new String JavaDoc (data.getMgmtIpAddress()),
659                 data.getSnmpPort(),
660                 SnmpIdentifiers.READ_COMMUNITY);
661         }
662         catch (SnmpApplicationError e) {
663
664             ApplicationErrorInfoTypeImpl error_code =
665                 new ApplicationErrorInfoTypeImpl();
666
667             error_code.error = new UIDType(
668                 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
669                 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
670
671             if (e.reason.equals(ExceptionMessages.agent_response_error))
672                 error_code.details = ExceptionMessages.agent_response_error;
673             else
674                 error_code.details = new String JavaDoc ("Could not retrieve ipRouteMetric4OID " +
675                     "for IpRoutingEntry Object with name " + key + ":" +
676                     "\n Object with Snmp Object Identifier " + ipRouteMetricOID +
677                     " does not exist.");
678
679             Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
680               (short) LogSeverity._Error,
681               "SNMP Error getting ipRouteMetric4OID: " + e.reason);
682
683             throw new ApplicationError (error_code);
684         }
685
686         org.omg.CORBA.Any JavaDoc value = ipRouteMetricData.value;
687
688
689         if (value.type().kind().value() != TCKind._tk_long) {
690             ApplicationErrorInfoTypeImpl error_code =
691                 new ApplicationErrorInfoTypeImpl();
692
693             error_code.error = new UIDType(
694                 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
695                 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
696
697             error_code.details = new String JavaDoc ("IpRoutingEntry> Could not retrieve ipRouteMetric4OID " +
698                 "for IpRoutingEntry Object with name " + key + ":" +
699                 " Object with Snmp Object Identifier " + ipRouteMetricOID +
700                 " is not of expected type.");
701
702             throw new ApplicationError (error_code);
703
704         }
705
706         int ipRouteMetric = value.extract_long();
707         return ipRouteMetric;
708
709     }
710
711     /**
712      * Implementation of the ::coachEmsMib::IpRoutingEntry_F::ipRouteMetric4Set operation.
713      */

714     public void
715     ipRouteMetric4Set(org.omg.CosNaming.NameComponent JavaDoc[] name, int ipRouteMetric4)
716     throws intt.itu.itut_x780.ApplicationError,
717     ist.coach.coachEmsMib.NOipRouteMetricsPackageException,
718     ist.coach.coachEmsMib.NOipRouteInfoSetPackageException
719     {
720         //
721
// TODO : Implement
722
//
723
}
724
725     /**
726      * Implementation of the ::coachEmsMib::IpRoutingEntry_F::ipRouteNextHopGet operation.
727      */

728     public byte[]
729     ipRouteNextHopGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
730     throws intt.itu.itut_x780.ApplicationError
731     {
732         //
733
// DONE : Implement
734
//
735

736         String JavaDoc key = Utils.name2string(name);
737
738         if (elements.containsKey(key) == false) {
739             ApplicationErrorInfoTypeImpl error_code =
740                 new ApplicationErrorInfoTypeImpl();
741
742             error_code.error = new UIDType(
743                 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
744                 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
745
746             error_code.details = new String JavaDoc("object with name " +
747                 key + " does not exist.");
748
749             throw new ApplicationError(error_code);
750         }
751
752         IpRoutingEntryStructure data =
753             (IpRoutingEntryStructure) elements.get(key);
754
755         String JavaDoc ipRouteNHopOID = SnmpIdentifiers.IP_ROUTE_NHOP_OID + "." + data.routeDest;
756         DataType ipRouteNHopData = null;
757
758         try {
759             ipRouteNHopData = connector.get(
760                 ipRouteNHopOID,
761                 new String JavaDoc (data.getMgmtIpAddress()),
762                 data.getSnmpPort(),
763                 SnmpIdentifiers.READ_COMMUNITY);
764         }
765         catch (SnmpApplicationError e) {
766
767             ApplicationErrorInfoTypeImpl error_code =
768                 new ApplicationErrorInfoTypeImpl();
769
770             error_code.error = new UIDType(
771                 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
772                 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
773
774             if (e.reason.equals(ExceptionMessages.agent_response_error))
775                 error_code.details = ExceptionMessages.agent_response_error;
776             else
777                 error_code.details = new String JavaDoc ("Could not retrieve ipRouteNHopOID " +
778                     "for IpRoutingEntry Object with name " + key + ":" +
779                     "\n Object with Snmp Object Identifier " + ipRouteNHopOID +
780                     " does not exist.");
781
782             Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
783               (short) LogSeverity._Error,
784               "SNMP Error getting ipRouteNHopOID: " + e.reason);
785
786             throw new ApplicationError (error_code);
787         }
788
789         org.omg.CORBA.Any JavaDoc value = ipRouteNHopData.value;
790
791
792         if (value.type().kind().value() != TCKind._tk_string) {
793             ApplicationErrorInfoTypeImpl error_code =
794                 new ApplicationErrorInfoTypeImpl();
795
796             error_code.error = new UIDType(
797                 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
798                 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
799
800             error_code.details = new String JavaDoc ("IpRoutingEntry> Could not retrieve ipRouteNHopOID " +
801                 "for IpRoutingEntry Object with name " + key + ":" +
802                 " Object with Snmp Object Identifier " + ipRouteNHopOID +
803                 " is not of expected type.");
804
805             throw new ApplicationError (error_code);
806
807         }
808
809         String JavaDoc ipRouteNHop = value.extract_string();
810         return ipRouteNHop.getBytes();
811
812     }
813
814     /**
815      * Implementation of the ::coachEmsMib::IpRoutingEntry_F::IpRouteNextHopSet operation.
816      */

817     public void
818     IpRouteNextHopSet(org.omg.CosNaming.NameComponent JavaDoc[] name, byte[] ipRouteNextHop)
819     throws intt.itu.itut_x780.ApplicationError,
820
821            ist.coach.coachEmsMib.NOipRouteInfoSetPackageException
822     {
823         //
824
// TODO : Implement
825
//
826
}
827
828     /**
829      * Implementation of the ::coachEmsMib::IpRoutingEntry_F::ipRouteTypeGet operation.
830      */

831     public int
832     ipRouteTypeGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
833     throws intt.itu.itut_x780.ApplicationError
834     {
835         String JavaDoc key = Utils.name2string(name);
836
837         if (elements.containsKey(key) == false) {
838             ApplicationErrorInfoTypeImpl error_code =
839                 new ApplicationErrorInfoTypeImpl();
840
841             error_code.error = new UIDType(
842                 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
843                 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
844
845             error_code.details = new String JavaDoc("object with name " +
846                 key + " does not exist.");
847
848             throw new ApplicationError(error_code);
849         }
850
851         IpRoutingEntryStructure data =
852             (IpRoutingEntryStructure) elements.get(key);
853
854         String JavaDoc ipRouteTypeOID = SnmpIdentifiers.IP_ROUTE_TYPE_OID + "." + data.routeDest;
855         DataType ipRouteTypeData = null;
856
857         try {
858             ipRouteTypeData = connector.get(
859                 ipRouteTypeOID,
860                 new String JavaDoc (data.getMgmtIpAddress()),
861                 data.getSnmpPort(),
862                 SnmpIdentifiers.READ_COMMUNITY);
863         }
864         catch (SnmpApplicationError e) {
865
866             ApplicationErrorInfoTypeImpl error_code =
867                 new ApplicationErrorInfoTypeImpl();
868
869             error_code.error = new UIDType(
870                 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
871                 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
872
873             if (e.reason.equals(ExceptionMessages.agent_response_error))
874                 error_code.details = ExceptionMessages.agent_response_error;
875             else
876                 error_code.details = new String JavaDoc ("Could not retrieve ipRouteTypeOID " +
877                     "for IpRoutingEntry Object with name " + key + ":" +
878                     "\n Object with Snmp Object Identifier " + ipRouteTypeOID +
879                     " does not exist.");
880
881
882             Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
883               (short) LogSeverity._Error,
884               "SNMP Error getting ipRouteTypeOID: " + e.reason);
885
886
887             throw new ApplicationError (error_code);
888         }
889
890         org.omg.CORBA.Any JavaDoc value = ipRouteTypeData.value;
891
892
893         if (value.type().kind().value() != TCKind._tk_long) {
894             ApplicationErrorInfoTypeImpl error_code =
895                 new ApplicationErrorInfoTypeImpl();
896
897             error_code.error = new UIDType(
898                 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
899                 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
900
901             error_code.details = new String JavaDoc ("IpRoutingEntry> Could not retrieve ipRouteTypeOID " +
902                 "for IpRoutingEntry Object with name " + key + ":" +
903                 " Object with Snmp Object Identifier " + ipRouteTypeOID +
904                 " is not of expected type.");
905
906             throw new ApplicationError (error_code);
907
908         }
909
910         int ipRouteType = value.extract_long();
911         return ipRouteType;
912     }
913
914     /**
915      * Implementation of the ::coachEmsMib::IpRoutingEntry_F::ipRouteTypeSet operation.
916      */

917     public void
918     ipRouteTypeSet(org.omg.CosNaming.NameComponent JavaDoc[] name, int ipRouteType)
919     throws intt.itu.itut_x780.ApplicationError,
920
921            ist.coach.coachEmsMib.NOipRouteInfoSetPackageException
922     {
923         //
924
// TODO : Implement
925
//
926
}
927
928     /**
929      * Implementation of the ::coachEmsMib::IpRoutingEntry_F::ipRouteProtoGet operation.
930      */

931     public int
932     ipRouteProtoGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
933     throws intt.itu.itut_x780.ApplicationError
934     {
935         String JavaDoc key = Utils.name2string(name);
936
937         if (elements.containsKey(key) == false) {
938             ApplicationErrorInfoTypeImpl error_code =
939                 new ApplicationErrorInfoTypeImpl();
940
941             error_code.error = new UIDType(
942                 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
943                 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
944
945             error_code.details = new String JavaDoc("object with name " +
946                 key + " does not exist.");
947
948             throw new ApplicationError(error_code);
949         }
950
951         IpRoutingEntryStructure data =
952             (IpRoutingEntryStructure) elements.get(key);
953
954         String JavaDoc ipRouteProtoOID = SnmpIdentifiers.IP_ROUTE_PROTO_OID + "." + data.routeDest;
955         DataType ipRouteProtoData = null;
956
957         try {
958             ipRouteProtoData = connector.get(
959                 ipRouteProtoOID,
960                 new String JavaDoc (data.getMgmtIpAddress()),
961                 data.getSnmpPort(),
962                 SnmpIdentifiers.READ_COMMUNITY);
963         }
964         catch (SnmpApplicationError e) {
965
966             ApplicationErrorInfoTypeImpl error_code =
967                 new ApplicationErrorInfoTypeImpl();
968
969             error_code.error = new UIDType(
970                 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
971                 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
972
973             if (e.reason.equals(ExceptionMessages.agent_response_error))
974                 error_code.details = ExceptionMessages.agent_response_error;
975             else
976                 error_code.details = new String JavaDoc ("Could not retrieve ipRouteProtoOID " +
977                     "for IpRoutingEntry Object with name " + key + ":" +
978                     "\n Object with Snmp Object Identifier " + ipRouteProtoOID +
979                     " does not exist.");
980
981             Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
982               (short) LogSeverity._Error,
983               "SNMP Error getting ipRouteProtoOID: " + e.reason);
984             throw new ApplicationError (error_code);
985         }
986
987         org.omg.CORBA.Any JavaDoc value = ipRouteProtoData.value;
988
989
990         if (value.type().kind().value() != TCKind._tk_long) {
991             ApplicationErrorInfoTypeImpl error_code =
992                 new ApplicationErrorInfoTypeImpl();
993
994             error_code.error = new UIDType(
995                 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
996                 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
997
998             error_code.details = new String JavaDoc ("IpRoutingEntry> Could not retrieve ipRouteProtoOID " +
999                 "for IpRoutingEntry Object with name " + key + ":" +
1000                " Object with Snmp Object Identifier " + ipRouteProtoOID +
1001                " is not of expected type.");
1002
1003            throw new ApplicationError (error_code);
1004
1005        }
1006
1007        int ipRouteProto = value.extract_long();
1008        return ipRouteProto;
1009    }
1010
1011    /**
1012     * Implementation of the ::coachEmsMib::IpRoutingEntry_F::ipRouteProtoSet operation.
1013     */

1014    public void
1015    ipRouteProtoSet(org.omg.CosNaming.NameComponent JavaDoc[] name, int ipRouteProto)
1016    throws intt.itu.itut_x780.ApplicationError,
1017
1018           ist.coach.coachEmsMib.NOipRouteInfoSetPackageException
1019    {
1020
1021    }
1022
1023    /**
1024     * Implementation of the ::coachEmsMib::IpRoutingEntry_F::ipRouteAgeGet operation.
1025     */

1026    public int
1027    ipRouteAgeGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
1028    throws intt.itu.itut_x780.ApplicationError,
1029    ist.coach.coachEmsMib.NOipRouteAgePackageException
1030    {
1031        String JavaDoc key = Utils.name2string(name);
1032
1033        if (elements.containsKey(key) == false) {
1034            ApplicationErrorInfoTypeImpl error_code =
1035                new ApplicationErrorInfoTypeImpl();
1036
1037            error_code.error = new UIDType(
1038                intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1039                intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1040
1041            error_code.details = new String JavaDoc("object with name " +
1042                key + " does not exist.");
1043
1044            throw new ApplicationError(error_code);
1045        }
1046
1047        IpRoutingEntryStructure data =
1048            (IpRoutingEntryStructure) elements.get(key);
1049
1050        String JavaDoc ipRouteAgeOID = SnmpIdentifiers.IP_ROUTE_AGE_OID + "." + data.routeDest;
1051        DataType ipRouteAgeData = null;
1052
1053        try {
1054            ipRouteAgeData = connector.get(
1055                ipRouteAgeOID,
1056                new String JavaDoc (data.getMgmtIpAddress()),
1057                data.getSnmpPort(),
1058                SnmpIdentifiers.READ_COMMUNITY);
1059        }
1060        catch (SnmpApplicationError e) {
1061
1062            ApplicationErrorInfoTypeImpl error_code =
1063                new ApplicationErrorInfoTypeImpl();
1064
1065            error_code.error = new UIDType(
1066                intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1067                intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1068
1069            if (e.reason.equals(ExceptionMessages.agent_response_error))
1070                error_code.details = ExceptionMessages.agent_response_error;
1071            else
1072                error_code.details = new String JavaDoc ("Could not retrieve ipRouteAgeOID " +
1073                    "for IpRoutingEntry Object with name " + key + ":" +
1074                    "\n Object with Snmp Object Identifier " + ipRouteAgeOID +
1075                    " does not exist.");
1076
1077            Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
1078              (short) LogSeverity._Error,
1079              "SNMP Error getting ipRouteAgeOID: " + e.reason);
1080              throw new ApplicationError (error_code);
1081        }
1082
1083        org.omg.CORBA.Any JavaDoc value = ipRouteAgeData.value;
1084
1085
1086        if (value.type().kind().value() != TCKind._tk_long) {
1087            ApplicationErrorInfoTypeImpl error_code =
1088                new ApplicationErrorInfoTypeImpl();
1089
1090            error_code.error = new UIDType(
1091                intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1092                intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1093
1094            error_code.details = new String JavaDoc ("IpRoutingEntry> Could not retrieve ipRouteAgeOID " +
1095                "for IpRoutingEntry Object with name " + key + ":" +
1096                " Object with Snmp Object Identifier " + ipRouteAgeOID +
1097                " is not of expected type.");
1098
1099            throw new ApplicationError (error_code);
1100
1101        }
1102
1103        int ipRouteAge = value.extract_long();
1104        return ipRouteAge;
1105    }
1106
1107    /**
1108     * Implementation of the ::coachEmsMib::IpRoutingEntry_F::ipRouteMaskGet operation.
1109     */

1110    public byte[]
1111    ipRouteMaskGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
1112    throws intt.itu.itut_x780.ApplicationError
1113    {
1114        //
1115
// DONE : Implement
1116
//
1117

1118        String JavaDoc key = Utils.name2string(name);
1119
1120        if (elements.containsKey(key) == false) {
1121            ApplicationErrorInfoTypeImpl error_code =
1122                new ApplicationErrorInfoTypeImpl();
1123
1124            error_code.error = new UIDType(
1125                intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1126                intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1127
1128            error_code.details = new String JavaDoc("object with name " +
1129                key + " does not exist.");
1130
1131            throw new ApplicationError(error_code);
1132        }
1133
1134        IpRoutingEntryStructure data =
1135            (IpRoutingEntryStructure) elements.get(key);
1136
1137        String JavaDoc ipRouteMaskOID = SnmpIdentifiers.IP_ROUTE_MASK_OID + "." + data.routeDest;
1138        DataType ipRouteMaskData = null;
1139
1140        try {
1141            ipRouteMaskData = connector.get(
1142                ipRouteMaskOID,
1143                new String JavaDoc (data.getMgmtIpAddress()),
1144                data.getSnmpPort(),
1145                SnmpIdentifiers.READ_COMMUNITY);
1146        }
1147        catch (SnmpApplicationError e) {
1148
1149            ApplicationErrorInfoTypeImpl error_code =
1150                new ApplicationErrorInfoTypeImpl();
1151
1152            error_code.error = new UIDType(
1153                intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1154                intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1155
1156            if (e.reason.equals(ExceptionMessages.agent_response_error))
1157                error_code.details = ExceptionMessages.agent_response_error;
1158            else
1159                error_code.details = new String JavaDoc ("Could not retrieve ipRouteMaskOID " +
1160                    "for IpRoutingEntry Object with name " + key + ":" +
1161                    "\n Object with Snmp Object Identifier " + ipRouteMaskOID +
1162                    " does not exist.");
1163          Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
1164              (short) LogSeverity._Error,
1165              "SNMP Error getting ipRouteMaskOID: " + e.reason);
1166              throw new ApplicationError (error_code);
1167        }
1168
1169        org.omg.CORBA.Any JavaDoc value = ipRouteMaskData.value;
1170
1171
1172        if (value.type().kind().value() != TCKind._tk_string) {
1173            ApplicationErrorInfoTypeImpl error_code =
1174                new ApplicationErrorInfoTypeImpl();
1175
1176            error_code.error = new UIDType(
1177                intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1178                intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1179
1180            error_code.details = new String JavaDoc ("IpRoutingEntry> Could not retrieve ipRouteMaskOID " +
1181                "for IpRoutingEntry Object with name " + key + ":" +
1182                " Object with Snmp Object Identifier " + ipRouteMaskOID +
1183                " is not of expected type.");
1184
1185            throw new ApplicationError (error_code);
1186
1187        }
1188
1189        String JavaDoc ipRouteMask = value.extract_string();
1190        return ipRouteMask.getBytes();
1191
1192    }
1193
1194    /**
1195     * Implementation of the ::coachEmsMib::IpRoutingEntry_F::ipRouteMaskSet operation.
1196     */

1197    public void
1198    ipRouteMaskSet(org.omg.CosNaming.NameComponent JavaDoc[] name, byte[] ipRouteMask)
1199    throws intt.itu.itut_x780.ApplicationError,
1200    ist.coach.coachEmsMib.NOipRouteInfoSetPackageException
1201    {
1202        //
1203
// TODO : Implement
1204
//
1205
}
1206
1207    /**
1208     * Implementation of the ::coachEmsMib::IpRoutingEntry_F::ipRouteMetric5Get operation.
1209     */

1210    public int
1211    ipRouteMetric5Get(org.omg.CosNaming.NameComponent JavaDoc[] name)
1212    throws intt.itu.itut_x780.ApplicationError
1213    {
1214       //
1215
// DONE : Implement
1216
//
1217

1218        String JavaDoc key = Utils.name2string(name);
1219
1220        if (elements.containsKey(key) == false) {
1221            ApplicationErrorInfoTypeImpl error_code =
1222                new ApplicationErrorInfoTypeImpl();
1223
1224            error_code.error = new UIDType(
1225                intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1226                intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1227
1228            error_code.details = new String JavaDoc("object with name " +
1229                key + " does not exist.");
1230
1231            throw new ApplicationError(error_code);
1232        }
1233
1234        IpRoutingEntryStructure data =
1235            (IpRoutingEntryStructure) elements.get(key);
1236
1237        String JavaDoc ipRouteMetricOID = SnmpIdentifiers.IP_ROUTE_METRIC5_OID + "." + data.routeDest;
1238        DataType ipRouteMetricData = null;
1239
1240        try {
1241            ipRouteMetricData = connector.get(
1242                ipRouteMetricOID,
1243                new String JavaDoc (data.getMgmtIpAddress()),
1244                data.getSnmpPort(),
1245                SnmpIdentifiers.READ_COMMUNITY);
1246        }
1247        catch (SnmpApplicationError e) {
1248
1249            ApplicationErrorInfoTypeImpl error_code =
1250                new ApplicationErrorInfoTypeImpl();
1251
1252            error_code.error = new UIDType(
1253                intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1254                intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1255
1256            if (e.reason.equals(ExceptionMessages.agent_response_error))
1257                error_code.details = ExceptionMessages.agent_response_error;
1258            else
1259                error_code.details = new String JavaDoc ("Could not retrieve ipRouteMetric5OID " +
1260                    "for IpRoutingEntry Object with name " + key + ":" +
1261                    "\n Object with Snmp Object Identifier " + ipRouteMetricOID +
1262                    " does not exist.");
1263
1264          Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
1265              (short) LogSeverity._Error,
1266              "SNMP Error getting ipRouteMetric5OID: " + e.reason);
1267            throw new ApplicationError (error_code);
1268        }
1269
1270        org.omg.CORBA.Any JavaDoc value = ipRouteMetricData.value;
1271
1272
1273        if (value.type().kind().value() != TCKind._tk_long) {
1274            ApplicationErrorInfoTypeImpl error_code =
1275                new ApplicationErrorInfoTypeImpl();
1276
1277            error_code.error = new UIDType(
1278                intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1279                intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1280
1281            error_code.details = new String JavaDoc ("IpRoutingEntry> Could not retrieve ipRouteMetric5OID " +
1282                "for IpRoutingEntry Object with name " + key + ":" +
1283                " Object with Snmp Object Identifier " + ipRouteMetricOID +
1284                " is not of expected type.");
1285
1286            throw new ApplicationError (error_code);
1287
1288        }
1289
1290        int ipRouteMetric = value.extract_long();
1291        return ipRouteMetric;
1292
1293    }
1294
1295    /**
1296     * Implementation of the ::coachEmsMib::IpRoutingEntry_F::ipRouteMetric5Set operation.
1297     */

1298    public void
1299    ipRouteMetric5Set(org.omg.CosNaming.NameComponent JavaDoc[] name, int ipRouteMetric5)
1300    throws intt.itu.itut_x780.ApplicationError,
1301
1302           ist.coach.coachEmsMib.NOipRouteMetricsPackageException,
1303
1304           ist.coach.coachEmsMib.NOipRouteInfoSetPackageException
1305    {
1306        //
1307
// TODO : Implement
1308
//
1309
}
1310
1311    /**
1312     * Implementation of the ::coachEmsMib::IpRoutingEntry_F::ipRouteInfoGet operation.
1313     */

1314    public String JavaDoc
1315    ipRouteInfoGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
1316    throws intt.itu.itut_x780.ApplicationError
1317    {
1318       //
1319
// DONE : Implement
1320
//
1321

1322        String JavaDoc key = Utils.name2string(name);
1323
1324        if (elements.containsKey(key) == false) {
1325            ApplicationErrorInfoTypeImpl error_code =
1326                new ApplicationErrorInfoTypeImpl();
1327
1328            error_code.error = new UIDType(
1329                intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1330                intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1331
1332            error_code.details = new String JavaDoc("object with name " +
1333                key + " does not exist.");
1334
1335            throw new ApplicationError(error_code);
1336        }
1337
1338        IpRoutingEntryStructure data =
1339            (IpRoutingEntryStructure) elements.get(key);
1340
1341        String JavaDoc ipRouteInfoOID = SnmpIdentifiers.IP_ROUTE_INFO_OID + "." + data.routeDest;
1342        DataType ipRouteInfoData = null;
1343
1344        try {
1345            ipRouteInfoData = connector.get(
1346                ipRouteInfoOID,
1347                new String JavaDoc (data.getMgmtIpAddress()),
1348                data.getSnmpPort(),
1349                SnmpIdentifiers.READ_COMMUNITY);
1350        }
1351        catch (SnmpApplicationError e) {
1352
1353            ApplicationErrorInfoTypeImpl error_code =
1354                new ApplicationErrorInfoTypeImpl();
1355
1356            error_code.error = new UIDType(
1357                intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1358                intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1359
1360            if (e.reason.equals(ExceptionMessages.agent_response_error))
1361                error_code.details = ExceptionMessages.agent_response_error;
1362            else
1363                error_code.details = new String JavaDoc ("Could not retrieve ipRouteInfoOID " +
1364                    "for IpRoutingEntry Object with name " + key + ":" +
1365                    "\n Object with Snmp Object Identifier " + ipRouteInfoOID +
1366                    " does not exist.");
1367
1368            Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
1369              (short) LogSeverity._Error,
1370              "SNMP Error getting ipRouteInfoOID: " + e.reason);
1371            throw new ApplicationError (error_code);
1372        }
1373
1374        org.omg.CORBA.Any JavaDoc value = ipRouteInfoData.value;
1375
1376
1377        if (value.type().kind().value() != TCKind._tk_string) {
1378            ApplicationErrorInfoTypeImpl error_code =
1379                new ApplicationErrorInfoTypeImpl();
1380
1381            error_code.error = new UIDType(
1382                intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1383                intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1384
1385            error_code.details = new String JavaDoc ("IpRoutingEntry> Could not retrieve ipRouteInfoOID " +
1386                "for IpRoutingEntry Object with name " + key + ":" +
1387                " Object with Snmp Object Identifier " + ipRouteInfoOID +
1388                " is not of expected type.");
1389
1390            throw new ApplicationError (error_code);
1391
1392        }
1393
1394        String JavaDoc ipRouteInfo = value.extract_string();
1395        return ipRouteInfo;
1396
1397    }
1398
1399    /**
1400     * Implementation of the ::itut_x780::ManagedObject_F::nameGet operation.
1401     */

1402    public org.omg.CosNaming.NameComponent JavaDoc[]
1403    nameGet()
1404    {
1405       return Utils.string2name(_facade_name);
1406    }
1407
1408    /**
1409     * Implementation of the ::itut_x780::ManagedObject_F::objectClassGet operation.
1410     */

1411    public String JavaDoc
1412    objectClassGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
1413    throws intt.itu.itut_x780.ApplicationError
1414    {
1415         //
1416
// DONE : implement
1417
//
1418
String JavaDoc key = Utils.name2string(name);
1419
1420        if (elements.containsKey(key) == false) {
1421            ApplicationErrorInfoTypeImpl error_code =
1422                new ApplicationErrorInfoTypeImpl();
1423
1424            error_code.error = new UIDType(
1425                intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1426                intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1427
1428            error_code.details = new String JavaDoc("object with name " +
1429                key + " does not exist.");
1430
1431            throw new ApplicationError(error_code);
1432        }
1433
1434        IpRoutingEntryStructure data =
1435            (IpRoutingEntryStructure) elements.get(key);
1436
1437        return data.objectclass;
1438    }
1439
1440    /**
1441     * Implementation of the ::itut_x780::ManagedObject_F::attributesGet operation.
1442     */

1443    public intt.itu.itut_x780.ManagedObjectValueType
1444    attributesGet(org.omg.CosNaming.NameComponent JavaDoc[] name, intt.itu.itut_x780.StringSetTypeHolder attributeNames)
1445    throws intt.itu.itut_x780.ApplicationError
1446    {
1447      //
1448
// DONE : implement
1449
//
1450
String JavaDoc key = Utils.name2string(name);
1451
1452        if (elements.containsKey(key) == false) {
1453            ApplicationErrorInfoTypeImpl error_code =
1454                new ApplicationErrorInfoTypeImpl();
1455
1456            error_code.error = new UIDType(
1457                intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1458                intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1459
1460            error_code.details = new String JavaDoc("object with name " +
1461                key + " does not exist.");
1462
1463            throw new ApplicationError(error_code);
1464        }
1465
1466        IpRoutingEntryStructure data =
1467            (IpRoutingEntryStructure) elements.get(key);
1468
1469        int route_metric1, route_metric2, route_metric3, route_metric4, route_metric5;
1470        route_metric1 = route_metric2 = route_metric3 = route_metric4 = route_metric5 = -1;
1471
1472        int route_age = -1;
1473        try {
1474            route_metric1 = ipRouteMetric1Get(name);
1475        }
1476        catch(Exception JavaDoc e1) {
1477            System.err.println("IpRoutingEntryProvider> Exception calling ipRouteMetric1Get ");
1478        }
1479
1480        try {
1481            route_metric2 = ipRouteMetric2Get(name);
1482        }
1483        catch(Exception JavaDoc e2) {
1484            //System.err.println("IpRoutingEntryProvider> Exception calling ipRouteMetric2Get ");
1485
}
1486
1487        try {
1488            route_metric3 = ipRouteMetric3Get(name);
1489        }
1490        catch(Exception JavaDoc e3) {
1491            //System.err.println("IpRoutingEntryProvider> Exception calling ipRouteMetric3Get ");
1492
}
1493
1494        try {
1495            route_metric4 = ipRouteMetric4Get(name);
1496        }
1497        catch(Exception JavaDoc e4) {
1498            //System.err.println("IpRoutingEntryProvider> Exception calling ipRouteMetric4Get ");
1499
}
1500
1501        try {
1502            route_metric5 = ipRouteMetric5Get(name);
1503        }
1504        catch(Exception JavaDoc e5) {
1505            //System.err.println("IpRoutingEntryProvider> Exception calling ipRouteMetric5Get ");
1506
}
1507
1508        try {
1509            route_age = ipRouteAgeGet(name);
1510        }
1511        catch(Exception JavaDoc e5) {
1512            //System.err.println("IpRoutingEntryProvider> Exception calling ipRouteAgeGet ");
1513
}
1514
1515        IpRoutingEntryValueTypeImpl ipRoutingEntryValueType =
1516            new IpRoutingEntryValueTypeImpl(
1517                ipRouteDestGet(name),
1518                ipRouteIfIndexGet(name),
1519                route_metric1,
1520                route_metric2,
1521                route_metric3,
1522                route_metric4,
1523                ipRouteNextHopGet(name),
1524                ipRouteTypeGet(name),
1525                ipRouteProtoGet(name),
1526                route_age,
1527                ipRouteMaskGet(name),
1528                route_metric5,
1529                ipRouteInfoGet(name),
1530                data.name,
1531                data.objectclass,
1532                data.packages,
1533                data.sourceIndicator,
1534                data.deletePolicy
1535            );
1536    /*****
1537      System.err.println("IpRoutingEntryProvider> attributesGet: Ready to return " +
1538              data.name + ", " + data.objectclass+ ", "+ data.sourceIndicator + ", "+
1539              data.deletePolicy);
1540    *******/

1541          Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
1542            (short) LogSeverity._Info,
1543            "attributesGet finished successfully");
1544            return ipRoutingEntryValueType;
1545    }
1546
1547    /**
1548     * Implementation of the ::itut_x780::ManagedObject_F::packagesGet operation.
1549     */

1550    public String JavaDoc[]
1551    packagesGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
1552    throws intt.itu.itut_x780.ApplicationError
1553    {
1554                //
1555
// DONE : implement
1556
//
1557
String JavaDoc key = Utils.name2string(name);
1558
1559        if (elements.containsKey(key) == false) {
1560            ApplicationErrorInfoTypeImpl error_code =
1561                new ApplicationErrorInfoTypeImpl();
1562
1563            error_code.error = new UIDType(
1564                intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1565                intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1566
1567            error_code.details = new String JavaDoc("object with name " +
1568                key + " does not exist.");
1569
1570            throw new ApplicationError(error_code);
1571        }
1572
1573        IpRoutingEntryStructure data =
1574            (IpRoutingEntryStructure) elements.get(key);
1575
1576        return data.packages;
1577    }
1578
1579    /**
1580     * Implementation of the ::itut_x780::ManagedObject_F::creationSourceGet operation.
1581     */

1582    public intt.itu.itut_x780.SourceIndicatorType
1583    creationSourceGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
1584    throws intt.itu.itut_x780.ApplicationError
1585    {
1586      String JavaDoc key = Utils.name2string(name);
1587
1588        if (elements.containsKey(key) == false) {
1589            ApplicationErrorInfoTypeImpl error_code =
1590                new ApplicationErrorInfoTypeImpl();
1591
1592            error_code.error = new UIDType(
1593                intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1594                intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1595
1596            error_code.details = new String JavaDoc("object with name " +
1597                key + " does not exist.");
1598
1599            throw new ApplicationError(error_code);
1600        }
1601
1602        IpRoutingEntryStructure data =
1603            (IpRoutingEntryStructure) elements.get(key);
1604
1605        return data.sourceIndicator;
1606    }
1607
1608    /**
1609     * Implementation of the ::itut_x780::ManagedObject_F::deletePolicyGet operation.
1610     */

1611    public short
1612    deletePolicyGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
1613    throws intt.itu.itut_x780.ApplicationError
1614    {
1615        String JavaDoc key = Utils.name2string(name);
1616
1617        if (elements.containsKey(key) == false) {
1618            ApplicationErrorInfoTypeImpl error_code =
1619                new ApplicationErrorInfoTypeImpl();
1620
1621            error_code.error = new UIDType(
1622                intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1623                intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1624
1625            error_code.details = new String JavaDoc("object with name " +
1626                key + " does not exist.");
1627
1628            throw new ApplicationError(error_code);
1629        }
1630
1631        IpRoutingEntryStructure data =
1632            (IpRoutingEntryStructure) elements.get(key);
1633
1634        return data.deletePolicy;
1635    }
1636
1637    /**
1638     * Implementation of the ::itut_x780::ManagedObject_F::destroy operation.
1639     */

1640    public void
1641    destroy(org.omg.CosNaming.NameComponent JavaDoc[] name)
1642    throws intt.itu.itut_x780.ApplicationError,
1643
1644           intt.itu.itut_x780.DeleteError
1645    {
1646        if (!elements.containsKey(Utils.name2string(name))) {
1647
1648            ApplicationErrorInfoTypeImpl error_code =
1649            new ApplicationErrorInfoTypeImpl();
1650
1651            error_code.error = new UIDType(
1652            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1653            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1654
1655            error_code.details = new String JavaDoc ("object with name " +
1656            Utils.name2string(name) + " does not exist.");
1657
1658            throw new ApplicationError(error_code);
1659
1660      }
1661
1662      IpRoutingEntryStructure ipRoutingEntry = null;
1663      synchronized(elements) {
1664        ipRoutingEntry =
1665            (IpRoutingEntryStructure) elements.remove(
1666                Utils.name2string(name));
1667        }
1668    org.omg.TimeBase.UtcT eventTime = new org.omg.TimeBase.UtcT(System.currentTimeMillis(),
1669        0, (short) 0, (short) 0);
1670    get_context().push_objectDeletion(new ObjectDeletionImpl(eventTime, name,
1671                        ipRoutingEntry.objectclass,
1672                        getUniqueNotificationIdentifier(),
1673                        ipRoutingEntry.sourceIndicator,
1674                        new AttributeValueType[0]));
1675    Utils.pretty_log(logSupport, Utils.name2string(name),
1676            ipRoutingEntry.objectclass, //objectClassGet(name),
1677
(short) LogSeverity._Info,
1678          "successfully removed from management system");
1679    }
1680
1681    protected static int getUniqueNotificationIdentifier() {
1682
1683        notifId++;
1684        return notifId;
1685    }
1686}
1687
Popular Tags