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 39 42 public class IpProtocolMonitorFactoryProviderMonolithicImpl 43 extends org.omg.CORBA.LocalObject 44 implements CCM_IpProtocolMonitorFactoryProvider, 45 org.omg.Components.SessionComponent 46 { 47 55 private CCM_IpProtocolMonitorFactoryProvider_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 IpProtocolMonitorMgmt facade = null; 62 63 ist.coach.coachEmfServices.SnmpAdapter.SnmpConnector connector = null; 64 65 66 74 public 75 IpProtocolMonitorFactoryProviderMonolithicImpl() 76 { 77 the_context_ = null; 78 } 79 95 public CCM_IpProtocolMonitorFactoryProvider_Context 96 getContext() 97 { 98 return the_context_; 99 } 100 114 public void 115 configuration_complete() 116 throws org.omg.Components.InvalidConfiguration 117 { 118 122 if ((facade = the_context_.get_connection_facade()) == null) 123 throw new org.omg.Components.InvalidConfiguration(); 124 125 if ((c_admin = the_context_.get_connection_containment_admin()) == null) 126 throw new org.omg.Components.InvalidConfiguration(); 127 128 if ((c_query = the_context_.get_connection_containment_query()) == null) 129 throw new org.omg.Components.InvalidConfiguration(); 130 131 if ((connector = the_context_.get_connection_connector()) == null) 132 throw new org.omg.Components.InvalidConfiguration(); 133 134 System.err.println("IpProtocolMonitorFactoryProviderconfiguration completed..."); 135 136 137 } 138 154 public void 155 set_session_context(org.omg.Components.SessionContext context) 156 throws org.omg.Components.CCMException 157 { 158 the_context_ = (CCM_IpProtocolMonitorFactoryProvider_Context)context; 159 } 160 170 public void 171 ccm_activate() 172 throws org.omg.Components.CCMException 173 { 174 } 178 188 public void 189 ccm_passivate() 190 throws org.omg.Components.CCMException 191 { 192 } 196 206 public void 207 ccm_remove() 208 throws org.omg.Components.CCMException 209 { 210 } 214 225 public org.omg.CosNaming.NameComponent [] 226 create(java.lang.String nameBindingID, 227 org.omg.CosNaming.NameComponent [] superior, 228 String reqID, 229 String [] packageNameList, 230 byte[] mgmtIpAddress, 231 int snmpPort, 232 int supportedSnmpVersions 233 ) 234 throws intt.itu.itut_x780.ApplicationError, intt.itu.itut_x780.CreateError 235 { 236 240 String nameBinding_str = "ist.coach.coachEmsMib.NameBindings." + 241 nameBindingID; 242 243 CreateBindingInfo info = CreateController.checkNameBinding(nameBinding_str); 244 245 String objectKind = info.objectKind; 246 short deletePolicy = info.deletePolicy; 247 248 if (! c_query.exists(superior)) { 250 ApplicationErrorInfoTypeImpl error_code = 251 new ApplicationErrorInfoTypeImpl(); 252 error_code.error = new UIDType( 253 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 254 intt.itu.itut_x780.ApplicationErrorConst.objectNotFound.value); 255 256 257 error_code.details = Utils.name2string(superior) + 258 ExceptionMessages.parent_object_error; 259 260 throw new ApplicationError(error_code); 261 } 262 263 265 String allocatedId = null; 266 if (reqID == null || reqID.length() == 0) { 267 268 org.omg.CosNaming.NameComponent [][] siblings = 269 c_query.getContained(superior); 270 allocatedId = CreateController.autoCreateId(siblings); 271 } 272 else 273 allocatedId = reqID; 274 275 277 org.omg.CosNaming.NameComponent [] name = CreateController.createFullName( 278 superior, 279 allocatedId, 280 Utils.name2facade(facade.facade_name()), 281 objectKind); 282 283 String [] supportedConditionalPackages = packageNameList; 285 286 if (packageNameList.length == 0) 287 System.err.println("No packages are specified. "); 288 289 System.err.println("IpProtocolMonitorFactory> Before invoking the facade " + 290 Utils.name2facade(facade.facade_name()) + " to create " + 291 Utils.name2string(name)); 292 293 facade.create( 294 name, 295 objectKind, 296 packageNameList, 297 deletePolicy, 298 intt.itu.itut_x780.SourceIndicatorType.resourceOperation, 299 superior, 300 mgmtIpAddress, 301 snmpPort, 302 supportedSnmpVersions); 303 304 c_admin.addName(name, superior); 305 System.err.println("IpProtocolMonitorFactory>create returns for " + 306 Utils.name2string(name)); 307 308 return name; 309 310 } 311 317 public org.omg.CosNaming.NameComponent [] 318 create_base(java.lang.String nameBinding, 319 org.omg.CosNaming.NameComponent [] superior, 320 java.lang.String reqId) 321 throws intt.itu.itut_x780.CreateError, intt.itu.itut_x780.ApplicationError 322 { 323 return new NameComponent [0]; 327 } 328 } 329 | Popular Tags |