KickJava   Java API By Example, From Geeks To Geeks.

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

47 public class mgmtSegImpl
48      extends ist.coach.coachEmsMibComponents.IpProtocolMonitorProviderComposition.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 ::coachEmsMibComponents::IpProtocolMonitorMgmt::create operation.
74      */

75     public void
76     create(org.omg.CosNaming.NameComponent JavaDoc[] name,
77           String JavaDoc objectClass,
78           String JavaDoc[] packages,
79           short deletePolicy,
80           intt.itu.itut_x780.SourceIndicatorType sourceIndicator,
81           org.omg.CosNaming.NameComponent JavaDoc[] superior,
82           byte[] mgmtIpAddress,
83           int supportedSnmpVersions,
84           int snmpPort)
85     throws intt.itu.itut_x780.ApplicationError,
86
87            intt.itu.itut_x780.CreateError
88     {
89        //
90
// DONE : implement
91
//
92

93         if (IpProtocolMonitorProviderImpl.elements.containsKey(Utils.name2string(name))) {
94
95             CreateErrorInfoTypeImpl errorCode =
96                 new CreateErrorInfoTypeImpl();
97
98             errorCode.error = new UIDType(
99                 intt.itu.itut_x780.CreateErrorConst.moduleName.value,
100                 intt.itu.itut_x780.CreateErrorConst.duplicateName.value);
101
102             errorCode.details = new String JavaDoc(Utils.name2string(name) +
103              " object already exists.");
104             throw new intt.itu.itut_x780.CreateError(errorCode);
105         }
106
107         IpProtocolMonitorDataStructure ipProtocolData =
108             new IpProtocolMonitorDataStructure(
109              name,
110                 objectClass,
111                 packages,
112                 sourceIndicator,
113                 deletePolicy,
114                 new String JavaDoc(mgmtIpAddress),
115                 snmpPort,
116                 supportedSnmpVersions);
117
118         synchronized(IpProtocolMonitorProviderImpl.elements) {
119           IpProtocolMonitorProviderImpl.elements.put(Utils.name2string(name), ipProtocolData);
120         }
121         org.omg.TimeBase.UtcT eventTime = new org.omg.TimeBase.UtcT (System.currentTimeMillis(),
122                     0, (short) 0, (short) 0);
123         get_context().push_objectCreation(new ObjectCreationImpl(eventTime,
124                                                 name,
125                                                 objectClass,
126                                                 IpProtocolMonitorProviderImpl.getUniqueNotificationIdentifier(),
127                                                 //ipProtocolData.getUniqueNotificationIdentifier(),
128
sourceIndicator,
129                                                 new AttributeValueType[0]));
130
131     }
132
133     /**
134      * Implementation of the ::coachEmsMibComponents::IpProtocolMonitorMgmt::facade_name operation.
135      */

136     public String JavaDoc
137     facade_name()
138     {
139         //
140
// DONE : Implement
141
//
142
return get_main_segment().facade_name();
143     }
144
145 }
146
Popular Tags