KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > ist > coach > coachEmsMibComponents > IpToMACAddressProviderComposition > 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.IpToMACAddressProviderComposition;
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 import java.util.Hashtable JavaDoc;
44 /**
45  * This is the CIDL-based implementation of the
46  * OMG IDL3 CIDL:coach.ist/coachEmsMibComponents/IpToMACAddressProviderComposition/IpToMACAddressProviderHome_impl/IpToMACAddressProvider_impl/mgmtSeg:1.0 segment type.
47  *
48  * @author OpenCCM CIF_Jimpl Compiler.
49  */

50 public class mgmtSegImpl
51      extends ist.coach.coachEmsMibComponents.IpToMACAddressProviderComposition.mgmtSeg
52 {
53     // ==================================================================
54
//
55
// Internal states.
56
//
57
// ==================================================================
58

59     // ==================================================================
60
//
61
// Constructors.
62
//
63
// ==================================================================
64

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

75     /**
76      * Implementation of the ::coachEmsMibComponents::IpToMACAddressMgmt::create operation.
77      */

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

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