1 21 package ist.coach.coachEmsMibComponents.LogicalInterfaceFactoryProviderComposition; 22 23 import ist.coach.coachEmfCommon.Utils; 24 import ist.coach.coachEmfCommon.CreateController; 25 import ist.coach.coachEmfCommon.CreateBindingInfo; 26 import ist.coach.coachEmfCommon.ExceptionMessages; 27 28 import intt.itu.itut_x780.UIDType; 29 import intt.itu.itut_x780.CreateError; 30 import intt.itu.itut_x780.ApplicationError; 31 32 import intt.itu.itut_m3120.conditionalPackages.*; 33 34 import ist.coach.coachEmfCommon.CreateErrorInfoTypeImpl; 35 import ist.coach.coachEmfCommon.ApplicationErrorInfoTypeImpl; 36 import ist.coach.coachEmsMibComponents.LogicalInterfaceMgmt; 37 38 import org.omg.CosNaming.NameComponent ; 39 40 import ist.coach.coachEmfServices.EmfBasicLog.*; 41 47 public class LogicalInterfaceFactoryProviderImpl 48 extends ist.coach.coachEmsMibComponents.LogicalInterfaceFactoryProviderComposition.LogicalInterfaceFactoryProvider_impl 49 { 50 58 59 60 intt.itu.itut_q816.ContainmentComponent c_admin = null; 61 intt.itu.itut_q816.Containment c_query = null; 62 private BasicLog logSupport; 63 64 private static final String FACTORY_CLASS = "LogicalInterfaceFactory"; 65 LogicalInterfaceMgmt facade = null; 66 67 ist.coach.coachEmfServices.SnmpAdapter.SnmpConnector connector = null; 68 69 70 71 72 80 public 81 LogicalInterfaceFactoryProviderImpl() 82 { } 83 93 107 public void 108 configuration_complete() 109 throws org.omg.Components.InvalidConfiguration 110 { 111 115 if ((facade = get_context().get_connection_facade()) == null) 116 throw new org.omg.Components.InvalidConfiguration(); 117 118 if ((c_admin = get_context().get_connection_containment_admin()) == null) 119 throw new org.omg.Components.InvalidConfiguration(); 120 121 if ((c_query = get_context().get_connection_containment_query()) == null) 122 throw new org.omg.Components.InvalidConfiguration(); 123 124 if ((connector = get_context().get_connection_connector()) == null) 125 throw new org.omg.Components.InvalidConfiguration(); 126 127 if ((logSupport = get_context().get_connection_basic_log()) == null) 128 throw new org.omg.Components.InvalidConfiguration(); 129 130 System.err.println("LogicalIntefaceFactoryProvider configuration completed..."); 131 132 } 133 134 145 public org.omg.CosNaming.NameComponent [] 146 create(java.lang.String nameBindingID, 147 org.omg.CosNaming.NameComponent [] superior, 148 String reqID, 149 java.lang.String [] packageNameList, 150 int ifIndex, 151 byte [] mgmtIpAddress, 152 int snmpPort, 153 int supportedSnmpVersions, 154 java.lang.String ifDescr) 155 throws intt.itu.itut_x780.ApplicationError, intt.itu.itut_x780.CreateError 156 { 157 161 String nameBinding_str = "ist.coach.coachEmsMib.NameBindings." + 162 nameBindingID; 163 164 CreateBindingInfo info = CreateController.checkNameBinding(nameBinding_str); 165 166 String objectKind = info.objectKind; 167 short deletePolicy = info.deletePolicy; 168 169 if (! c_query.exists(superior)) { 171 ApplicationErrorInfoTypeImpl error_code = new ApplicationErrorInfoTypeImpl(); 172 173 error_code.error = new UIDType( 174 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 175 intt.itu.itut_x780.ApplicationErrorConst.objectNotFound.value); 176 177 178 error_code.details = Utils.name2string(superior) + 179 ExceptionMessages.parent_object_error; 180 181 throw new ApplicationError(error_code); 182 } 183 184 186 String allocatedId = null; 187 if (reqID == null || reqID.length() == 0) { 188 org.omg.CosNaming.NameComponent [][] siblings = 189 c_query.getContained(superior); 190 191 allocatedId = CreateController.autoCreateId(siblings); 192 } 193 else 194 allocatedId = reqID; 195 196 198 org.omg.CosNaming.NameComponent [] name = CreateController.createFullName( 199 superior, 200 allocatedId, 201 Utils.name2facade(facade.facade_name()), 202 objectKind); 203 204 String [] supportedConditionalPackages = packageNameList; 206 207 214 Utils.pretty_log(logSupport, FACTORY_CLASS, "Factory", (short) LogSeverity._Info, 215 "proceed to create " + Utils.name2string(name)); 216 217 facade.create( 218 name, 219 objectKind, 220 packageNameList, 221 deletePolicy, 222 intt.itu.itut_x780.SourceIndicatorType.resourceOperation, 223 superior, 224 ifIndex, 225 mgmtIpAddress, 226 supportedSnmpVersions, 227 snmpPort, 228 ifDescr); 229 230 c_admin.addName(name, superior); 232 233 Utils.pretty_log(logSupport, FACTORY_CLASS, "Factory", (short) LogSeverity._Info, 236 "successfully created " + Utils.name2string(name)); 237 return name; 238 } 239 240 246 public org.omg.CosNaming.NameComponent [] 247 create_base(java.lang.String nameBinding, 248 org.omg.CosNaming.NameComponent [] superior, 249 java.lang.String reqId) 250 throws intt.itu.itut_x780.CreateError, intt.itu.itut_x780.ApplicationError 251 { 252 return new NameComponent [0]; 256 } 257 } 258 | Popular Tags |