1 21 package ist.coach.coachEmsMibComponents; 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 37 import org.omg.CosNaming.NameComponent ; 38 42 public class LogicalInterfaceFactoryProviderMonolithicImpl 43 extends org.omg.CORBA.LocalObject 44 implements CCM_LogicalInterfaceFactoryProvider, 45 org.omg.Components.SessionComponent 46 { 47 55 private CCM_LogicalInterfaceFactoryProvider_Context the_context_; 56 57 intt.itu.itut_q816.ContainmentComponent c_admin = null; 58 intt.itu.itut_q816.Containment c_query = null; 59 60 private static final String FACTORY_CLASS = "LogicalInterfaceFactory"; 61 LogicalInterfaceMgmt facade = null; 62 63 ist.coach.coachEmfServices.SnmpAdapter.SnmpConnector connector = null; 64 65 66 67 68 76 public 77 LogicalInterfaceFactoryProviderMonolithicImpl() 78 { 79 the_context_ = null; 80 } 81 97 public CCM_LogicalInterfaceFactoryProvider_Context 98 getContext() 99 { 100 return the_context_; 101 } 102 116 public void 117 configuration_complete() 118 throws org.omg.Components.InvalidConfiguration 119 { 120 124 if ((facade = the_context_.get_connection_facade()) == null) 125 throw new org.omg.Components.InvalidConfiguration(); 126 127 if ((c_admin = the_context_.get_connection_containment_admin()) == null) 128 throw new org.omg.Components.InvalidConfiguration(); 129 130 if ((c_query = the_context_.get_connection_containment_query()) == null) 131 throw new org.omg.Components.InvalidConfiguration(); 132 133 if ((connector = the_context_.get_connection_connector()) == null) 134 throw new org.omg.Components.InvalidConfiguration(); 135 136 System.err.println("LogicalIntefaceFactoryProvider configuration completed..."); 137 138 } 139 155 public void 156 set_session_context(org.omg.Components.SessionContext context) 157 throws org.omg.Components.CCMException 158 { 159 the_context_ = (CCM_LogicalInterfaceFactoryProvider_Context)context; 160 } 161 171 public void 172 ccm_activate() 173 throws org.omg.Components.CCMException 174 { 175 } 179 189 public void 190 ccm_passivate() 191 throws org.omg.Components.CCMException 192 { 193 } 197 207 public void 208 ccm_remove() 209 throws org.omg.Components.CCMException 210 { 211 } 215 226 public org.omg.CosNaming.NameComponent [] 227 create(java.lang.String nameBindingID, 228 org.omg.CosNaming.NameComponent [] superior, 229 String reqID, 230 java.lang.String [] packageNameList, 231 int ifIndex, 232 byte [] mgmtIpAddress, 233 int snmpPort, 234 int supportedSnmpVersions, 235 java.lang.String ifDescr) 236 throws intt.itu.itut_x780.ApplicationError, intt.itu.itut_x780.CreateError 237 { 238 242 String nameBinding_str = "ist.coach.coachEmsMib.NameBindings." + 243 nameBindingID; 244 245 CreateBindingInfo info = CreateController.checkNameBinding(nameBinding_str); 246 247 String objectKind = info.objectKind; 248 short deletePolicy = info.deletePolicy; 249 250 if (! c_query.exists(superior)) { 252 ApplicationErrorInfoTypeImpl error_code = new ApplicationErrorInfoTypeImpl(); 253 254 error_code.error = new UIDType( 255 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 256 intt.itu.itut_x780.ApplicationErrorConst.objectNotFound.value); 257 258 259 error_code.details = Utils.name2string(superior) + 260 ExceptionMessages.parent_object_error; 261 262 throw new ApplicationError(error_code); 263 } 264 265 267 String allocatedId = null; 268 if (reqID == null || reqID.length() == 0) { 269 org.omg.CosNaming.NameComponent [][] siblings = 270 c_query.getContained(superior); 271 272 allocatedId = CreateController.autoCreateId(siblings); 273 } 274 else 275 allocatedId = reqID; 276 277 279 org.omg.CosNaming.NameComponent [] name = CreateController.createFullName( 280 superior, 281 allocatedId, 282 Utils.name2facade(facade.facade_name()), 283 objectKind); 284 285 String [] supportedConditionalPackages = packageNameList; 287 288 if (packageNameList.length == 0) 289 System.err.println("No packages are specified. "); 290 291 System.err.println("LogicalInterfaceFactory> Before invoking the facade " + 292 Utils.name2facade(facade.facade_name()) + " to create " + 293 Utils.name2string(name)); 294 295 facade.create( 296 name, 297 objectKind, 298 packageNameList, 299 deletePolicy, 300 intt.itu.itut_x780.SourceIndicatorType.resourceOperation, 301 superior, 302 ifIndex, 303 mgmtIpAddress, 304 snmpPort, 305 supportedSnmpVersions, 306 ifDescr); 307 308 System.err.println("Before registering to the containment service"); 309 c_admin.addName(name, superior); 310 311 System.err.println("LogicalInterfaceFactory>create returns for " + 312 Utils.name2string(name)); 313 314 return name; 315 } 316 317 323 public org.omg.CosNaming.NameComponent [] 324 create_base(java.lang.String nameBinding, 325 org.omg.CosNaming.NameComponent [] superior, 326 java.lang.String reqId) 327 throws intt.itu.itut_x780.CreateError, intt.itu.itut_x780.ApplicationError 328 { 329 return new NameComponent [0]; 333 } 334 } 335 | Popular Tags |