1 28 29 package ist.coach.coachEmsMibComponents.IpToMACAddressFactoryProviderComposition; 30 31 import ist.coach.coachEmfCommon.Utils; 32 import ist.coach.coachEmfCommon.CreateController; 33 import ist.coach.coachEmfCommon.CreateBindingInfo; 34 import ist.coach.coachEmfCommon.ExceptionMessages; 35 36 import intt.itu.itut_x780.UIDType; 37 import intt.itu.itut_x780.CreateError; 38 import intt.itu.itut_x780.ApplicationError; 39 40 import intt.itu.itut_m3120.conditionalPackages.*; 41 42 import ist.coach.coachEmfCommon.CreateErrorInfoTypeImpl; 43 import ist.coach.coachEmfCommon.ApplicationErrorInfoTypeImpl; 44 import ist.coach.coachEmsMibComponents.IpToMACAddressMgmt; 45 46 import ist.coach.coachEmfServices.EmfBasicLog.*; 47 53 public class IpToMACAddressFactoryProviderImpl 54 extends ist.coach.coachEmsMibComponents.IpToMACAddressFactoryProviderComposition.IpToMACAddressFactoryProvider_impl 55 { 56 intt.itu.itut_q816.ContainmentComponent c_admin = null; 62 intt.itu.itut_q816.Containment c_query = null; 63 64 private BasicLog logSupport; 65 private static final String FACTORY_CLASS = "IpToMACAddressFactory"; 66 IpToMACAddressMgmt facade = null; 67 73 public IpToMACAddressFactoryProviderImpl() 74 { 75 } 76 91 public void 92 configuration_complete() 93 throws org.omg.Components.InvalidConfiguration 94 { 95 if ((facade = get_context().get_connection_facade()) == null) 99 throw new org.omg.Components.InvalidConfiguration(); 100 101 if ((c_admin = get_context().get_connection_containment_admin()) == null) 102 throw new org.omg.Components.InvalidConfiguration(); 103 104 if ((c_query = get_context().get_connection_containment_query()) == null) 105 throw new org.omg.Components.InvalidConfiguration(); 106 107 if ((logSupport = get_context().get_connection_basic_log()) == null) 108 throw new org.omg.Components.InvalidConfiguration(); 109 110 System.err.println("IpToMACAddressProvider configuration completed..."); 111 } 112 118 121 public org.omg.CosNaming.NameComponent [] 122 create(String nameBindingID, 123 org.omg.CosNaming.NameComponent [] superior, 124 String reqID, 125 String [] packageNameList, 126 int ipNetToMediaIfIndex, 127 byte[] ipNetToMediaNetAddress, 128 byte[] mgmtIpAddress, 129 int snmpPort, 130 int supportedSnmpVersions) 131 throws intt.itu.itut_x780.ApplicationError, 132 133 intt.itu.itut_x780.CreateError 134 { 135 String nameBinding_str = "ist.coach.coachEmsMib.NameBindings." + 139 nameBindingID; 140 141 CreateBindingInfo info = CreateController.checkNameBinding(nameBinding_str); 142 143 String objectKind = info.objectKind; 144 short deletePolicy = info.deletePolicy; 145 146 if (! c_query.exists(superior)) { 148 ApplicationErrorInfoTypeImpl error_code = new ApplicationErrorInfoTypeImpl(); 149 error_code.error = new UIDType( 150 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 151 intt.itu.itut_x780.ApplicationErrorConst.objectNotFound.value); 152 153 error_code.details = Utils.name2string(superior) + 154 ExceptionMessages.parent_object_error; 155 156 throw new ApplicationError(error_code); 157 } 158 159 String allocatedId = reqID; 161 if (reqID == null || reqID.length() == 0) { 162 163 org.omg.CosNaming.NameComponent [][] siblings = 164 c_query.getContained(superior); 165 166 allocatedId = "IpToMACAddress" + CreateController.autoCreateId(siblings); 167 } 168 169 org.omg.CosNaming.NameComponent [] name = CreateController.createFullName( 171 superior, 172 allocatedId, 173 Utils.name2facade(facade.facade_name()), 174 objectKind); 175 181 Utils.pretty_log(logSupport, FACTORY_CLASS, "Factory", (short) LogSeverity._Info, 182 "proceed to create " + Utils.name2string(name)); 183 184 facade.create( 185 name, 186 objectKind, 187 packageNameList, 188 deletePolicy, 189 intt.itu.itut_x780.SourceIndicatorType.resourceOperation, 190 superior, 191 ipNetToMediaIfIndex, 192 ipNetToMediaNetAddress, 193 mgmtIpAddress, 194 supportedSnmpVersions, 195 snmpPort); 196 197 c_admin.addName(name, superior); 199 200 Utils.pretty_log(logSupport, FACTORY_CLASS, "Factory", (short) LogSeverity._Info, 203 "successfully created " + Utils.name2string(name)); 204 return name; 205 } 206 207 210 public org.omg.CosNaming.NameComponent [] 211 create_base(String nameBinding, org.omg.CosNaming.NameComponent [] superior, String reqId) 212 throws intt.itu.itut_x780.CreateError, 213 214 intt.itu.itut_x780.ApplicationError 215 { 216 return null; 220 } 221 222 } 223 | Popular Tags |