KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > ist > coach > coachEmsMibComponents > IpAddressDataProviderComposition > IpAddressDataProviderImpl


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.IpAddressDataProviderComposition;
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.IpAddressDataValueType;
48 import ist.coach.coachEmsCommon.SnmpIdentifiers;
49 import ist.coach.coachEmsCommon.IpAddressDataValueTypeImpl;
50
51 import org.omg.CosNaming.NameComponent JavaDoc;
52 import org.omg.CORBA.TCKind JavaDoc;
53 import ist.coach.coachEmfServices.EmfBasicLog.*;
54 import org.opennms.protocols.snmp.SnmpSMI;
55
56 import java.util.Hashtable JavaDoc;
57 /**
58  * This is the CIDL-based implementation of the
59  * OMG IDL3 IDL:coach.ist/coachEmsMibComponents/IpAddressDataProvider:1.0 component type.
60  *
61  * @author OpenCCM CIF_Jimpl Compiler.
62  */

63 public class IpAddressDataProviderImpl
64      extends ist.coach.coachEmsMibComponents.IpAddressDataProviderComposition.IpAddressDataProvider_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 = 13000;
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
//
85
// Constructors.
86
//
87
// ==================================================================
88

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

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

110         if ((connector = get_context().get_connection_connector()) == null)
111             throw new org.omg.Components.InvalidConfiguration();
112         orb = org.objectweb.ccm.CORBA.TheORB.getORB();
113       if ((logSupport = get_context().get_connection_basic_log()) == null)
114             throw new org.omg.Components.InvalidConfiguration();
115
116         System.err.println("IpAddressDataProvider 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     /**
152      * Implementation of the ::coachEmsMib::IpAddressData_F::ipAdEntAddrGet operation.
153      */

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

184     public int
185     ipAdEntIfIndexGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
186     throws intt.itu.itut_x780.ApplicationError
187     {
188         String JavaDoc key = Utils.name2string(name);
189
190         if (elements.containsKey(key) == false) {
191             ApplicationErrorInfoTypeImpl error_code =
192                 new ApplicationErrorInfoTypeImpl();
193
194             error_code.error = new UIDType(
195                 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
196                 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
197
198             error_code.details = new String JavaDoc("object with name " +
199                 key + " does not exist.");
200
201             throw new ApplicationError(error_code);
202         }
203         IpAddressDataStructure data =
204             (IpAddressDataStructure) elements.get(key);
205
206         String JavaDoc ipAdEntAddress = new String JavaDoc(data.ipAdEntAddress);
207         String JavaDoc ifIndexOid = SnmpIdentifiers.IP_ADDR_IFINDEX_OID + "." + ipAdEntAddress;
208
209         DataType ifIndexData = null;
210
211         try {
212             ifIndexData = connector.get(
213                 ifIndexOid,
214                 new String JavaDoc (data.getMgmtIpAddress()),
215                 data.getSnmpPort(),
216                 READ_COMMUNITY);
217         }
218         catch (SnmpApplicationError e) {
219
220             ApplicationErrorInfoTypeImpl error_code =
221                 new ApplicationErrorInfoTypeImpl();
222
223             error_code.error = new UIDType(
224                 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
225                 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
226
227             if (e.reason.equals(ExceptionMessages.agent_response_error))
228                 error_code.details = ExceptionMessages.agent_response_error;
229             else
230                 error_code.details = new String JavaDoc ("Could not retrieve ipAdEntIfIndex " +
231                     "for IpAddressData Object with name " + key + ":" +
232                     "\n Object with Snmp Object Identifier " + ifIndexOid +
233                     " does not exist.");
234
235           Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
236           (short) LogSeverity._Error,
237           "SNMP Error getting the ipAdEntIfIndex: " + e.reason);
238
239             throw new ApplicationError (error_code);
240         }
241
242         org.omg.CORBA.Any JavaDoc value = ifIndexData.value;
243
244
245         if (value.type().kind().value() != TCKind._tk_long) {
246             ApplicationErrorInfoTypeImpl error_code =
247                 new ApplicationErrorInfoTypeImpl();
248
249             error_code.error = new UIDType(
250                 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
251                 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
252
253             error_code.details = new String JavaDoc ("IpAddressData> Could not retrieve ipAdEntIfIndex " +
254                 "for IpAddressData Object with name " + key + ":" +
255                 " Object with Snmp Object Identifier " + ifIndexOid +
256                 " is not of expected type.");
257
258             throw new ApplicationError (error_code);
259
260         }
261
262         int ipAdEntIfIndex = value.extract_long();
263         return ipAdEntIfIndex;
264     }
265
266     /**
267      * Implementation of the ::coachEmsMib::IpAddressData_F::ipAdEntNetMaskGet operation.
268      */

269     public byte[]
270     ipAdEntNetMaskGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
271     throws intt.itu.itut_x780.ApplicationError
272     {
273         String JavaDoc key = Utils.name2string(name);
274
275         if (elements.containsKey(key) == false) {
276             ApplicationErrorInfoTypeImpl error_code =
277                 new ApplicationErrorInfoTypeImpl();
278
279             error_code.error = new UIDType(
280                 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
281                 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
282
283             error_code.details = new String JavaDoc("object with name " +
284                 key + " does not exist.");
285
286             throw new ApplicationError(error_code);
287         }
288         IpAddressDataStructure data =
289             (IpAddressDataStructure) elements.get(key);
290
291         String JavaDoc ipAdEntAddress = new String JavaDoc(data.ipAdEntAddress);
292         String JavaDoc ipNetMaskOid = SnmpIdentifiers.IP_ADDR_NETMASK_OID + "." + ipAdEntAddress;
293
294         DataType ipNetMaskData = null;
295
296         try {
297             ipNetMaskData = connector.get(
298                 ipNetMaskOid,
299                 new String JavaDoc (data.getMgmtIpAddress()),
300                 data.getSnmpPort(),
301                 READ_COMMUNITY);
302         }
303         catch (SnmpApplicationError e) {
304
305             ApplicationErrorInfoTypeImpl error_code =
306                 new ApplicationErrorInfoTypeImpl();
307
308             error_code.error = new UIDType(
309                 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
310                 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
311
312             if (e.reason.equals(ExceptionMessages.agent_response_error))
313                 error_code.details = ExceptionMessages.agent_response_error;
314             else
315                 error_code.details = new String JavaDoc ("Could not retrieve ipAdEntNetMask " +
316                     "for IpAddressData Object with name " + key + ":" +
317                     "\n Object with Snmp Object Identifier " + ipNetMaskOid +
318                     " does not exist.");
319
320           Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
321               (short) LogSeverity._Error,
322               "SNMP Error getting the ipAdEntNetMask: " + e.reason);
323
324             throw new ApplicationError (error_code);
325         }
326
327         org.omg.CORBA.Any JavaDoc value = ipNetMaskData.value;
328
329         if (value.type().kind().value() != TCKind._tk_string) {
330             ApplicationErrorInfoTypeImpl error_code =
331                 new ApplicationErrorInfoTypeImpl();
332
333             error_code.error = new UIDType(
334                 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
335                 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
336
337             error_code.details = new String JavaDoc ("IpAddressData> Could not retrieve ipAdEntNetMask " +
338                 "for IpAddressData Object with name " + key + ":" +
339                 "\n Object with Snmp Object Identifier " + ipNetMaskOid +
340                 " is not of expected type.");
341
342             throw new ApplicationError (error_code);
343
344         }
345
346         String JavaDoc ipNetMask = value.extract_string();
347         return ipNetMask.getBytes();
348     }
349
350     /**
351      * Implementation of the ::coachEmsMib::IpAddressData_F::ipAdEntBcastAddrGet operation.
352      */

353     public int
354     ipAdEntBcastAddrGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
355     throws intt.itu.itut_x780.ApplicationError
356     {
357         String JavaDoc key = Utils.name2string(name);
358
359         if (elements.containsKey(key) == false) {
360             ApplicationErrorInfoTypeImpl error_code =
361                 new ApplicationErrorInfoTypeImpl();
362
363             error_code.error = new UIDType(
364                 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
365                 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
366
367             error_code.details = new String JavaDoc("object with name " +
368                 key + " does not exist.");
369
370             throw new ApplicationError(error_code);
371         }
372         IpAddressDataStructure data =
373             (IpAddressDataStructure) elements.get(key);
374
375         String JavaDoc ipAdEntAddress = new String JavaDoc(data.ipAdEntAddress);
376         String JavaDoc ipAdEntBcastOid = SnmpIdentifiers.IP_ADDR_BCASTADDR_OID + "." + ipAdEntAddress;
377
378         DataType ipAdEntBcastData = null;
379
380         try {
381             ipAdEntBcastData = connector.get(
382                 ipAdEntBcastOid,
383                 new String JavaDoc (data.getMgmtIpAddress()),
384                 data.getSnmpPort(),
385                 READ_COMMUNITY);
386         }
387         catch (SnmpApplicationError e) {
388
389             ApplicationErrorInfoTypeImpl error_code =
390                 new ApplicationErrorInfoTypeImpl();
391
392             error_code.error = new UIDType(
393                 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
394                 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
395
396             if (e.reason.equals(ExceptionMessages.agent_response_error))
397                 error_code.details = ExceptionMessages.agent_response_error;
398             else
399                 error_code.details = new String JavaDoc ("Could not retrieve ipAdEntBcastAddr " +
400                     "for IpAddressData Object with name " + key + ":" +
401                     "\n Object with Snmp Object Identifier " + ipAdEntBcastOid +
402                     " does not exist.");
403
404               Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
405                 (short) LogSeverity._Error,
406                 "SNMP Error getting the ipAdEntBcastAddr: " + e.reason);
407
408             throw new ApplicationError (error_code);
409         }
410
411         org.omg.CORBA.Any JavaDoc value = ipAdEntBcastData.value;
412
413
414         if (value.type().kind().value() != TCKind._tk_long) {
415             ApplicationErrorInfoTypeImpl error_code =
416                 new ApplicationErrorInfoTypeImpl();
417
418             error_code.error = new UIDType(
419                 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
420                 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
421
422             error_code.details = new String JavaDoc ("IpAddressData> Could not retrieve ipAdEntBcastAddr " +
423                 "for IpAddressData Object with name " + key + ":" +
424                 "\n Object with Snmp Object Identifier " + ipAdEntBcastOid +
425                 " is not of expected type.");
426
427             throw new ApplicationError (error_code);
428
429         }
430
431         int ipAdEntBcastAddr = value.extract_long();
432         return ipAdEntBcastAddr;
433     }
434
435     /**
436      * Implementation of the ::coachEmsMib::IpAddressData_F::ipAdEntReasmMaxSizeGet operation.
437      */

438     public short
439     ipAdEntReasmMaxSizeGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
440     throws intt.itu.itut_x780.ApplicationError
441     {
442         String JavaDoc key = Utils.name2string(name);
443
444         if (elements.containsKey(key) == false) {
445             ApplicationErrorInfoTypeImpl error_code =
446                 new ApplicationErrorInfoTypeImpl();
447
448             error_code.error = new UIDType(
449                 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
450                 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
451
452             error_code.details = new String JavaDoc("object with name " +
453                 key + " does not exist.");
454
455             throw new ApplicationError(error_code);
456         }
457         IpAddressDataStructure data =
458             (IpAddressDataStructure) elements.get(key);
459
460         String JavaDoc ipAdEntAddress = new String JavaDoc(data.ipAdEntAddress);
461         String JavaDoc ipAdEntReasmMaxSizeOid = SnmpIdentifiers.IP_ADDR_REASMMAX_OID + "." + ipAdEntAddress;
462
463         DataType ipAdEntReasmMaxSizeData = null;
464
465         try {
466             ipAdEntReasmMaxSizeData = connector.get(
467                 ipAdEntReasmMaxSizeOid,
468                 new String JavaDoc (data.getMgmtIpAddress()),
469                 data.getSnmpPort(),
470                 READ_COMMUNITY);
471         }
472         catch (SnmpApplicationError e) {
473
474             ApplicationErrorInfoTypeImpl error_code =
475                 new ApplicationErrorInfoTypeImpl();
476
477             error_code.error = new UIDType(
478                 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
479                 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
480
481             if (e.reason.equals(ExceptionMessages.agent_response_error))
482                 error_code.details = ExceptionMessages.agent_response_error;
483             else
484                 error_code.details = new String JavaDoc ("Could not retrieve ipAdEntReasmMaxSize " +
485                     "for IpAddressData Object with name " + key + ":" +
486                     "\n Object with Snmp Object Identifier " + ipAdEntReasmMaxSizeOid +
487                     " does not exist.");
488               Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
489                 (short) LogSeverity._Error,
490                 "SNMP Error getting the ipAdEntReasmMaxSize: " + e.reason);
491
492             throw new ApplicationError (error_code);
493
494
495         }
496
497         org.omg.CORBA.Any JavaDoc value = ipAdEntReasmMaxSizeData.value;
498
499         //System.err.println("value.type().kind().value() = " + value.type().kind().value() );
500
if (value.type().kind().value() != TCKind._tk_long) {
501             ApplicationErrorInfoTypeImpl error_code =
502                 new ApplicationErrorInfoTypeImpl();
503
504             error_code.error = new UIDType(
505                 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
506                 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
507
508             error_code.details = new String JavaDoc ("IpAddressData> Could not retrieve ipAdEntReasmMaxSize " +
509                 "for IpAddressData Object with name " + key + ":" +
510                 "\n Object with Snmp Object Identifier " + ipAdEntReasmMaxSizeOid +
511                 " is not of expected type.");
512
513             //throw new ApplicationError (error_code);
514
//System.err.println("IpAddressData> ipAdEntReasmMaxSize: error_code.details=" + error_code.details);
515
return -1;
516         }
517
518         int ipAdEntReasmMaxSize = (int) value.extract_long();
519         return (short) ipAdEntReasmMaxSize;
520
521     }
522
523     /**
524      * Implementation of the ::itut_x780::ManagedObject_F::nameGet operation.
525      */

526     public org.omg.CosNaming.NameComponent JavaDoc[]
527     nameGet()
528     {
529         //
530
// DONE : implement
531
//
532
return Utils.string2name(_facade_name);
533     }
534
535     /**
536      * Implementation of the ::itut_x780::ManagedObject_F::objectClassGet operation.
537      */

538     public String JavaDoc
539     objectClassGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
540     throws intt.itu.itut_x780.ApplicationError
541     {
542          //
543
// DONE : implement
544
//
545
String JavaDoc key = Utils.name2string(name);
546
547         if (elements.containsKey(key) == false) {
548             ApplicationErrorInfoTypeImpl error_code =
549                 new ApplicationErrorInfoTypeImpl();
550
551             error_code.error = new UIDType(
552                 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
553                 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
554
555             error_code.details = new String JavaDoc("object with name " +
556                 key + " does not exist.");
557
558             throw new ApplicationError(error_code);
559         }
560
561         IpAddressDataStructure data =
562             (IpAddressDataStructure) elements.get(key);
563
564         return data.objectclass;
565
566     }
567
568     /**
569      * Implementation of the ::itut_x780::ManagedObject_F::attributesGet operation.
570      */

571     public intt.itu.itut_x780.ManagedObjectValueType
572     attributesGet(org.omg.CosNaming.NameComponent JavaDoc[] name, intt.itu.itut_x780.StringSetTypeHolder attributeNames)
573     throws intt.itu.itut_x780.ApplicationError
574     {
575        //
576
// DONE : implement
577
//
578
String JavaDoc key = Utils.name2string(name);
579
580         if (elements.containsKey(key) == false) {
581             ApplicationErrorInfoTypeImpl error_code =
582                 new ApplicationErrorInfoTypeImpl();
583
584             error_code.error = new UIDType(
585                 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
586                 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
587
588             error_code.details = new String JavaDoc("object with name " +
589                 key + " does not exist.");
590
591             throw new ApplicationError(error_code);
592         }
593
594         IpAddressDataStructure data =
595             (IpAddressDataStructure) elements.get(key);
596
597         IpAddressDataValueTypeImpl ipAddressDataValueType =
598             new IpAddressDataValueTypeImpl(
599                 ipAdEntAddrGet(name),
600                 ipAdEntIfIndexGet(name),
601                 ipAdEntNetMaskGet(name),
602                 ipAdEntBcastAddrGet(name),
603                 ipAdEntReasmMaxSizeGet(name),
604                 data.name,
605                 data.objectclass,
606                 data.packages,
607                 data.sourceIndicator,
608                 data.deletePolicy
609             );
610           Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name), (short) LogSeverity._Info,
611           "attributesGet finished OK");
612
613             return ipAddressDataValueType;
614     }
615
616     /**
617      * Implementation of the ::itut_x780::ManagedObject_F::packagesGet operation.
618      */

619     public String JavaDoc[]
620     packagesGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
621     throws intt.itu.itut_x780.ApplicationError
622     {
623                 //
624
// DONE : implement
625
//
626
String JavaDoc key = Utils.name2string(name);
627
628         if (elements.containsKey(key) == false) {
629             ApplicationErrorInfoTypeImpl error_code =
630                 new ApplicationErrorInfoTypeImpl();
631
632             error_code.error = new UIDType(
633                 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
634                 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
635
636             error_code.details = new String JavaDoc("object with name " +
637                 key + " does not exist.");
638
639             throw new ApplicationError(error_code);
640         }
641
642         IpAddressDataStructure data =
643             (IpAddressDataStructure) elements.get(key);
644
645         return data.packages;
646     }
647
648     /**
649      * Implementation of the ::itut_x780::ManagedObject_F::creationSourceGet operation.
650      */

651     public intt.itu.itut_x780.SourceIndicatorType
652     creationSourceGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
653     throws intt.itu.itut_x780.ApplicationError
654     {
655         String JavaDoc key = Utils.name2string(name);
656
657         if (elements.containsKey(key) == false) {
658             ApplicationErrorInfoTypeImpl error_code =
659                 new ApplicationErrorInfoTypeImpl();
660
661             error_code.error = new UIDType(
662                 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
663                 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
664
665             error_code.details = new String JavaDoc("object with name " +
666                 key + " does not exist.");
667
668             throw new ApplicationError(error_code);
669         }
670
671         IpAddressDataStructure data =
672             (IpAddressDataStructure) elements.get(key);
673
674         return data.sourceIndicator;
675     }
676
677     /**
678      * Implementation of the ::itut_x780::ManagedObject_F::deletePolicyGet operation.
679      */

680     public short
681     deletePolicyGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
682     throws intt.itu.itut_x780.ApplicationError
683     {
684         String JavaDoc key = Utils.name2string(name);
685
686         if (elements.containsKey(key) == false) {
687             ApplicationErrorInfoTypeImpl error_code =
688                 new ApplicationErrorInfoTypeImpl();
689
690             error_code.error = new UIDType(
691                 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
692                 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
693
694             error_code.details = new String JavaDoc("object with name " +
695                 key + " does not exist.");
696
697             throw new ApplicationError(error_code);
698         }
699
700         IpAddressDataStructure data =
701             (IpAddressDataStructure) elements.get(key);
702
703         return data.deletePolicy;
704     }
705
706     /**
707      * Implementation of the ::itut_x780::ManagedObject_F::destroy operation.
708      */

709     public void
710     destroy(org.omg.CosNaming.NameComponent JavaDoc[] name)
711     throws intt.itu.itut_x780.ApplicationError,
712
713            intt.itu.itut_x780.DeleteError
714     {
715
716
717       if (!elements.containsKey(Utils.name2string(name))) {
718
719             ApplicationErrorInfoTypeImpl error_code =
720             new ApplicationErrorInfoTypeImpl();
721
722             error_code.error = new UIDType(
723             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
724             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
725
726             error_code.details = new String JavaDoc ("object with name " +
727             Utils.name2string(name) + " does not exist.");
728
729             throw new ApplicationError(error_code);
730
731       }
732       IpAddressDataStructure ipAddressData = null;
733       synchronized(elements) {
734         ipAddressData =
735             (IpAddressDataStructure) elements.remove(
736             Utils.name2string(name));
737     }
738     org.omg.TimeBase.UtcT eventTime = new org.omg.TimeBase.UtcT(System.currentTimeMillis(),
739         0, (short) 0, (short) 0);
740     get_context().push_objectDeletion(new ObjectDeletionImpl(eventTime, name,
741                         ipAddressData.objectclass,
742                         getUniqueNotificationIdentifier(),
743                         ipAddressData.sourceIndicator,
744                         new AttributeValueType[0]));
745     Utils.pretty_log(logSupport, Utils.name2string(name),
746             ipAddressData.objectclass, //objectClassGet(name),
747
(short) LogSeverity._Info,
748           "successfully removed from management system");
749
750     }
751
752     protected static int getUniqueNotificationIdentifier() {
753
754         notifId++;
755         return notifId;
756     }
757
758 }
759
Popular Tags