KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > ist > coach > coachEmsMibComponents > IpAddressDataProviderComposition > 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.coachEmsMibComponents.IpAddressDataProviderComposition;
30
31 import intt.itu.itut_x780.UIDType;
32 import intt.itu.itut_x780.ApplicationError;
33
34 import ist.coach.coachEmfCommon.Utils;
35 import ist.coach.coachEmfCommon.ObjectCreationImpl;
36
37 import intt.itu.itut_x780.AttributeValueType;
38 import ist.coach.coachEmfCommon.ExceptionMessages;
39 import ist.coach.coachEmfCommon.CreateErrorInfoTypeImpl;
40
41 import org.omg.CosNaming.NameComponent JavaDoc;
42
43
44
45 import java.util.Hashtable JavaDoc;
46 /**
47  * This is the CIDL-based implementation of the
48  * OMG IDL3 CIDL:coach.ist/coachEmsMibComponents/IpAddressDataProviderComposition/IpAddressDataProviderHome_impl/IpAddressDataProvider_impl/mgmtSeg:1.0 segment type.
49  *
50  * @author OpenCCM CIF_Jimpl Compiler.
51  */

52 public class mgmtSegImpl
53      extends ist.coach.coachEmsMibComponents.IpAddressDataProviderComposition.mgmtSeg
54 {
55     // ==================================================================
56
//
57
// Internal states.
58
//
59
// ==================================================================
60

61     // ==================================================================
62
//
63
// Constructors.
64
//
65
// ==================================================================
66

67     public mgmtSegImpl()
68     {
69     }
70
71     // ==================================================================
72
//
73
// Methods.
74
//
75
// ==================================================================
76

77     /**
78      * Implementation of the ::coachEmsMibComponents::IpAddressDataMgmt::create operation.
79      */

80     public void
81     create(org.omg.CosNaming.NameComponent JavaDoc[] name,
82             String JavaDoc objectClass,
83             String JavaDoc[] packages,
84             short deletePolicy,
85             intt.itu.itut_x780.SourceIndicatorType sourceIndicator,
86             org.omg.CosNaming.NameComponent JavaDoc[] superior,
87             byte[] ipAdEntAddress,
88             byte[] mgmtIpAddress,
89             int supportedSnmpVersions,
90             int snmpPort)
91     throws intt.itu.itut_x780.ApplicationError,
92
93            intt.itu.itut_x780.CreateError
94     {
95         //
96
// TODO : Implement
97
//
98
if (IpAddressDataProviderImpl.elements.containsKey(Utils.name2string(name))) {
99
100             CreateErrorInfoTypeImpl errorCode =
101                 new CreateErrorInfoTypeImpl();
102
103             errorCode.error = new UIDType(
104                 intt.itu.itut_x780.CreateErrorConst.moduleName.value,
105                 intt.itu.itut_x780.CreateErrorConst.duplicateName.value);
106
107             errorCode.details = new String JavaDoc(Utils.name2string(name) +
108              " object already exists.");
109             throw new intt.itu.itut_x780.CreateError(errorCode);
110         }
111
112         IpAddressDataStructure ipAddressData =
113             new IpAddressDataStructure(
114                 name,
115                 objectClass,
116                 packages,
117                 sourceIndicator,
118                 deletePolicy,
119                 new String JavaDoc(ipAdEntAddress),
120                 new String JavaDoc(mgmtIpAddress),
121                 snmpPort,
122                 supportedSnmpVersions);
123
124         synchronized(IpAddressDataProviderImpl.elements) {
125           IpAddressDataProviderImpl.elements.put(Utils.name2string(name), ipAddressData);
126         }
127         org.omg.TimeBase.UtcT eventTime = new org.omg.TimeBase.UtcT (System.currentTimeMillis(),
128                     0, (short) 0, (short) 0);
129         get_context().push_objectCreation(new ObjectCreationImpl(eventTime,
130                                                 name,
131                                                 objectClass,
132                                                 IpAddressDataProviderImpl.getUniqueNotificationIdentifier(),
133                                                 sourceIndicator,
134                                                 new AttributeValueType[0]));
135
136     }
137
138     /**
139      * Implementation of the ::coachEmsMibComponents::IpAddressDataMgmt::facade_name operation.
140      */

141     public String JavaDoc
142     facade_name()
143     {
144         //
145
// DONE : Implement
146
//
147
return get_main_segment().facade_name();
148     }
149
150 }
151
Popular Tags