KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > ist > coach > itut_m3120Components > ManagedElementProviderComposition > ManagedElementProviderImpl


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.itut_m3120Components.ManagedElementProviderComposition;
30
31 import intt.itu.itut_x780.UIDType;
32
33 import intt.itu.itut_x780.ApplicationError;
34 import intt.itu.itut_x780.ManagedObjectValueType;
35 import intt.itu.itut_x780.AttributeValueChangeType;
36 import intt.itu.itut_x780.AttributeValueType;
37 import intt.itu.itut_x780.SourceIndicatorType;
38 import intt.itu.itut_x780.OperationalStateTypeHelper;
39
40 import intt.itu.itut_m3120.NOuserLabelPackageException;
41 import intt.itu.itut_m3120.NOvendorNamePackageException;
42 import intt.itu.itut_m3120.NOversionPackageException;
43 import intt.itu.itut_m3120.NOlocationNamePackageException;
44 import intt.itu.itut_m3120.ManagedElementValueType;
45
46 import ist.coach.coachEmfCommon.Utils;
47 import ist.coach.coachEmfCommon.ExceptionMessages;
48 import ist.coach.coachEmfCommon.StateChangedEventImpl;
49 import ist.coach.coachEmfCommon.ObjectDeletionImpl;
50
51 import ist.coach.coachEmfCommon.ApplicationErrorInfoTypeImpl;
52
53 import java.util.Hashtable JavaDoc;
54 import ist.coach.coachEmfServices.EmfBasicLog.*;
55 /**
56  * This is the CIDL-based implementation of the
57  * OMG IDL3 IDL:coach.ist/itut_m3120Components/ManagedElementProvider:1.0 component type.
58  *
59  * @author OpenCCM CIF_Jimpl Compiler.
60  */

61 public class ManagedElementProviderImpl
62      extends ist.coach.itut_m3120Components.ManagedElementProviderComposition.ManagedElementProvider_impl
63 {
64     // ==================================================================
65
//
66
// Internal states.
67
//
68
// ==================================================================
69
private String JavaDoc _facade_name;
70     private static int notifId = 200;
71     protected static Hashtable JavaDoc elements;
72     private BasicLog logSupport;
73     // ==================================================================
74
//
75
// Constructors.
76
//
77
// ==================================================================
78

79     public ManagedElementProviderImpl()
80     {
81      elements = new java.util.Hashtable JavaDoc();
82     }
83     // ==================================================================
84
//
85
// Methods for the OMG IDL Components::EnterpriseComponent local interface.
86
//
87
// ==================================================================
88
//
89
// IDL:omg.org/Components/EnterpriseComponent/configuration_complete:1.0
90
//
91
/**
92      ** Completes the component configuration.
93      **
94      ** @throws org.omg.Components.InvalidConfiguration
95      ** Thrown if the configuration is invalid.
96      **/

97     public void
98     configuration_complete()
99     throws org.omg.Components.InvalidConfiguration
100     {
101         //
102
// DONE : implement !!!
103
//
104
if ((logSupport = get_context().get_connection_basic_log()) == null)
105             throw new org.omg.Components.InvalidConfiguration();
106
107         System.err.println(facade_name() + " configuration completed...");
108     }
109     // ==================================================================
110
//
111
// Util Methods.
112
//
113
// ==================================================================
114
protected static synchronized int getUniqueNotificationIdentifier() {
115
116        notifId++;
117
118        return (notifId);
119    }
120     // ==================================================================
121
//
122
// Methods.
123
//
124
// ==================================================================
125

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

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

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

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

185     public void
186     administrativeStateSet(org.omg.CosNaming.NameComponent JavaDoc[] name, intt.itu.itut_x780.AdministrativeStateType administrativeState)
187     throws intt.itu.itut_x780.ApplicationError
188     {
189         //
190
// DONE : implement
191
//
192
String JavaDoc key = Utils.name2string(name);
193         if (this.elements.containsKey(key) == false) {
194
195           ApplicationErrorInfoTypeImpl error_code =
196             new ApplicationErrorInfoTypeImpl();
197
198           error_code.error = new UIDType(
199             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
200             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
201
202           error_code.details = new String JavaDoc ("object with name " +
203             key + " does not exist.");
204
205           throw new ApplicationError(error_code);
206         }
207         synchronized(elements) {
208           ManagedElementValueType mo_value =
209           (ManagedElementValueType) elements.remove(key);
210             mo_value.administrativeState = administrativeState;
211
212           elements.put(key, mo_value);
213         }
214         Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
215             (short) LogSeverity._Info,
216             "AdministrativeState set to " + administrativeState);
217     }
218
219     /**
220      * Implementation of the ::itut_m3120::ManagedElement_F::operationalStateGet operation.
221      */

222     public intt.itu.itut_x780.OperationalStateType
223     operationalStateGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
224     throws intt.itu.itut_x780.ApplicationError
225     {
226         //
227
// DONE : implement
228
//
229
String JavaDoc key = Utils.name2string(name);
230         if (this.elements.containsKey(key) == false) {
231
232           ApplicationErrorInfoTypeImpl error_code =
233             new ApplicationErrorInfoTypeImpl();
234
235           error_code.error = new UIDType(
236             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
237             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
238
239           error_code.details = new String JavaDoc ("object with name" +
240             key + " does not exist.");
241
242           throw new ApplicationError(error_code);
243        }
244        ManagedElementValueType mo_value =
245         (ManagedElementValueType) elements.get(key);
246
247         return mo_value.operationalState;
248
249     }
250
251     /**
252      * Implementation of the ::itut_m3120::ManagedElement_F::usageStateGet operation.
253      */

254     public intt.itu.itut_x780.UsageStateType
255     usageStateGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
256     throws intt.itu.itut_x780.ApplicationError
257     {
258         //
259
// DONE : implement
260
//
261
String JavaDoc key = Utils.name2string(name);
262         if (this.elements.containsKey(key) == false) {
263
264           ApplicationErrorInfoTypeImpl error_code =
265             new ApplicationErrorInfoTypeImpl();
266
267           error_code.error = new UIDType(
268             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
269             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
270
271           error_code.details = new String JavaDoc ("object with name" +
272             key + " does not exist.");
273
274           throw new ApplicationError(error_code);
275        }
276        ManagedElementValueType mo_value =
277         (ManagedElementValueType) elements.get(key);
278
279         return mo_value.usageState;
280
281     }
282
283     /**
284      * Implementation of the ::itut_m3120::ManagedElement_F::userLabelGet operation.
285      */

286     public String JavaDoc
287     userLabelGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
288     throws intt.itu.itut_x780.ApplicationError,
289
290            intt.itu.itut_m3120.NOuserLabelPackageException
291     {
292         //
293
// DONE : implement
294
//
295
String JavaDoc key = Utils.name2string(name);
296         if (this.elements.containsKey(key) == false) {
297
298           ApplicationErrorInfoTypeImpl error_code =
299             new ApplicationErrorInfoTypeImpl();
300
301           error_code.error = new UIDType(
302             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
303             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
304
305           error_code.details = new String JavaDoc ("object with name" +
306             key + " does not exist.");
307
308           throw new ApplicationError(error_code);
309        }
310        ManagedElementValueType mo_value =
311         (ManagedElementValueType) elements.get(key);
312
313         return mo_value.userLabel;
314     }
315
316     /**
317      * Implementation of the ::itut_m3120::ManagedElement_F::userLabelSet operation.
318      */

319     public void
320     userLabelSet(org.omg.CosNaming.NameComponent JavaDoc[] name, String JavaDoc userLabel)
321     throws intt.itu.itut_x780.ApplicationError,
322
323            intt.itu.itut_m3120.NOuserLabelPackageException
324     {
325         //
326
// DONE : implement
327
//
328
String JavaDoc key = Utils.name2string(name);
329         if (this.elements.containsKey(key) == false) {
330
331           ApplicationErrorInfoTypeImpl error_code =
332             new ApplicationErrorInfoTypeImpl();
333
334           error_code.error = new UIDType(
335             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
336             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
337
338           error_code.details = new String JavaDoc ("object with name " +
339             key + " does not exist.");
340
341           throw new ApplicationError(error_code);
342         }
343         synchronized(elements) {
344             ManagedElementValueType mo_value =
345             (ManagedElementValueType) elements.remove(key);
346             mo_value.userLabel = userLabel;
347
348             elements.put(key, mo_value);
349         }
350         Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
351             (short) LogSeverity._Info,
352             "User Label set to " + userLabel);
353     }
354
355     /**
356      * Implementation of the ::itut_m3120::ManagedElement_F::vendorNameGet operation.
357      */

358     public String JavaDoc
359     vendorNameGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
360     throws intt.itu.itut_x780.ApplicationError,
361
362            intt.itu.itut_m3120.NOvendorNamePackageException
363     {
364          //
365
// DONE : implement
366
//
367
String JavaDoc key = Utils.name2string(name);
368         if (this.elements.containsKey(key) == false) {
369
370           ApplicationErrorInfoTypeImpl error_code =
371             new ApplicationErrorInfoTypeImpl();
372
373           error_code.error = new UIDType(
374             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
375             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
376
377           error_code.details = new String JavaDoc ("object with name" +
378             key + " does not exist.");
379
380           throw new ApplicationError(error_code);
381        }
382        ManagedElementValueType mo_value =
383         (ManagedElementValueType) elements.get(key);
384
385         return mo_value.vendorName;
386     }
387
388     /**
389      * Implementation of the ::itut_m3120::ManagedElement_F::vendorNameSet operation.
390      */

391     public void
392     vendorNameSet(org.omg.CosNaming.NameComponent JavaDoc[] name, String JavaDoc vendorName)
393     throws intt.itu.itut_x780.ApplicationError,
394
395            intt.itu.itut_m3120.NOvendorNamePackageException
396     {
397         //
398
// DONE : implement
399
//
400
String JavaDoc key = Utils.name2string(name);
401         if (this.elements.containsKey(key) == false) {
402
403           ApplicationErrorInfoTypeImpl error_code =
404             new ApplicationErrorInfoTypeImpl();
405
406           error_code.error = new UIDType(
407             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
408             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
409
410           error_code.details = new String JavaDoc ("object with name " +
411             key + " does not exist.");
412
413           throw new ApplicationError(error_code);
414         }
415
416         synchronized(elements) {
417           ManagedElementValueType mo_value =
418               (ManagedElementValueType) elements.remove(key);
419           mo_value.vendorName = vendorName;
420
421           elements.put(key, mo_value);
422         }
423         Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
424             (short) LogSeverity._Info,
425             "Vendor Name set to " + vendorName);
426     }
427
428     /**
429      * Implementation of the ::itut_m3120::ManagedElement_F::versionGet operation.
430      */

431     public String JavaDoc
432     versionGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
433     throws intt.itu.itut_x780.ApplicationError,
434
435            intt.itu.itut_m3120.NOversionPackageException
436     {
437         //
438
// DONE : implement
439
//
440
String JavaDoc key = Utils.name2string(name);
441         if (this.elements.containsKey(key) == false) {
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 ("object with name" +
451             key + " does not exist.");
452
453           throw new ApplicationError(error_code);
454        }
455        ManagedElementValueType mo_value =
456         (ManagedElementValueType) elements.get(key);
457
458         return mo_value.version;
459     }
460
461     /**
462      * Implementation of the ::itut_m3120::ManagedElement_F::versionSet operation.
463      */

464     public void
465     versionSet(org.omg.CosNaming.NameComponent JavaDoc[] name, String JavaDoc version)
466     throws intt.itu.itut_x780.ApplicationError,
467
468            intt.itu.itut_m3120.NOversionPackageException
469     {
470         //
471
// DONE : implement
472
//
473
String JavaDoc key = Utils.name2string(name);
474         if (this.elements.containsKey(key) == false) {
475
476           ApplicationErrorInfoTypeImpl error_code =
477             new ApplicationErrorInfoTypeImpl();
478
479           error_code.error = new UIDType(
480             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
481             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
482
483           error_code.details = new String JavaDoc ("object with name " +
484             key + " does not exist.");
485
486           throw new ApplicationError(error_code);
487         }
488         synchronized(elements) {
489           ManagedElementValueType mo_value =
490             (ManagedElementValueType) elements.remove(key);
491           mo_value.version = version;
492
493           elements.put(key, mo_value);
494         }
495         Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
496             (short) LogSeverity._Info,
497             "Version set to " + version);
498     }
499
500     /**
501      * Implementation of the ::itut_m3120::ManagedElement_F::locationNameGet operation.
502      */

503     public String JavaDoc
504     locationNameGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
505     throws intt.itu.itut_x780.ApplicationError,
506
507            intt.itu.itut_m3120.NOlocationNamePackageException
508     {
509         //
510
// DONE : implement
511
//
512
String JavaDoc key = Utils.name2string(name);
513         if (this.elements.containsKey(key) == false) {
514
515           ApplicationErrorInfoTypeImpl error_code =
516             new ApplicationErrorInfoTypeImpl();
517
518           error_code.error = new UIDType(
519             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
520             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
521
522           error_code.details = new String JavaDoc ("object with name" +
523             key + " does not exist.");
524
525           throw new ApplicationError(error_code);
526        }
527        ManagedElementValueType mo_value =
528         (ManagedElementValueType) elements.get(key);
529
530         return mo_value.locationName;
531
532     }
533
534     /**
535      * Implementation of the ::itut_m3120::ManagedElement_F::locationNameSet operation.
536      */

537     public void
538     locationNameSet(org.omg.CosNaming.NameComponent JavaDoc[] name, String JavaDoc locationName)
539     throws intt.itu.itut_x780.ApplicationError,
540
541            intt.itu.itut_m3120.NOlocationNamePackageException
542     {
543         //
544
// DONE : implement
545
//
546
String JavaDoc key = Utils.name2string(name);
547         if (this.elements.containsKey(key) == false) {
548
549           ApplicationErrorInfoTypeImpl error_code =
550             new ApplicationErrorInfoTypeImpl();
551
552           error_code.error = new UIDType(
553             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
554             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
555
556           error_code.details = new String JavaDoc ("object with name " +
557             key + " does not exist.");
558
559           throw new ApplicationError(error_code);
560         }
561         synchronized(elements) {
562           ManagedElementValueType mo_value =
563             (ManagedElementValueType) elements.remove(key);
564           mo_value.locationName = locationName;
565
566           elements.put(key, mo_value);
567         }
568         Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
569             (short) LogSeverity._Info,
570             "Location Name set to " + locationName);
571     }
572
573     /**
574      * Implementation of the ::itut_x780::ManagedObject_F::nameGet operation.
575      */

576     public org.omg.CosNaming.NameComponent JavaDoc[]
577     nameGet()
578     {
579         //
580
// DONE : implement
581
//
582
return Utils.string2name(_facade_name);
583     }
584
585     /**
586      * Implementation of the ::itut_x780::ManagedObject_F::objectClassGet operation.
587      */

588     public String JavaDoc
589     objectClassGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
590     throws intt.itu.itut_x780.ApplicationError
591     {
592        //
593
// DONE : implement
594
//
595
if ( ! elements.containsKey(Utils.name2string(name))) {
596             ApplicationErrorInfoTypeImpl error_code =
597                     new ApplicationErrorInfoTypeImpl();
598             error_code.error = new UIDType(
599                 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
600                 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
601             error_code.details = ExceptionMessages.not_exists_error;
602
603             throw new ApplicationError(error_code);
604         }
605         ManagedObjectValueType mo_value =
606             (ManagedObjectValueType) elements.get(Utils.name2string(name));
607         return mo_value.objectClass;
608     }
609
610     /**
611      * Implementation of the ::itut_x780::ManagedObject_F::attributesGet operation.
612      */

613     public intt.itu.itut_x780.ManagedObjectValueType
614     attributesGet(org.omg.CosNaming.NameComponent JavaDoc[] name, intt.itu.itut_x780.StringSetTypeHolder attributeNames)
615     throws intt.itu.itut_x780.ApplicationError
616     {
617         //
618
// DONE : implement
619
//
620
if ( ! elements.containsKey(Utils.name2string(name))) {
621             ApplicationErrorInfoTypeImpl error_code =
622                     new ApplicationErrorInfoTypeImpl();
623             error_code.error = new UIDType(
624                 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
625                 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
626             error_code.details = ExceptionMessages.not_exists_error;
627
628             throw new ApplicationError(error_code);
629         }
630         ManagedElementValueType mo_value =
631             (ManagedElementValueType) elements.get(Utils.name2string(name));
632         Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
633             (short) LogSeverity._Info,
634             "attributesGet finished successfully");
635         return mo_value;
636     }
637
638     /**
639      * Implementation of the ::itut_x780::ManagedObject_F::packagesGet operation.
640      */

641     public String JavaDoc[]
642     packagesGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
643     throws intt.itu.itut_x780.ApplicationError
644     {
645         //
646
// DONE : implement
647
//
648
if ( ! elements.containsKey(Utils.name2string(name))) {
649             ApplicationErrorInfoTypeImpl error_code =
650                     new ApplicationErrorInfoTypeImpl();
651             error_code.error = new UIDType(
652                 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
653                 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
654                 error_code.details = ExceptionMessages.not_exists_error;
655
656             throw new ApplicationError(error_code);
657         }
658         ManagedObjectValueType mo_value =
659             (ManagedObjectValueType) elements.get(Utils.name2string(name));
660         return mo_value.packages;
661     }
662
663     /**
664      * Implementation of the ::itut_x780::ManagedObject_F::creationSourceGet operation.
665      */

666     public intt.itu.itut_x780.SourceIndicatorType
667     creationSourceGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
668     throws intt.itu.itut_x780.ApplicationError
669     {
670         //
671
// DONE : implement
672
//
673
if ( ! elements.containsKey(Utils.name2string(name))) {
674             ApplicationErrorInfoTypeImpl error_code =
675                     new ApplicationErrorInfoTypeImpl();
676             error_code.error = new UIDType(
677                 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
678                 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
679                 error_code.details = ExceptionMessages.not_exists_error;
680
681             throw new ApplicationError(error_code);
682         }
683         ManagedObjectValueType mo_value =
684             (ManagedObjectValueType) elements.get(Utils.name2string(name));
685         return mo_value.creationSource;
686     }
687
688     /**
689      * Implementation of the ::itut_x780::ManagedObject_F::deletePolicyGet operation.
690      */

691     public short
692     deletePolicyGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
693     throws intt.itu.itut_x780.ApplicationError
694     {
695         //
696
// DONE : implement
697
//
698
if ( ! elements.containsKey(Utils.name2string(name))) {
699             ApplicationErrorInfoTypeImpl error_code =
700                     new ApplicationErrorInfoTypeImpl();
701             error_code.error = new UIDType(
702                 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
703                 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
704                 error_code.details = ExceptionMessages.not_exists_error;
705
706             throw new ApplicationError(error_code);
707         }
708         ManagedObjectValueType mo_value =
709             (ManagedObjectValueType) elements.get(Utils.name2string(name));
710         return mo_value.deletePolicy;
711
712     }
713
714     /**
715      * Implementation of the ::itut_x780::ManagedObject_F::destroy operation.
716      */

717     public void
718     destroy(org.omg.CosNaming.NameComponent JavaDoc[] name)
719     throws intt.itu.itut_x780.ApplicationError,
720
721            intt.itu.itut_x780.DeleteError
722     {
723         //
724
// DONE : implement
725
//
726
if ( ! elements.containsKey(Utils.name2string(name))) {
727             ApplicationErrorInfoTypeImpl error_code =
728                     new ApplicationErrorInfoTypeImpl();
729             error_code.error = new UIDType(
730                 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
731                 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
732                 error_code.details = ExceptionMessages.not_exists_error;
733
734             throw new ApplicationError(error_code);
735
736         }
737         ManagedElementValueType mo_value =null;
738         synchronized(elements) {
739                     mo_value = (ManagedElementValueType) elements.remove(Utils.name2string(name));
740         }
741         org.omg.TimeBase.UtcT eventTime = new org.omg.TimeBase.UtcT(System.currentTimeMillis(),
742                     0,(short) 0,(short) 0);
743         get_context().push_objectDeletion_alarm(new ObjectDeletionImpl(eventTime, name,
744                                         mo_value.objectClass,
745                                         getUniqueNotificationIdentifier(),
746                                         mo_value.creationSource,
747                                         new AttributeValueType[0]));
748     }
749
750 }
751
Popular Tags