KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > ist > coach > coachEmsMibComponents > IpNodeProviderComposition > IpNodeProviderImpl


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

21 package ist.coach.coachEmsMibComponents.IpNodeProviderComposition;
22
23 import intt.itu.itut_x780.UIDType;
24
25 import intt.itu.itut_x780.ApplicationError;
26 import intt.itu.itut_x780.ManagedObjectValueType;
27 import intt.itu.itut_x780.AttributeValueChangeType;
28 import intt.itu.itut_x780.AttributeValueType;
29 import intt.itu.itut_x780.SourceIndicatorType;
30 import intt.itu.itut_x780.OperationalStateTypeHelper;
31
32 import intt.itu.itut_m3120.NOuserLabelPackageException;
33 import intt.itu.itut_m3120.NOvendorNamePackageException;
34 import intt.itu.itut_m3120.NOversionPackageException;
35 import intt.itu.itut_m3120.NOlocationNamePackageException;
36
37 import ist.coach.coachEmfCommon.Utils;
38
39 import ist.coach.coachEmsCommon.IpNodeValueTypeImpl;
40 import ist.coach.coachEmfCommon.ObjectDeletionImpl;
41 import ist.coach.coachEmfCommon.ExceptionMessages;
42 import ist.coach.coachEmfCommon.ApplicationErrorInfoTypeImpl;
43 import ist.coach.coachEmfCommon.ManagedObjectValueTypeImpl;
44 import ist.coach.coachEmfCommon.DataTypeImpl;
45
46 import ist.coach.coachEmfServices.SnmpAdapter.DataType;
47 import ist.coach.coachEmfServices.SnmpAdapter.SnmpApplicationError;
48
49 import ist.coach.coachEmsMib.IpNodeValueType;
50 import ist.coach.coachEmsMib.NOsysInformationSetPackageException;
51
52 import ist.coach.coachEmsCommon.SnmpIdentifiers;
53 import org.omg.CosNaming.NameComponent JavaDoc;
54 import org.omg.CORBA.TCKind JavaDoc;
55
56 import org.opennms.protocols.snmp.SnmpSMI;
57 import ist.coach.coachEmfServices.EmfBasicLog.*;
58 import java.util.Hashtable JavaDoc;
59 /**
60  * This is the CIDL-based implementation of the
61  * OMG IDL3 IDL:coach.ist/coachEmsMibComponents/IpNodeProvider:1.0 component type.
62  *
63  * @author OpenCCM CIF_Jimpl Compiler.
64  */

65 public class IpNodeProviderImpl
66      extends ist.coach.coachEmsMibComponents.IpNodeProviderComposition.IpNodeProvider_impl
67 {
68     // ==================================================================
69
//
70
// Internal State.
71
//
72
// ===================================================================
73
/**
74      ** Context reference.
75      **/

76     org.omg.CORBA.ORB JavaDoc orb = null;
77
78     private String JavaDoc _facade_name;
79     private static int notifId = 10000;
80     private BasicLog logSupport;
81
82     protected static final int COLDSTART_TRAP = 1;
83     protected static final int NETSNMP_SHUTDOWN_TRAP = 4;
84
85     private static final String JavaDoc SYS_INFO_SET_PACKAGE = "sysInfoSetPackage";
86     private static final String JavaDoc LOCATION_NAME_PACKAGE = "locationNamePackage";
87     private static final String JavaDoc USER_LABEL_PACKAGE = "userLabelPackage";
88     private static final String JavaDoc VENDOR_NAME_PACKAGE = "vendorNamePackage";
89     private static final String JavaDoc VERSION_PACKAGE = "versionPackage";
90
91
92     protected static Hashtable JavaDoc elements;
93
94     ist.coach.coachEmfServices.SnmpAdapter.SnmpConnector connector = null;
95     ist.coach.coachEmfServices.SnmpAdapter.SnmpTrapDaemon config = null;
96     // ==================================================================
97
//
98
// Constructor.
99
//
100
// ===================================================================
101
/**
102      ** The default constructor.
103      **/

104     public
105     IpNodeProviderImpl()
106     {
107         elements = new Hashtable JavaDoc();
108     }
109     // ==================================================================
110
//
111
// Internal methods.
112
//
113
// ===================================================================
114

115
116     // ==================================================================
117
//
118
// Public methods.
119
//
120
// ===================================================================
121

122     // ==================================================================
123
//
124
// Methods for the OMG IDL Components::EnterpriseComponent local interface.
125
//
126
// ==================================================================
127
//
128
// IDL:omg.org/Components/EnterpriseComponent/configuration_complete:1.0
129
//
130
/**
131      ** Completes the component configuration.
132      **
133      ** @throws org.omg.Components.InvalidConfiguration
134      ** Thrown if the configuration is invalid.
135      **/

136     public void
137     configuration_complete()
138     throws org.omg.Components.InvalidConfiguration
139     {
140         //
141
// DONE : implement !!!
142
//
143

144       if ((connector = get_context().get_connection_connector()) == null)
145             throw new org.omg.Components.InvalidConfiguration();
146
147       if ((config = get_context().get_connection_config()) == null)
148             throw new org.omg.Components.InvalidConfiguration();
149
150       if ((logSupport = get_context().get_connection_basic_log()) == null)
151             throw new org.omg.Components.InvalidConfiguration();
152
153       orb = org.objectweb.ccm.CORBA.TheORB.getORB();
154         System.err.println("IpNodeProvider configuration completed...");
155     }
156
157     /**
158      ** Implementation of the ::coachEmsMibComponents::CCM_IpNodeProvider::get_snmp_callback operation.
159      **/

160     //public ist.coach.coachEmfServices.SnmpAdapter.CCM_TrapCallback
161
//get_snmp_callback()
162
//{
163
// return this;
164
// }
165
//
166
// IDL:coach.ist/itut_x780Components/CCM_NamedComponent_Executor/facade_name:1.0
167
//
168
/**
169      ** Implementation of the ::itut_x780Components::CCM_NamedComponent_Executor::facade_name attribute as accessor operation.
170      **/

171     public java.lang.String JavaDoc
172     facade_name()
173     {
174         //
175
// DONE : implement
176
//
177
return _facade_name;
178     }
179
180     /**
181      ** Implementation of the ::itut_x780Components::CCM_NamedComponent_Executor::facade_name attribute as mutator operation.
182      **/

183     public void
184     facade_name(java.lang.String JavaDoc val)
185     {
186         //
187
// DONE : implement
188
//
189
if (val != null)
190             _facade_name = new String JavaDoc(val);
191
192
193     }
194
195     /**
196      ** Implementation of the ManagedObject_F::nameGet operation.
197      **/

198     public NameComponent JavaDoc[] nameGet() {
199         return Utils.string2name(_facade_name);
200     }
201
202     //
203
// IDL:coach.ist/coachEmsMib/IpNode_F/domainNameGet:1.0
204
//
205
/**
206      ** Implementation of the ::coachEmsMib::IpNode_F::domainNameGet operation.
207      **/

208     public java.lang.String JavaDoc
209     domainNameGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
210     throws intt.itu.itut_x780.ApplicationError
211     {
212         //
213
// DONE : implement
214
//
215
String JavaDoc key = Utils.name2string(name);
216
217     if (this.elements.containsKey(key) == false) {
218         ApplicationErrorInfoTypeImpl error_code =
219             new ApplicationErrorInfoTypeImpl();
220
221         error_code.error = new UIDType(
222             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
223         intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
224
225         error_code.details = new String JavaDoc ("object with name" +
226             key + " does not exist.");
227
228         throw new ApplicationError(error_code);
229     }
230
231     IpNodeDataStructure data = (IpNodeDataStructure) this.elements.get(key);
232
233     return data.domainName;
234     }
235     //
236
// IDL:coach.ist/coachEmsMib/IpNode_F/hostnameGet:1.0
237
//
238
/**
239      ** Implementation of the ::coachEmsMib::IpNode_F::hostnameGet operation.
240      **/

241     public java.lang.String JavaDoc
242     hostnameGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
243     throws intt.itu.itut_x780.ApplicationError
244     {
245         //
246
// DONE : implement
247
//
248

249
250     String JavaDoc key = Utils.name2string(name);
251
252     if (this.elements.containsKey(key) == false) {
253         ApplicationErrorInfoTypeImpl error_code =
254             new ApplicationErrorInfoTypeImpl();
255
256     error_code.error = new UIDType(
257         intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
258         intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
259
260     error_code.details = new String JavaDoc ("object with name" +
261         key + " does not exist.");
262
263     throw new ApplicationError(error_code);
264     }
265
266     IpNodeDataStructure data = (IpNodeDataStructure) this.elements.get(key);
267
268     return data.hostname;
269     }
270     //
271
// IDL:coach.ist/coachEmsMib/IpNode_F/managementIPAddressGet:1.0
272
//
273
/**
274      ** Implementation of the ::coachEmsMib::IpNode_F::managementIPAddressGet operation.
275      **/

276     public byte[]
277     managementIPAddressGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
278     throws intt.itu.itut_x780.ApplicationError
279     {
280         //
281
// DONE : implement
282
//
283
String JavaDoc key = Utils.name2string(name);
284
285     if (this.elements.containsKey(key) == false) {
286         ApplicationErrorInfoTypeImpl error_code =
287             new ApplicationErrorInfoTypeImpl();
288
289     error_code.error = new UIDType(
290         intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
291         intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
292
293     error_code.details = new String JavaDoc ("object with name" +
294         key + " does not exist.");
295
296     throw new ApplicationError(error_code);
297     }
298
299     IpNodeDataStructure data = (IpNodeDataStructure) this.elements.get(key);
300
301     return data.managementIPAddress;
302
303     }
304     //
305
// IDL:coach.ist/coachEmsMib/IpNode_F/supportedSnmpVersionsGet:1.0
306
//
307
/**
308      ** Implementation of the ::coachEmsMib::IpNode_F::supportedSnmpVersionsGet operation.
309      **/

310     public int
311     supportedSnmpVersionsGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
312     throws intt.itu.itut_x780.ApplicationError
313     {
314         //
315
// DONE : implement
316
//
317

318
319     String JavaDoc key = Utils.name2string(name);
320
321     if (this.elements.containsKey(key) == false) {
322         ApplicationErrorInfoTypeImpl error_code =
323             new ApplicationErrorInfoTypeImpl();
324
325     error_code.error = new UIDType(
326         intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
327         intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
328
329     error_code.details = new String JavaDoc ("object with name" +
330         key + " does not exist.");
331
332     throw new ApplicationError(error_code);
333     }
334
335     IpNodeDataStructure data = (IpNodeDataStructure) this.elements.get(key);
336
337     return data.supportedSnmpVersions;
338     }
339     //
340
// IDL:coach.ist/coachEmsMib/IpNode_F/snmpPortGet:1.0
341
//
342
/**
343      ** Implementation of the ::coachEmsMib::IpNode_F::snmpPortGet operation.
344      **/

345     public int
346     snmpPortGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
347     throws intt.itu.itut_x780.ApplicationError
348     {
349         //
350
// DONE : implement
351
//
352
String JavaDoc key = Utils.name2string(name);
353
354     if (this.elements.containsKey(key) == false) {
355         ApplicationErrorInfoTypeImpl error_code =
356             new ApplicationErrorInfoTypeImpl();
357
358         error_code.error = new UIDType(
359             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
360         intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
361
362         error_code.details = new String JavaDoc ("object with name" +
363             key + " does not exist.");
364
365         throw new ApplicationError(error_code);
366     }
367
368     IpNodeDataStructure data = (IpNodeDataStructure) this.elements.get(key);
369
370     return data.snmpPort;
371
372     }
373     //
374
// IDL:coach.ist/coachEmsMib/IpNode_F/ifNumberGet:1.0
375
//
376
/**
377      ** Implementation of the ::coachEmsMib::IpNode_F::ifNumberGet operation.
378      **/

379     public int
380     ifNumberGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
381     throws intt.itu.itut_x780.ApplicationError
382     {
383         //
384
// DONE : implement
385
//
386
DataType ifNumberData = null;
387
388     String JavaDoc key = Utils.name2string(name);
389
390     if (this.elements.containsKey(key) == false) {
391
392         ApplicationErrorInfoTypeImpl error_code =
393             new ApplicationErrorInfoTypeImpl();
394
395         error_code.error = new UIDType(
396             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
397             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
398
399         error_code.details = new String JavaDoc ("object with name" +
400             key + " does not exist.");
401
402         throw new ApplicationError(error_code);
403     }
404
405
406     try {
407
408         ifNumberData = this.connector.get(
409             SnmpIdentifiers.IF_NUMBER_OID,
410             new String JavaDoc(this.managementIPAddressGet(name)),
411             this.snmpPortGet(name),
412             SnmpIdentifiers.READ_COMMUNITY);
413     }
414     catch (SnmpApplicationError e) {
415
416         ApplicationErrorInfoTypeImpl error_code =
417             new ApplicationErrorInfoTypeImpl();
418
419         error_code.error = new UIDType(
420             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
421             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
422
423         if (e.reason.equals(ExceptionMessages.agent_response_error))
424             error_code.details = ExceptionMessages.agent_response_error;
425         else
426             error_code.details = new String JavaDoc ("Could not retrieve ifNumber " +
427                 "for IpNode Object with name " + key + ":" +
428                  " Object with Snmp Object Identifier " + SnmpIdentifiers.IF_NUMBER_OID +
429                 " does not exist.");
430
431           Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
432           (short) LogSeverity._Error,
433           "SNMP Error getting the interface number: " + e.reason);
434
435         throw new ApplicationError(error_code);
436
437     }
438
439     org.omg.CORBA.Any JavaDoc value = ifNumberData.value;
440
441     if(value.type().kind().value() != TCKind._tk_long) {
442
443         ApplicationErrorInfoTypeImpl error_code =
444             new ApplicationErrorInfoTypeImpl();
445
446         error_code.error = new UIDType(
447             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
448             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
449
450         error_code.details = new String JavaDoc ("Could not retrieve ifNumber " +
451              "for IpNode Object with name " + key + ":" +
452              " Object with Snmp Object Identifier " + SnmpIdentifiers.IF_NUMBER_OID +
453              " is not of type long, as expected.");
454
455         throw new ApplicationError(error_code);
456
457     }
458
459     int ifNumber = value.extract_long();
460
461     return ifNumber;
462
463     }
464     //
465
// IDL:coach.ist/coachEmsMib/IpNode_F/sysDescrGet:1.0
466
//
467
/**
468      ** Implementation of the ::coachEmsMib::IpNode_F::sysDescrGet operation.
469      **/

470     public java.lang.String JavaDoc
471     sysDescrGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
472     throws intt.itu.itut_x780.ApplicationError
473     {
474         //
475
// DONE: implement
476
//
477

478     DataType sysDescrData = null;
479
480     String JavaDoc key = Utils.name2string(name);
481
482     if (this.elements.containsKey(key) == false) {
483
484         ApplicationErrorInfoTypeImpl error_code =
485             new ApplicationErrorInfoTypeImpl();
486
487         error_code.error = new UIDType(
488             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
489             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
490
491         error_code.details = new String JavaDoc ("object with name" +
492             key + " does not exist.");
493
494         throw new ApplicationError(error_code);
495     }
496
497
498     try {
499
500         sysDescrData = this.connector.get(
501             SnmpIdentifiers.SYS_DESCR_OID,
502             new String JavaDoc(this.managementIPAddressGet(name)),
503             this.snmpPortGet(name),
504             SnmpIdentifiers.READ_COMMUNITY);
505     }
506     catch (SnmpApplicationError e) {
507
508         ApplicationErrorInfoTypeImpl error_code =
509         new ApplicationErrorInfoTypeImpl();
510
511         error_code.error = new UIDType(
512             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
513             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
514
515         if (e.reason.equals(ExceptionMessages.agent_response_error))
516             error_code.details = ExceptionMessages.agent_response_error;
517         else
518             error_code.details = new String JavaDoc ("Could not retrieve sysDescr " +
519                  "for IpNode Object with name " + key + ":" +
520                  " Object with Snmp Object Identifier " + SnmpIdentifiers.SYS_DESCR_OID +
521                  " does not exist.");
522         Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
523           (short) LogSeverity._Error,
524           "SNMP Error getting the system description: " + e.reason);
525
526         throw new ApplicationError(error_code);
527
528     }
529
530     org.omg.CORBA.Any JavaDoc value = sysDescrData.value;
531
532     //if(value.type().kind().value() != TCKind._tk_string) {
533
if(value.type().kind().value() != org.omg.CORBA.OctetSeqHelper.type().kind().value()) {
534         ApplicationErrorInfoTypeImpl error_code =
535             new ApplicationErrorInfoTypeImpl();
536
537         error_code.error = new UIDType(
538             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
539             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
540
541         error_code.details = new String JavaDoc ("Could not retrieve sysDescr " +
542              "for IpNode Object with name " + key + ":" +
543              " Object with Snmp Object Identifier " + SnmpIdentifiers.SYS_DESCR_OID +
544              " is not of type string, as expected.");
545
546         throw new ApplicationError(error_code);
547
548     }
549     String JavaDoc sysDescr = new String JavaDoc(org.omg.CORBA.OctetSeqHelper.extract(value));
550     //String sysDescr = value.extract_string();
551

552     return sysDescr;
553     }
554     //
555
// IDL:coach.ist/coachEmsMib/IpNode_F/sysObjectIDGet:1.0
556
//
557
/**
558      ** Implementation of the ::coachEmsMib::IpNode_F::sysObjectIDGet operation.
559      **/

560     public java.lang.String JavaDoc
561     sysObjectIDGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
562     throws intt.itu.itut_x780.ApplicationError
563     {
564         //
565
// DONE : implement
566
//
567

568     DataType sysObjectIDData = null;
569
570     String JavaDoc key = Utils.name2string(name);
571
572     if (this.elements.containsKey(key) == false) {
573
574         ApplicationErrorInfoTypeImpl error_code =
575             new ApplicationErrorInfoTypeImpl();
576
577         error_code.error = new UIDType(
578             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
579             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
580
581         error_code.details = new String JavaDoc ("object with name" +
582             key + " does not exist.");
583
584         throw new ApplicationError(error_code);
585     }
586
587
588     try {
589
590         sysObjectIDData = this.connector.get(
591             SnmpIdentifiers.SYS_OBJECTID_OID,
592             new String JavaDoc(this.managementIPAddressGet(name)),
593             this.snmpPortGet(name),
594             SnmpIdentifiers.READ_COMMUNITY);
595     }
596     catch (SnmpApplicationError e) {
597
598         ApplicationErrorInfoTypeImpl error_code =
599         new ApplicationErrorInfoTypeImpl();
600
601         error_code.error = new UIDType(
602             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
603             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
604
605         if (e.reason.equals(ExceptionMessages.agent_response_error))
606             error_code.details = ExceptionMessages.agent_response_error;
607         else
608             error_code.details = new String JavaDoc ("Could not retrieve sysObjectID " +
609                  "for IpNode Object with name " + key + ":" +
610                  " Object with Snmp Object Identifier " + SnmpIdentifiers.SYS_OBJECTID_OID +
611                  " does not exist.");
612
613         Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
614           (short) LogSeverity._Error,
615           "SNMP Error getting the system object id: " + e.reason);
616
617         throw new ApplicationError(error_code);
618
619     }
620
621     org.omg.CORBA.Any JavaDoc value = sysObjectIDData.value;
622
623     if(value.type().kind().value() != TCKind._tk_string) {
624
625         ApplicationErrorInfoTypeImpl error_code =
626             new ApplicationErrorInfoTypeImpl();
627
628         error_code.error = new UIDType(
629             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
630             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
631
632         error_code.details = new String JavaDoc ("Could not retrieve sysObjectID " +
633              "for IpNode Object with name " + key + ":" +
634              " Object with Snmp Object Identifier " + SnmpIdentifiers.SYS_OBJECTID_OID +
635              " is not of type string, as expected.");
636
637         throw new ApplicationError(error_code);
638
639     }
640
641     String JavaDoc sysObjectID = value.extract_string();
642
643     return sysObjectID;
644     }
645     //
646
// IDL:coach.ist/coachEmsMib/IpNode_F/sysUpTimeGet:1.0
647
//
648
/**
649      ** Implementation of the ::coachEmsMib::IpNode_F::sysUpTimeGet operation.
650      **/

651     public long
652     sysUpTimeGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
653     throws intt.itu.itut_x780.ApplicationError
654     {
655         //
656
// DONE : implement
657
//
658
DataType sysUpTimeData = null;
659
660     String JavaDoc key = Utils.name2string(name);
661
662     if (this.elements.containsKey(key) == false) {
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         error_code.details = new String JavaDoc ("object with name" +
672             key + " does not exist.");
673
674         throw new ApplicationError(error_code);
675     }
676
677
678     try {
679
680         sysUpTimeData = this.connector.get(
681             SnmpIdentifiers.SYS_UPTIME_OID,
682             new String JavaDoc(this.managementIPAddressGet(name)),
683             this.snmpPortGet(name),
684             SnmpIdentifiers.READ_COMMUNITY);
685     }
686     catch (SnmpApplicationError e) {
687
688         ApplicationErrorInfoTypeImpl error_code =
689         new ApplicationErrorInfoTypeImpl();
690
691         error_code.error = new UIDType(
692             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
693             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
694
695         if (e.reason.equals(ExceptionMessages.agent_response_error))
696             error_code.details = ExceptionMessages.agent_response_error;
697         else
698             error_code.details = new String JavaDoc ("Could not retrieve sysUpTime " +
699                 "for IpNode Object with name " + key + ":" +
700                 " Object with Snmp Object Identifier " + SnmpIdentifiers.SYS_UPTIME_OID +
701                 " does not exist.");
702
703         Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
704           (short) LogSeverity._Error,
705           "SNMP Error getting the system up time: " + e.reason);
706
707         throw new ApplicationError(error_code);
708
709     }
710
711     org.omg.CORBA.Any JavaDoc value = sysUpTimeData.value;
712
713     if(value.type().kind().value() != TCKind._tk_longlong) {
714
715         ApplicationErrorInfoTypeImpl error_code =
716             new ApplicationErrorInfoTypeImpl();
717
718         error_code.error = new UIDType(
719             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
720             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
721
722         error_code.details = new String JavaDoc ("Could not retrieve sysUpTime " +
723              "for IpNode Object with name " + key + ":" +
724              " Object with Snmp Object Identifier " + SnmpIdentifiers.SYS_UPTIME_OID +
725              " is not of type long, as expected.");
726
727         throw new ApplicationError(error_code);
728
729     }
730
731     long sysUpTime = value.extract_longlong();
732
733     return sysUpTime;
734
735     }
736     //
737
// IDL:coach.ist/coachEmsMib/IpNode_F/sysContactGet:1.0
738
//
739
/**
740      ** Implementation of the ::coachEmsMib::IpNode_F::sysContactGet operation.
741      **/

742     public java.lang.String JavaDoc
743     sysContactGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
744     throws intt.itu.itut_x780.ApplicationError
745     {
746         //
747
// DONE : implement
748
//
749

750
751     DataType sysDescrData = null;
752
753     String JavaDoc key = Utils.name2string(name);
754
755     if (this.elements.containsKey(key) == false) {
756
757         ApplicationErrorInfoTypeImpl error_code =
758             new ApplicationErrorInfoTypeImpl();
759
760         error_code.error = new UIDType(
761             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
762             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
763
764         error_code.details = new String JavaDoc ("object with name" +
765             key + " does not exist.");
766
767         throw new ApplicationError(error_code);
768     }
769
770
771     try {
772
773         sysDescrData = this.connector.get(
774             SnmpIdentifiers.SYS_CONTACT_OID,
775             new String JavaDoc(this.managementIPAddressGet(name)),
776             this.snmpPortGet(name),
777             SnmpIdentifiers.READ_COMMUNITY);
778     }
779     catch (SnmpApplicationError e) {
780
781         ApplicationErrorInfoTypeImpl error_code =
782         new ApplicationErrorInfoTypeImpl();
783
784         error_code.error = new UIDType(
785             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
786             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
787
788         if (e.reason.equals(ExceptionMessages.agent_response_error))
789             error_code.details = ExceptionMessages.agent_response_error;
790         else
791                 error_code.details = new String JavaDoc ("Could not retrieve sysContact " +
792                  "for IpNode Object with name " + key + ":" +
793                  " Object with Snmp Object Identifier " + SnmpIdentifiers.SYS_CONTACT_OID +
794                  " does not exist.");
795
796         Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
797           (short) LogSeverity._Error,
798           "SNMP Error getting the contact details: " + e.reason);
799         throw new ApplicationError(error_code);
800
801     }
802
803     org.omg.CORBA.Any JavaDoc value = sysDescrData.value;
804
805     //if(value.type().kind().value() != TCKind._tk_string) {
806
if (value.type().kind().value() != org.omg.CORBA.OctetSeqHelper.type().kind().value()) {
807         ApplicationErrorInfoTypeImpl error_code =
808             new ApplicationErrorInfoTypeImpl();
809
810         error_code.error = new UIDType(
811             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
812             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
813
814         error_code.details = new String JavaDoc ("Could not retrieve sysContact " +
815              "for IpNode Object with name " + key + ":" +
816              " Object with Snmp Object Identifier " + SnmpIdentifiers.SYS_CONTACT_OID +
817              " is not of type string, as expected.");
818
819         throw new ApplicationError(error_code);
820
821     }
822     String JavaDoc sysContact = new String JavaDoc(org.omg.CORBA.OctetSeqHelper.extract(value));
823     //String sysContact = value.extract_string();
824

825     return sysContact;
826     }
827     //
828
// IDL:coach.ist/coachEmsMib/IpNode_F/sysContactSet:1.0
829
//
830
/**
831      ** Implementation of the ::coachEmsMib::IpNode_F::sysContactSet operation.
832      **/

833     public void
834     sysContactSet(org.omg.CosNaming.NameComponent JavaDoc[] name, java.lang.String JavaDoc sysContact)
835     throws intt.itu.itut_x780.ApplicationError, ist.coach.coachEmsMib.NOsysInformationSetPackageException
836     {
837         //
838
// DONE : implement
839
//
840

841     String JavaDoc key = Utils.name2string(name);
842
843     if (this.elements.containsKey(key) == false) {
844
845         ApplicationErrorInfoTypeImpl error_code =
846             new ApplicationErrorInfoTypeImpl();
847
848         error_code.error = new UIDType(
849             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
850             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
851
852         error_code.details = new String JavaDoc ("object with name" +
853             key + " does not exist.");
854
855         throw new ApplicationError(error_code);
856     }
857
858     if (!Utils.packageIsSupported(SYS_INFO_SET_PACKAGE,
859             packagesGet(name))) {
860         System.out.println("Package " + SYS_INFO_SET_PACKAGE +
861             "is not supported by IpNode Object" + key);
862
863         throw new NOsysInformationSetPackageException();
864     }
865
866     org.omg.CORBA.Any JavaDoc value = orb.create_any();
867     //value.insert_string(sysContact);
868
org.omg.CORBA.OctetSeqHelper.insert(value, sysContact.getBytes());
869     DataTypeImpl sysContactData = new DataTypeImpl(
870         SnmpIdentifiers.SYS_CONTACT_OID,
871         value,
872         SnmpSMI.SMI_STRING);
873
874     try {
875
876         this.connector.set(
877             sysContactData,
878             new String JavaDoc(this.managementIPAddressGet(name)),
879             this.snmpPortGet(name),
880             SnmpIdentifiers.WRITE_COMMUNITY);
881         }
882     catch (SnmpApplicationError e) {
883
884         ApplicationErrorInfoTypeImpl error_code =
885             new ApplicationErrorInfoTypeImpl();
886
887         error_code.error = new UIDType(
888             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
889             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
890
891         if (e.reason.equals(ExceptionMessages.agent_response_error))
892             error_code.details = ExceptionMessages.agent_response_error;
893         else
894             error_code.details = new String JavaDoc ("Could not set sysContact " +
895                  "for IpNode Object with name " + key + ".");
896
897         Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
898           (short) LogSeverity._Error,
899           "SNMP Error setting the contact details: " + e.reason);
900         throw new ApplicationError(error_code);
901
902     }
903     Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
904             (short) LogSeverity._Info,
905             "sysContact set to " + sysContact);
906     }
907     //
908
// IDL:coach.ist/coachEmsMib/IpNode_F/sysNameGet:1.0
909
//
910
/**
911      ** Implementation of the ::coachEmsMib::IpNode_F::sysNameGet operation.
912      **/

913     public java.lang.String JavaDoc
914     sysNameGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
915     throws intt.itu.itut_x780.ApplicationError
916     {
917         //
918
// DONE : implement
919
//
920

921     DataType sysNameData = null;
922
923     String JavaDoc key = Utils.name2string(name);
924
925     if (this.elements.containsKey(key) == false) {
926
927         ApplicationErrorInfoTypeImpl error_code =
928             new ApplicationErrorInfoTypeImpl();
929
930         error_code.error = new UIDType(
931             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
932             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
933
934         error_code.details = new String JavaDoc ("object with name" +
935             key + " does not exist.");
936
937         throw new ApplicationError(error_code);
938     }
939
940
941     try {
942
943         sysNameData = this.connector.get(
944             SnmpIdentifiers.SYS_NAME_OID,
945             new String JavaDoc(this.managementIPAddressGet(name)),
946             this.snmpPortGet(name),
947             SnmpIdentifiers.READ_COMMUNITY);
948     }
949     catch (SnmpApplicationError e) {
950
951         ApplicationErrorInfoTypeImpl error_code =
952         new ApplicationErrorInfoTypeImpl();
953
954         error_code.error = new UIDType(
955             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
956             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
957
958         if (e.reason.equals(ExceptionMessages.agent_response_error))
959             error_code.details = ExceptionMessages.agent_response_error;
960         else
961             error_code.details = new String JavaDoc ("Could not retrieve sysName " +
962                 "for IpNode Object with name " + key + ":" +
963                 " Object with Snmp Object Identifier " + SnmpIdentifiers.SYS_NAME_OID +
964                 " does not exist.");
965
966         Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
967           (short) LogSeverity._Error,
968           "SNMP Error getting the system name: " + e.reason);
969
970         throw new ApplicationError(error_code);
971
972     }
973
974     org.omg.CORBA.Any JavaDoc value = sysNameData.value;
975
976     //if(value.type().kind().value() != TCKind._tk_string) {
977
if(value.type().kind().value() != org.omg.CORBA.OctetSeqHelper.type().kind().value()) {
978         ApplicationErrorInfoTypeImpl error_code =
979             new ApplicationErrorInfoTypeImpl();
980
981         error_code.error = new UIDType(
982             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
983             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
984
985         error_code.details = new String JavaDoc ("Could not retrieve sysName " +
986              "for IpNode Object with name " + key + ":" +
987              " Object with Snmp Object Identifier " + SnmpIdentifiers.SYS_NAME_OID +
988              " is not of type string, as expected.");
989
990         throw new ApplicationError(error_code);
991
992     }
993
994     //String sysContact = value.extract_string();
995
String JavaDoc sysName = new String JavaDoc(org.omg.CORBA.OctetSeqHelper.extract(value));
996     return sysName;
997     }
998     //
999
// IDL:coach.ist/coachEmsMib/IpNode_F/sysNameSet:1.0
1000
//
1001
/**
1002     ** Implementation of the ::coachEmsMib::IpNode_F::sysNameSet operation.
1003     **/

1004    public void
1005    sysNameSet(org.omg.CosNaming.NameComponent JavaDoc[] name, java.lang.String JavaDoc sysName)
1006    throws intt.itu.itut_x780.ApplicationError, ist.coach.coachEmsMib.NOsysInformationSetPackageException
1007    {
1008        //
1009
// DONE : implement
1010
//
1011

1012    String JavaDoc key = Utils.name2string(name);
1013
1014    if (this.elements.containsKey(key) == false) {
1015
1016        ApplicationErrorInfoTypeImpl error_code =
1017            new ApplicationErrorInfoTypeImpl();
1018
1019        error_code.error = new UIDType(
1020            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1021            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1022
1023        error_code.details = new String JavaDoc ("object with name" +
1024            key + " does not exist.");
1025
1026        throw new ApplicationError(error_code);
1027    }
1028
1029    if (!Utils.packageIsSupported(SYS_INFO_SET_PACKAGE,
1030            packagesGet(name))) {
1031        System.out.println("Package " + SYS_INFO_SET_PACKAGE +
1032            "is not supported by IpNode Object" + key);
1033
1034        throw new NOsysInformationSetPackageException();
1035    }
1036
1037    org.omg.CORBA.Any JavaDoc value = orb.create_any();
1038    //value.insert_string(sysName);
1039

1040    org.omg.CORBA.OctetSeqHelper.insert(value, sysName.getBytes());
1041
1042    DataTypeImpl sysNameData = new DataTypeImpl(
1043        SnmpIdentifiers.SYS_NAME_OID,
1044        value,
1045        SnmpSMI.SMI_STRING);
1046
1047    try {
1048
1049        this.connector.set(
1050            sysNameData,
1051            new String JavaDoc(this.managementIPAddressGet(name)),
1052            this.snmpPortGet(name),
1053            SnmpIdentifiers.WRITE_COMMUNITY);
1054    }
1055    catch (SnmpApplicationError e) {
1056
1057        ApplicationErrorInfoTypeImpl error_code =
1058            new ApplicationErrorInfoTypeImpl();
1059
1060        error_code.error = new UIDType(
1061            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1062            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1063
1064        if (e.reason.equals(ExceptionMessages.agent_response_error))
1065            error_code.details = ExceptionMessages.agent_response_error;
1066        else
1067            error_code.details = new String JavaDoc ("Could not set sysName " +
1068                 "for IpNode Object with name " + key + ".");
1069
1070        Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
1071          (short) LogSeverity._Error,
1072          "SNMP Error setting the system name: " + e.reason);
1073
1074        throw new ApplicationError(error_code);
1075
1076    }
1077        Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
1078            (short) LogSeverity._Info,
1079            "sysName set to " + sysName);
1080    }
1081    //
1082
// IDL:coach.ist/coachEmsMib/IpNode_F/sysServicesGet:1.0
1083
//
1084
/**
1085     ** Implementation of the ::coachEmsMib::IpNode_F::sysServicesGet operation.
1086     **/

1087    public short
1088    sysServicesGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
1089    throws intt.itu.itut_x780.ApplicationError
1090    {
1091        //
1092
// DONE : implement
1093
//
1094

1095    DataType sysServicesData = null;
1096
1097    String JavaDoc key = Utils.name2string(name);
1098
1099    if (this.elements.containsKey(key) == false) {
1100
1101        ApplicationErrorInfoTypeImpl error_code =
1102            new ApplicationErrorInfoTypeImpl();
1103
1104        error_code.error = new UIDType(
1105            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1106            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1107
1108        error_code.details = new String JavaDoc ("object with name" +
1109            key + " does not exist.");
1110
1111        throw new ApplicationError(error_code);
1112    }
1113
1114
1115    try {
1116
1117        sysServicesData = this.connector.get(
1118            SnmpIdentifiers.SYS_SERVICES_OID,
1119            new String JavaDoc(this.managementIPAddressGet(name)),
1120            this.snmpPortGet(name),
1121            SnmpIdentifiers.READ_COMMUNITY);
1122    }
1123    catch (SnmpApplicationError e) {
1124
1125        ApplicationErrorInfoTypeImpl error_code =
1126        new ApplicationErrorInfoTypeImpl();
1127
1128        error_code.error = new UIDType(
1129            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1130            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1131
1132        if (e.reason.equals(ExceptionMessages.agent_response_error))
1133            error_code.details = ExceptionMessages.agent_response_error;
1134        else
1135            error_code.details = new String JavaDoc ("Could not retrieve sysServices " +
1136                 "for IpNode Object with name " + key + ":" +
1137                 " Object with Snmp Object Identifier " + SnmpIdentifiers.SYS_SERVICES_OID +
1138                 " does not exist.");
1139
1140        Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
1141          (short) LogSeverity._Error,
1142          "SNMP Error getting the system services: " + e.reason);
1143
1144        throw new ApplicationError(error_code);
1145
1146    }
1147
1148    org.omg.CORBA.Any JavaDoc value = sysServicesData.value;
1149
1150    if(value.type().kind().value() != TCKind._tk_long) {
1151
1152        ApplicationErrorInfoTypeImpl error_code =
1153            new ApplicationErrorInfoTypeImpl();
1154
1155        error_code.error = new UIDType(
1156            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1157            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1158
1159        error_code.details = new String JavaDoc ("Could not retrieve sysServices " +
1160             "for IpNode Object with name " + key + ":" +
1161             " Object with Snmp Object Identifier " + SnmpIdentifiers.SYS_SERVICES_OID +
1162             " is not of type int, as expected.");
1163
1164        throw new ApplicationError(error_code);
1165
1166    }
1167
1168    short sysServices = (short)value.extract_long();
1169
1170    return sysServices;
1171
1172    }
1173    //
1174
// IDL:itu.intt/itut_m3120/ManagedElement_F/administrativeStateGet:1.0
1175
//
1176
/**
1177     ** Implementation of the ::itut_m3120::ManagedElement_F::administrativeStateGet operation.
1178     **/

1179    public intt.itu.itut_x780.AdministrativeStateType
1180    administrativeStateGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
1181    throws intt.itu.itut_x780.ApplicationError
1182    {
1183        //
1184
// DONE : implement
1185
//
1186

1187    String JavaDoc key = Utils.name2string(name);
1188
1189    if (this.elements.containsKey(key) == false) {
1190
1191        ApplicationErrorInfoTypeImpl error_code =
1192            new ApplicationErrorInfoTypeImpl();
1193
1194        error_code.error = new UIDType(
1195            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1196            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1197
1198        error_code.details = new String JavaDoc ("object with name" +
1199            key + " does not exist.");
1200
1201        throw new ApplicationError(error_code);
1202    }
1203
1204    IpNodeDataStructure ipNodeData = (IpNodeDataStructure)this.elements.get(
1205        Utils.name2string(name));
1206
1207    return ipNodeData.administrativeState;
1208
1209    }
1210    //
1211
// IDL:itu.intt/itut_m3120/ManagedElement_F/administrativeStateSet:1.0
1212
//
1213
/**
1214     ** Implementation of the ::itut_m3120::ManagedElement_F::administrativeStateSet operation.
1215     **/

1216    public void
1217    administrativeStateSet(org.omg.CosNaming.NameComponent JavaDoc[] name, intt.itu.itut_x780.AdministrativeStateType administrativeState)
1218    throws intt.itu.itut_x780.ApplicationError
1219    {
1220        //
1221
// DONE : implement
1222
//
1223

1224    //HACK: Dummy operation! No support from underlying SNMP Agent!
1225

1226    String JavaDoc key = Utils.name2string(name);
1227
1228    if (this.elements.containsKey(key) == false) {
1229
1230        ApplicationErrorInfoTypeImpl error_code =
1231            new ApplicationErrorInfoTypeImpl();
1232
1233        error_code.error = new UIDType(
1234            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1235            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1236
1237        error_code.details = new String JavaDoc ("object with name" +
1238            key + " does not exist.");
1239
1240        throw new ApplicationError(error_code);
1241    }
1242
1243    IpNodeDataStructure ipNodeData = (IpNodeDataStructure)this.elements.get(key);
1244
1245    ipNodeData.administrativeState = administrativeState;
1246    Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
1247            (short) LogSeverity._Info,
1248            "AdministrativeState set to " + administrativeState);
1249    }
1250    //
1251
// IDL:itu.intt/itut_m3120/ManagedElement_F/operationalStateGet:1.0
1252
//
1253
/**
1254     ** Implementation of the ::itut_m3120::ManagedElement_F::operationalStateGet operation.
1255     **/

1256    public intt.itu.itut_x780.OperationalStateType
1257    operationalStateGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
1258    throws intt.itu.itut_x780.ApplicationError
1259    {
1260        //
1261
// TODO : implement
1262
//
1263
//HACK: Dummy operation! No support from underlying SNMP Agent!
1264

1265    String JavaDoc key = Utils.name2string(name);
1266
1267    if (this.elements.containsKey(key) == false) {
1268
1269        ApplicationErrorInfoTypeImpl error_code =
1270            new ApplicationErrorInfoTypeImpl();
1271
1272        error_code.error = new UIDType(
1273            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1274            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1275
1276        error_code.details = new String JavaDoc ("object with name" +
1277            key + " does not exist.");
1278
1279        throw new ApplicationError(error_code);
1280    }
1281
1282    IpNodeDataStructure ipNodeData = (IpNodeDataStructure)this.elements.get(
1283        Utils.name2string(name));
1284
1285    return ipNodeData.operationalState;
1286
1287    }
1288    //
1289
// IDL:itu.intt/itut_m3120/ManagedElement_F/usageStateGet:1.0
1290
//
1291
/**
1292     ** Implementation of the ::itut_m3120::ManagedElement_F::usageStateGet operation.
1293     **/

1294    public intt.itu.itut_x780.UsageStateType
1295    usageStateGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
1296    throws intt.itu.itut_x780.ApplicationError
1297    {
1298        //
1299
// DONE : implement
1300
//
1301

1302    //HACK: Dummy operation! No support from underlying SNMP Agent!
1303

1304    String JavaDoc key = Utils.name2string(name);
1305
1306    if (this.elements.containsKey(key) == false) {
1307
1308        ApplicationErrorInfoTypeImpl error_code =
1309            new ApplicationErrorInfoTypeImpl();
1310
1311        error_code.error = new UIDType(
1312            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1313            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1314
1315        error_code.details = new String JavaDoc ("object with name" +
1316            key + " does not exist.");
1317
1318        throw new ApplicationError(error_code);
1319    }
1320    return intt.itu.itut_x780.UsageStateType.active;
1321    }
1322    //
1323
// IDL:itu.intt/itut_m3120/ManagedElement_F/userLabelGet:1.0
1324
//
1325
/**
1326     ** Implementation of the ::itut_m3120::ManagedElement_F::userLabelGet operation.
1327     **/

1328    public java.lang.String JavaDoc
1329    userLabelGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
1330    throws intt.itu.itut_x780.ApplicationError, intt.itu.itut_m3120.NOuserLabelPackageException
1331    {
1332        //
1333
// DONE : implement
1334
//
1335

1336    String JavaDoc key = Utils.name2string(name);
1337
1338    if (this.elements.containsKey(key) == false) {
1339
1340        ApplicationErrorInfoTypeImpl error_code =
1341            new ApplicationErrorInfoTypeImpl();
1342
1343        error_code.error = new UIDType(
1344            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1345            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1346
1347        error_code.details = new String JavaDoc ("object with name" +
1348            key + " does not exist.");
1349
1350        throw new ApplicationError(error_code);
1351    }
1352
1353    if (!Utils.packageIsSupported(USER_LABEL_PACKAGE,
1354            packagesGet(name))) {
1355        throw new NOuserLabelPackageException();
1356    }
1357
1358    IpNodeDataStructure ipNodeData = (IpNodeDataStructure)this.elements.get(key);
1359
1360    return ipNodeData.userLabel;
1361    }
1362    //
1363
// IDL:itu.intt/itut_m3120/ManagedElement_F/userLabelSet:1.0
1364
//
1365
/**
1366     ** Implementation of the ::itut_m3120::ManagedElement_F::userLabelSet operation.
1367     **/

1368    public void
1369    userLabelSet(org.omg.CosNaming.NameComponent JavaDoc[] name, java.lang.String JavaDoc userLabel)
1370    throws intt.itu.itut_x780.ApplicationError, intt.itu.itut_m3120.NOuserLabelPackageException
1371    {
1372        //
1373
// DONE : implement
1374
//
1375

1376    String JavaDoc key = Utils.name2string(name);
1377
1378    if (this.elements.containsKey(key) == false) {
1379
1380        ApplicationErrorInfoTypeImpl error_code =
1381            new ApplicationErrorInfoTypeImpl();
1382
1383        error_code.error = new UIDType(
1384            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1385            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1386
1387        error_code.details = new String JavaDoc ("object with name" +
1388            key + " does not exist.");
1389
1390        throw new ApplicationError(error_code);
1391    }
1392
1393    if (!Utils.packageIsSupported(USER_LABEL_PACKAGE,
1394            packagesGet(name))) {
1395        throw new NOuserLabelPackageException();
1396    }
1397
1398    IpNodeDataStructure ipNodeData = (IpNodeDataStructure)this.elements.get(key);
1399
1400    ipNodeData.userLabel = userLabel;
1401    Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
1402            (short) LogSeverity._Info,
1403            "User Label set to " + userLabel);
1404    }
1405    //
1406
// IDL:itu.intt/itut_m3120/ManagedElement_F/vendorNameGet:1.0
1407
//
1408
/**
1409     ** Implementation of the ::itut_m3120::ManagedElement_F::vendorNameGet operation.
1410     **/

1411    public java.lang.String JavaDoc
1412    vendorNameGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
1413    throws intt.itu.itut_x780.ApplicationError, intt.itu.itut_m3120.NOvendorNamePackageException
1414    {
1415        //
1416
// DONE : implement
1417
//
1418

1419    String JavaDoc key = Utils.name2string(name);
1420
1421    if (this.elements.containsKey(key) == false) {
1422
1423        ApplicationErrorInfoTypeImpl error_code =
1424            new ApplicationErrorInfoTypeImpl();
1425
1426        error_code.error = new UIDType(
1427            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1428            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1429
1430        error_code.details = new String JavaDoc ("object with name" +
1431            key + " does not exist.");
1432
1433        throw new ApplicationError(error_code);
1434    }
1435
1436    if (!Utils.packageIsSupported(VENDOR_NAME_PACKAGE,
1437            packagesGet(name))) {
1438        throw new NOvendorNamePackageException();
1439    }
1440
1441    IpNodeDataStructure ipNodeData = (IpNodeDataStructure)this.elements.get(key);
1442
1443    return ipNodeData.vendorName;
1444    }
1445    //
1446
// IDL:itu.intt/itut_m3120/ManagedElement_F/vendorNameSet:1.0
1447
//
1448
/**
1449     ** Implementation of the ::itut_m3120::ManagedElement_F::vendorNameSet operation.
1450     **/

1451    public void
1452    vendorNameSet(org.omg.CosNaming.NameComponent JavaDoc[] name, java.lang.String JavaDoc vendorName)
1453    throws intt.itu.itut_x780.ApplicationError, intt.itu.itut_m3120.NOvendorNamePackageException
1454    {
1455        //
1456
// DONE : implement
1457
//
1458

1459    String JavaDoc key = Utils.name2string(name);
1460
1461    if (this.elements.containsKey(key) == false) {
1462
1463        ApplicationErrorInfoTypeImpl error_code =
1464            new ApplicationErrorInfoTypeImpl();
1465
1466        error_code.error = new UIDType(
1467            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1468            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1469
1470        error_code.details = new String JavaDoc ("object with name" +
1471            key + " does not exist.");
1472
1473        throw new ApplicationError(error_code);
1474    }
1475
1476    if (!Utils.packageIsSupported(VENDOR_NAME_PACKAGE,
1477                packagesGet(name))) {
1478        throw new NOvendorNamePackageException();
1479    }
1480
1481    IpNodeDataStructure ipNodeData = (IpNodeDataStructure)this.elements.get(key);
1482
1483    ipNodeData.vendorName = vendorName;
1484    Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
1485            (short) LogSeverity._Info,
1486            "Vendor Name set to " + vendorName);
1487    }
1488    //
1489
// IDL:itu.intt/itut_m3120/ManagedElement_F/versionGet:1.0
1490
//
1491
/**
1492     ** Implementation of the ::itut_m3120::ManagedElement_F::versionGet operation.
1493     **/

1494    public java.lang.String JavaDoc
1495    versionGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
1496    throws intt.itu.itut_x780.ApplicationError, intt.itu.itut_m3120.NOversionPackageException
1497    {
1498        //
1499
// DONE : implement
1500
//
1501

1502    String JavaDoc key = Utils.name2string(name);
1503
1504    if (this.elements.containsKey(key) == false) {
1505
1506        ApplicationErrorInfoTypeImpl error_code =
1507            new ApplicationErrorInfoTypeImpl();
1508
1509        error_code.error = new UIDType(
1510            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1511            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1512
1513        error_code.details = new String JavaDoc ("object with name" +
1514            key + " does not exist.");
1515
1516        throw new ApplicationError(error_code);
1517    }
1518
1519    if (!Utils.packageIsSupported(VERSION_PACKAGE,
1520            packagesGet(name))) {
1521        throw new NOversionPackageException();
1522    }
1523
1524    IpNodeDataStructure ipNodeData = (IpNodeDataStructure)this.elements.get(key);
1525
1526    return ipNodeData.version;
1527    }
1528    //
1529
// IDL:itu.intt/itut_m3120/ManagedElement_F/versionSet:1.0
1530
//
1531
/**
1532     ** Implementation of the ::itut_m3120::ManagedElement_F::versionSet operation.
1533     **/

1534    public void
1535    versionSet(org.omg.CosNaming.NameComponent JavaDoc[] name, java.lang.String JavaDoc version)
1536    throws intt.itu.itut_x780.ApplicationError, intt.itu.itut_m3120.NOversionPackageException
1537    {
1538        //
1539
// DONE : implement
1540
//
1541

1542    String JavaDoc key = Utils.name2string(name);
1543
1544    if (this.elements.containsKey(key) == false) {
1545
1546        ApplicationErrorInfoTypeImpl error_code =
1547            new ApplicationErrorInfoTypeImpl();
1548
1549        error_code.error = new UIDType(
1550            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1551            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1552
1553        error_code.details = new String JavaDoc ("object with name" +
1554            key + " does not exist.");
1555
1556        throw new ApplicationError(error_code);
1557    }
1558
1559    if (!Utils.packageIsSupported(VERSION_PACKAGE,
1560            packagesGet(name))) {
1561        throw new NOversionPackageException();
1562    }
1563
1564    IpNodeDataStructure ipNodeData = (IpNodeDataStructure)this.elements.get(key);
1565
1566    ipNodeData.version = version;
1567    Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
1568            (short) LogSeverity._Info,
1569            "Version set to " + version);
1570    }
1571    //
1572
// IDL:itu.intt/itut_m3120/ManagedElement_F/locationNameGet:1.0
1573
//
1574
/**
1575     ** Implementation of the ::itut_m3120::ManagedElement_F::locationNameGet operation.
1576     **/

1577    public java.lang.String JavaDoc
1578    locationNameGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
1579    throws intt.itu.itut_x780.ApplicationError, intt.itu.itut_m3120.NOlocationNamePackageException
1580    {
1581        //
1582
// DONE : implement
1583
//
1584

1585    DataType sysLocationData = null;
1586
1587    String JavaDoc key = Utils.name2string(name);
1588
1589    if (this.elements.containsKey(key) == false) {
1590
1591        ApplicationErrorInfoTypeImpl error_code =
1592            new ApplicationErrorInfoTypeImpl();
1593
1594        error_code.error = new UIDType(
1595            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1596            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1597
1598        error_code.details = new String JavaDoc ("object with name" +
1599            key + " does not exist.");
1600
1601        throw new ApplicationError(error_code);
1602    }
1603
1604    if (!Utils.packageIsSupported(LOCATION_NAME_PACKAGE,
1605            packagesGet(name))) {
1606        System.out.println("Package " + LOCATION_NAME_PACKAGE +
1607            "is not supported by IpNode Object" + key);
1608
1609        throw new NOlocationNamePackageException();
1610    }
1611
1612
1613    try {
1614
1615        sysLocationData = this.connector.get(
1616            SnmpIdentifiers.SYS_LOCATION_OID,
1617            new String JavaDoc(this.managementIPAddressGet(name)),
1618            this.snmpPortGet(name),
1619            SnmpIdentifiers.READ_COMMUNITY);
1620    }
1621    catch (SnmpApplicationError e) {
1622
1623        ApplicationErrorInfoTypeImpl error_code =
1624        new ApplicationErrorInfoTypeImpl();
1625
1626        error_code.error = new UIDType(
1627            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1628            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1629
1630        if (e.reason.equals(ExceptionMessages.agent_response_error))
1631            error_code.details = ExceptionMessages.agent_response_error;
1632        else
1633            error_code.details = new String JavaDoc ("Could not retrieve sysLocation " +
1634                 "for IpNode Object with name " + key + ":" +
1635                 " Object with Snmp Object Identifier " + SnmpIdentifiers.SYS_LOCATION_OID +
1636                 " does not exist.");
1637
1638        Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
1639          (short) LogSeverity._Error,
1640          "SNMP Error getting the system location: " + e.reason);
1641
1642        throw new ApplicationError(error_code);
1643
1644    }
1645
1646    org.omg.CORBA.Any JavaDoc value = sysLocationData.value;
1647    //by digi
1648
//if(value.type().kind().value() != TCKind._tk_string) {
1649
if (value.type().kind().value() != org.omg.CORBA.OctetSeqHelper.type().kind().value()) {
1650        ApplicationErrorInfoTypeImpl error_code =
1651            new ApplicationErrorInfoTypeImpl();
1652
1653        error_code.error = new UIDType(
1654            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1655            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1656
1657        error_code.details = new String JavaDoc ("Could not retrieve sysLocation " +
1658             "for IpNode Object with name " + key + ":" +
1659             " Object with Snmp Object Identifier " + SnmpIdentifiers.SYS_LOCATION_OID +
1660             " is not of expected type.");
1661
1662        throw new ApplicationError(error_code);
1663
1664    }
1665    // by digi
1666
//String sysLocation = value.extract_string();
1667
String JavaDoc sysLocation = new String JavaDoc(org.omg.CORBA.OctetSeqHelper.extract(value));
1668    return sysLocation;
1669    }
1670    //
1671
// IDL:itu.intt/itut_m3120/ManagedElement_F/locationNameSet:1.0
1672
//
1673
/**
1674     ** Implementation of the ::itut_m3120::ManagedElement_F::locationNameSet operation.
1675     **/

1676    public void
1677    locationNameSet(org.omg.CosNaming.NameComponent JavaDoc[] name, java.lang.String JavaDoc locationName)
1678    throws intt.itu.itut_x780.ApplicationError, intt.itu.itut_m3120.NOlocationNamePackageException
1679    {
1680        //
1681
// DONE : implement
1682
//
1683

1684    String JavaDoc key = Utils.name2string(name);
1685
1686    if (this.elements.containsKey(key) == false) {
1687
1688        ApplicationErrorInfoTypeImpl error_code =
1689            new ApplicationErrorInfoTypeImpl();
1690
1691        error_code.error = new UIDType(
1692            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1693            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1694
1695        error_code.details = new String JavaDoc ("object with name" +
1696            key + " does not exist.");
1697
1698        throw new ApplicationError(error_code);
1699    }
1700
1701    if (!Utils.packageIsSupported(LOCATION_NAME_PACKAGE,
1702            packagesGet(name))) {
1703        System.out.println("Package " + LOCATION_NAME_PACKAGE +
1704            "is not supported by IpNode Object" + key);
1705
1706        throw new NOlocationNamePackageException();
1707    }
1708
1709    org.omg.CORBA.Any JavaDoc value = orb.create_any();
1710    // by digi
1711
//value.insert_string(locationName);
1712

1713    org.omg.CORBA.OctetSeqHelper.insert(value, locationName.getBytes());
1714
1715    DataTypeImpl sysLocationData = new DataTypeImpl(
1716        SnmpIdentifiers.SYS_LOCATION_OID,
1717        value,
1718        SnmpSMI.SMI_STRING);
1719
1720    try {
1721
1722        this.connector.set(
1723            sysLocationData,
1724            new String JavaDoc(this.managementIPAddressGet(name)),
1725            this.snmpPortGet(name),
1726            SnmpIdentifiers.WRITE_COMMUNITY);
1727    }
1728    catch (SnmpApplicationError e) {
1729
1730        ApplicationErrorInfoTypeImpl error_code =
1731            new ApplicationErrorInfoTypeImpl();
1732
1733        error_code.error = new UIDType(
1734            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1735            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1736
1737        if (e.reason.equals(ExceptionMessages.agent_response_error))
1738            error_code.details = ExceptionMessages.agent_response_error;
1739        else
1740            error_code.details = new String JavaDoc ("Could not set sysLocation " +
1741                 "for IpNode Object with name " + key + ".");
1742
1743        Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
1744          (short) LogSeverity._Error,
1745          "SNMP Error setting the system location: " + e.reason);
1746
1747        throw new ApplicationError(error_code);
1748
1749    }
1750    Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
1751            (short) LogSeverity._Info,
1752            "Location Name set to " + locationName);
1753  }
1754
1755    //
1756
// IDL:itu.intt/itut_x780/ManagedObject_F/objectClassGet:1.0
1757
//
1758
/**
1759     ** Implementation of the ::itut_x780::ManagedObject_F::objectClassGet operation.
1760     **/

1761
1762    public java.lang.String JavaDoc
1763    objectClassGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
1764    throws intt.itu.itut_x780.ApplicationError
1765    {
1766        //
1767
// DONE : implement
1768
//
1769

1770    String JavaDoc key = Utils.name2string(name);
1771
1772    if (this.elements.containsKey(key) == false) {
1773
1774        ApplicationErrorInfoTypeImpl error_code =
1775            new ApplicationErrorInfoTypeImpl();
1776
1777        error_code.error = new UIDType(
1778            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1779            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1780
1781        error_code.details = new String JavaDoc ("object with name" +
1782            key + " does not exist.");
1783
1784        throw new ApplicationError(error_code);
1785    }
1786
1787    IpNodeDataStructure ipNodeData =
1788        (IpNodeDataStructure)this.elements.get(key);
1789
1790    return ipNodeData.objectclass;
1791    }
1792    //
1793
// IDL:itu.intt/itut_x780/ManagedObject_F/attributesGet:1.0
1794
//
1795
/**
1796     ** Implementation of the ::itut_x780::ManagedObject_F::attributesGet operation.
1797     **/

1798    public intt.itu.itut_x780.ManagedObjectValueType
1799    attributesGet(org.omg.CosNaming.NameComponent JavaDoc[] name, intt.itu.itut_x780.StringSetTypeHolder attributeNames)
1800    throws intt.itu.itut_x780.ApplicationError
1801    {
1802        //
1803
// DONE : implement
1804
//
1805

1806    String JavaDoc key = Utils.name2string(name);
1807
1808    if (this.elements.containsKey(key) == false) {
1809
1810        ApplicationErrorInfoTypeImpl error_code =
1811            new ApplicationErrorInfoTypeImpl();
1812
1813        error_code.error = new UIDType(
1814            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1815            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1816
1817        error_code.details = new String JavaDoc ("object with name" +
1818            key + " does not exist.");
1819
1820        throw new ApplicationError(error_code);
1821    }
1822
1823    IpNodeDataStructure ipNodeData =
1824        (IpNodeDataStructure)this.elements.get(key);
1825
1826    String JavaDoc userLabel = new String JavaDoc();
1827    String JavaDoc vendorName = new String JavaDoc();
1828    String JavaDoc version = new String JavaDoc();
1829    String JavaDoc locationName = new String JavaDoc();
1830
1831    try {
1832        userLabel = userLabelGet(name);
1833    }
1834    catch (NOuserLabelPackageException noUserLabel) {
1835
1836    }
1837
1838    try {
1839        vendorName = vendorNameGet(name);
1840    }
1841    catch (NOvendorNamePackageException noVendorName) {
1842
1843    }
1844
1845    try {
1846        version = versionGet(name);
1847    }
1848    catch (NOversionPackageException noVersion) {
1849
1850    }
1851
1852    try {
1853        locationName = locationNameGet(name);
1854    }
1855    catch (NOlocationNamePackageException noLocation) {
1856
1857    }
1858
1859    IpNodeValueTypeImpl ipNodeValueType = new IpNodeValueTypeImpl(
1860
1861        ipNodeData.administrativeState,
1862        this.operationalStateGet(name),
1863        this.usageStateGet(name),
1864        userLabel,
1865        vendorName,
1866        version,
1867        locationName,
1868        ipNodeData.domainName,
1869        ipNodeData.hostname,
1870        ipNodeData.managementIPAddress,
1871        ipNodeData.supportedSnmpVersions,
1872        ipNodeData.snmpPort,
1873        this.ifNumberGet(name),
1874        this.sysDescrGet(name),
1875        this.sysObjectIDGet(name),
1876        this.sysUpTimeGet(name),
1877        this.sysContactGet(name),
1878        this.sysNameGet(name),
1879        this.sysServicesGet(name),
1880        ipNodeData.name,
1881        ipNodeData.objectclass,
1882        ipNodeData.packageNameList,
1883        ipNodeData.sourceIndicator,
1884        ipNodeData.deletePolicy
1885    );
1886      Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name), (short) LogSeverity._Info,
1887          "attributesGet finished OK");
1888
1889    return ipNodeValueType;
1890    }
1891    //
1892
// IDL:itu.intt/itut_x780/ManagedObject_F/packagesGet:1.0
1893
//
1894
/**
1895     ** Implementation of the ::itut_x780::ManagedObject_F::packagesGet operation.
1896     **/

1897    public java.lang.String JavaDoc[]
1898    packagesGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
1899    throws intt.itu.itut_x780.ApplicationError
1900    {
1901        //
1902
// DONE : implement
1903
//
1904

1905    String JavaDoc key = Utils.name2string(name);
1906
1907    if (this.elements.containsKey(key) == false) {
1908
1909        ApplicationErrorInfoTypeImpl error_code =
1910            new ApplicationErrorInfoTypeImpl();
1911
1912        error_code.error = new UIDType(
1913            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1914            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1915
1916        error_code.details = new String JavaDoc ("object with name" +
1917            key + " does not exist.");
1918
1919        throw new ApplicationError(error_code);
1920    }
1921
1922    IpNodeDataStructure ipNodeData =
1923        (IpNodeDataStructure)this.elements.get(key);
1924
1925    return ipNodeData.packageNameList;
1926    }
1927    //
1928
// IDL:itu.intt/itut_x780/ManagedObject_F/creationSourceGet:1.0
1929
//
1930
/**
1931     ** Implementation of the ::itut_x780::ManagedObject_F::creationSourceGet operation.
1932     **/

1933    public intt.itu.itut_x780.SourceIndicatorType
1934    creationSourceGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
1935    throws intt.itu.itut_x780.ApplicationError
1936    {
1937        //
1938
// DONE : implement
1939
//
1940

1941    String JavaDoc key = Utils.name2string(name);
1942
1943    if (this.elements.containsKey(key) == false) {
1944
1945        ApplicationErrorInfoTypeImpl error_code =
1946            new ApplicationErrorInfoTypeImpl();
1947
1948        error_code.error = new UIDType(
1949            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1950            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1951
1952        error_code.details = new String JavaDoc ("object with name" +
1953            key + " does not exist.");
1954
1955        throw new ApplicationError(error_code);
1956    }
1957
1958    IpNodeDataStructure ipNodeData =
1959        (IpNodeDataStructure)this.elements.get(key);
1960
1961    return ipNodeData.sourceIndicator;
1962    }
1963    //
1964
// IDL:itu.intt/itut_x780/ManagedObject_F/deletePolicyGet:1.0
1965
//
1966
/**
1967     ** Implementation of the ::itut_x780::ManagedObject_F::deletePolicyGet operation.
1968     **/

1969    public short
1970    deletePolicyGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
1971    throws intt.itu.itut_x780.ApplicationError
1972    {
1973        //
1974
// DONE : implement
1975
//
1976

1977    String JavaDoc key = Utils.name2string(name);
1978
1979    if (this.elements.containsKey(key) == false) {
1980
1981        ApplicationErrorInfoTypeImpl error_code =
1982            new ApplicationErrorInfoTypeImpl();
1983
1984        error_code.error = new UIDType(
1985            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1986            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1987
1988        error_code.details = new String JavaDoc ("object with name" +
1989            key + " does not exist.");
1990
1991        throw new ApplicationError(error_code);
1992    }
1993
1994    IpNodeDataStructure ipNodeData =
1995        (IpNodeDataStructure)this.elements.get(key);
1996
1997    return ipNodeData.deletePolicy;
1998    }
1999    //
2000
// IDL:itu.intt/itut_x780/ManagedObject_F/destroy:1.0
2001
//
2002
/**
2003     ** Implementation of the ::itut_x780::ManagedObject_F::destroy operation.
2004     **/

2005    public void
2006    destroy(org.omg.CosNaming.NameComponent JavaDoc[] name)
2007    throws intt.itu.itut_x780.ApplicationError, intt.itu.itut_x780.DeleteError
2008    {
2009        //
2010
// DONE : implement
2011
//
2012

2013        String JavaDoc key = Utils.name2string(name);
2014
2015        if (this.elements.containsKey(key) == false) {
2016
2017            ApplicationErrorInfoTypeImpl error_code =
2018            new ApplicationErrorInfoTypeImpl();
2019
2020            error_code.error = new UIDType(
2021            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
2022            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
2023
2024            error_code.details = new String JavaDoc ("object with name" +
2025            key + " does not exist.");
2026
2027            throw new ApplicationError(error_code);
2028        }
2029
2030        IpNodeDataStructure ipNodeData;
2031        synchronized(IpNodeProviderImpl.elements) {
2032            ipNodeData = (IpNodeDataStructure) this.elements.remove(key);
2033        }
2034        try {
2035            config.unregister(name);
2036        }
2037        catch(ist.coach.coachEmfServices.SnmpAdapter.SnmpApplicationError snmp_e) {
2038            System.err.println("There was a problem unregistering " + Utils.name2string(name) +
2039            " from the SNMP Trap Deamon");
2040
2041            Utils.pretty_log(logSupport, Utils.name2string(name),
2042            ipNodeData.objectclass, // objectClassGet(name),
2043
(short) LogSeverity._Error,
2044          "SNMP Error unregistering from the SNMP Trap Deamon: " + snmp_e.reason);
2045        }
2046
2047        org.omg.TimeBase.UtcT eventTime = new org.omg.TimeBase.UtcT(System.currentTimeMillis(),
2048                    0,(short) 0,(short) 0);
2049        get_context().push_objectDeletion(new ObjectDeletionImpl(eventTime, name,
2050                                        ipNodeData.objectclass,
2051                                        getUniqueNotificationIdentifier(),
2052                                        //ipNodeData.getUniqueNotificationIdentifier(),
2053
ipNodeData.sourceIndicator,
2054                                        new AttributeValueType[0]));
2055        Utils.pretty_log(logSupport, Utils.name2string(name),
2056            ipNodeData.objectclass, //objectClassGet(name),
2057
(short) LogSeverity._Info,
2058          "successfully removed from management system");
2059    }
2060
2061
2062  protected static int getUniqueNotificationIdentifier() {
2063
2064            notifId++;
2065
2066            return (notifId);
2067        }
2068
2069
2070
2071}
2072
Popular Tags