1 28 29 package ist.coach.coachEmsMibComponents.IpAddressDataFactoryProviderComposition; 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.IpAddressDataMgmt; 45 46 import ist.coach.coachEmfServices.EmfBasicLog.*; 47 48 54 public class IpAddressDataFactoryProviderImpl 55 extends ist.coach.coachEmsMibComponents.IpAddressDataFactoryProviderComposition.IpAddressDataFactoryProvider_impl 56 { 57 intt.itu.itut_q816.ContainmentComponent c_admin = null; 63 intt.itu.itut_q816.Containment c_query = null; 64 private BasicLog logSupport; 65 66 private static final String FACTORY_CLASS = "IpAddressDataFactory"; 67 IpAddressDataMgmt facade = null; 68 69 75 public IpAddressDataFactoryProviderImpl() 76 { 77 } 78 79 80 95 public void 96 configuration_complete() 97 throws org.omg.Components.InvalidConfiguration 98 { 99 if ((facade = get_context().get_connection_facade()) == null) 103 throw new org.omg.Components.InvalidConfiguration(); 104 105 if ((c_admin = get_context().get_connection_containment_admin()) == null) 106 throw new org.omg.Components.InvalidConfiguration(); 107 108 if ((c_query = get_context().get_connection_containment_query()) == null) 109 throw new org.omg.Components.InvalidConfiguration(); 110 111 if ((logSupport = get_context().get_connection_basic_log()) == null) 112 throw new org.omg.Components.InvalidConfiguration(); 113 114 System.err.println("IpAddressDataFactoryProvider configuration completed..."); 115 } 116 122 125 public org.omg.CosNaming.NameComponent [] 126 create(String nameBindingID, 127 org.omg.CosNaming.NameComponent [] superior, 128 String reqID, 129 String [] packageNameList, 130 byte[] ipAdEntAddress, 131 byte[] mgmtIpAddress, 132 int snmpPort, 133 int supportedSnmpVersions) 134 throws intt.itu.itut_x780.ApplicationError, 135 intt.itu.itut_x780.CreateError 136 { 137 String nameBinding_str = "ist.coach.coachEmsMib.NameBindings." + 141 nameBindingID; 142 143 145 CreateBindingInfo info = CreateController.checkNameBinding(nameBinding_str); 146 147 String objectKind = info.objectKind; 148 short deletePolicy = info.deletePolicy; 149 150 if (! c_query.exists(superior)) { 152 ApplicationErrorInfoTypeImpl error_code = new ApplicationErrorInfoTypeImpl(); 153 error_code.error = new UIDType( 154 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 155 intt.itu.itut_x780.ApplicationErrorConst.objectNotFound.value); 156 157 error_code.details = Utils.name2string(superior) + 158 ExceptionMessages.parent_object_error; 159 160 throw new ApplicationError(error_code); 161 } 162 163 String allocatedId = reqID; 165 if (reqID == null || reqID.length() == 0) { 166 167 org.omg.CosNaming.NameComponent [][] siblings = 168 c_query.getContained(superior); 169 170 allocatedId = "IPAddress" + CreateController.autoCreateId(siblings); 171 } 172 173 org.omg.CosNaming.NameComponent [] name = CreateController.createFullName( 175 superior, 176 allocatedId, 177 Utils.name2facade(facade.facade_name()), 178 objectKind); 179 Utils.pretty_log(logSupport, FACTORY_CLASS, "Factory", (short) LogSeverity._Info, 180 "proceed to create " + Utils.name2string(name)); 181 186 facade.create( 187 name, 188 objectKind, 189 packageNameList, 190 deletePolicy, 191 intt.itu.itut_x780.SourceIndicatorType.resourceOperation, 192 superior, 193 ipAdEntAddress, 194 mgmtIpAddress, 195 supportedSnmpVersions, 196 snmpPort); 197 198 c_admin.addName(name, superior); 200 201 Utils.pretty_log(logSupport, FACTORY_CLASS, "Factory", (short) LogSeverity._Info, 204 "successfully created " + Utils.name2string(name)); 205 return name; 206 } 207 208 211 public org.omg.CosNaming.NameComponent [] 212 create_base(String nameBinding, org.omg.CosNaming.NameComponent [] superior, String reqId) 213 throws intt.itu.itut_x780.CreateError, 214 215 intt.itu.itut_x780.ApplicationError 216 { 217 return null; 221 } 222 223 } 224 | Popular Tags |