KickJava   Java API By Example, From Geeks To Geeks.

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


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 ist.coach.coachEmfCommon.ManagedElementValueTypeImpl;
32 import ist.coach.coachEmfCommon.ApplicationErrorInfoTypeImpl;
33 import ist.coach.coachEmfCommon.ObjectCreationImpl;
34 import ist.coach.coachEmfCommon.CreateErrorInfoTypeImpl;
35 import intt.itu.itut_x780.CreateError;
36 import intt.itu.itut_x780.AttributeValueType;
37 import intt.itu.itut_x780.UIDType;
38
39 import ist.coach.coachEmfCommon.Utils;
40 import ist.coach.coachEmfCommon.ExceptionMessages;
41 /**
42  * This is the CIDL-based implementation of the
43  * OMG IDL3 CIDL:coach.ist/itut_m3120Components/ManagedElementProviderComposition/ManagedElementProviderHome_impl/ManagedElementProvider_impl/mgmtSeg:1.0 segment type.
44  *
45  * @author OpenCCM CIF_Jimpl Compiler.
46  */

47 public class mgmtSegImpl
48      extends ist.coach.itut_m3120Components.ManagedElementProviderComposition.mgmtSeg
49 {
50     // ==================================================================
51
//
52
// Internal states.
53
//
54
// ==================================================================
55

56     // ==================================================================
57
//
58
// Constructors.
59
//
60
// ==================================================================
61

62     public mgmtSegImpl()
63     {
64     }
65
66     // ==================================================================
67
//
68
// Methods.
69
//
70
// ==================================================================
71

72     /**
73      * Implementation of the ::itut_m3120Components::ManagedElementMgmt::create operation.
74      */

75     public void
76     create(org.omg.CosNaming.NameComponent JavaDoc[] name, String JavaDoc objectClass,
77             String JavaDoc[] packages, short deletePolicy,
78             intt.itu.itut_x780.SourceIndicatorType sourceIndicator,
79             intt.itu.itut_x780.AdministrativeStateType administrativeState,
80             String JavaDoc userLabel, String JavaDoc vendorName, String JavaDoc version, String JavaDoc locationName)
81     throws intt.itu.itut_x780.CreateError,
82
83            intt.itu.itut_x780.ApplicationError
84     {
85                 //
86
// DONE : implement
87
//
88
if (ManagedElementProviderImpl.elements.containsKey(Utils.name2string(name))) {
89             System.err.println(Utils.name2string(name) + " already exists!");
90             CreateErrorInfoTypeImpl error_code = new CreateErrorInfoTypeImpl();
91             error_code.error = new UIDType(
92                 intt.itu.itut_x780.CreateErrorConst.moduleName.value,
93                 intt.itu.itut_x780.CreateErrorConst.duplicateName.value);
94
95             error_code.details = ExceptionMessages.already_exists_error;
96             throw new CreateError(error_code);
97         }
98         ManagedElementValueTypeImpl value_type =
99                 new ManagedElementValueTypeImpl(name, objectClass, packages,
100                         sourceIndicator, deletePolicy, administrativeState,
101                         userLabel, vendorName, version, locationName);
102
103         synchronized(ManagedElementProviderImpl.elements) {
104           ManagedElementProviderImpl.elements.put(Utils.name2string(name), value_type);
105         }
106
107         org.omg.TimeBase.UtcT eventTime = new org.omg.TimeBase.UtcT(System.currentTimeMillis(),
108                     0,(short) 0,(short) 0);
109
110         //System.err.println("ManagedElementProvider attempts to push object creation alarm...");
111
get_context().push_objectCreation_alarm(new ObjectCreationImpl(eventTime, name,
112                                         objectClass,
113                                         ManagedElementProviderImpl.getUniqueNotificationIdentifier(),
114                                         sourceIndicator,
115                                         new AttributeValueType[0]));
116
117     }
118
119     /**
120      * Implementation of the ::itut_m3120Components::ManagedElementMgmt::facade_name operation.
121      */

122     public String JavaDoc
123     facade_name()
124     {
125         //
126
// TODO : Implement
127
//
128
return get_main_segment().facade_name();
129     }
130
131 }
132
Popular Tags