1 21 package ist.coach.coachEmsMibComponents.IpNodeFactoryProviderComposition; 22 23 import org.omg.CosNaming.NameComponent ; 24 25 import ist.coach.coachEmfCommon.Utils; 26 import ist.coach.coachEmfCommon.CreateController; 27 import ist.coach.coachEmfCommon.CreateBindingInfo; 28 import ist.coach.coachEmfCommon.DataTypeImpl; 29 import ist.coach.coachEmfCommon.ExceptionMessages; 30 import ist.coach.coachEmfCommon.CreateErrorInfoTypeImpl; 31 import ist.coach.coachEmfCommon.ApplicationErrorInfoTypeImpl; 32 import ist.coach.coachEmsCommon.SnmpUtils; 33 34 import ist.coach.coachEmfServices.SnmpAdapter.DataType; 35 import ist.coach.coachEmfServices.SnmpAdapter.SnmpApplicationError; 36 import ist.coach.coachEmsCommon.SnmpIdentifiers; 37 38 import ist.coach.coachEmsMib.conditionalPackages.sysInfoSetPackageType; 39 import ist.coach.coachEmsMib.conditionalPackages.snmpEnableAuthenTrapPackageType; 40 41 import ist.coach.coachEmsMib.IpNodeFactory; 42 import ist.coach.coachEmsMib.IpAddressDataFactory; 43 import ist.coach.coachEmsMib.LogicalInterfaceFactory; 44 import ist.coach.coachEmsMib.IpProtocolMonitorFactory; 45 import ist.coach.coachEmsMib.SnmpProtocolMonitorFactory; 46 49 import ist.coach.coachEmsMib.IpNodeFactoryHelper; 50 51 import intt.itu.itut_x780.UIDType; 52 import intt.itu.itut_x780.CreateError; 53 import intt.itu.itut_x780.ApplicationError; 54 import intt.itu.itut_x780.ManagedObjectFactoryHelper; 55 import intt.itu.itut_x780.ManagedObjectFactory; 56 57 import intt.itu.itut_m3120.conditionalPackages.*; 58 59 import org.opennms.protocols.snmp.SnmpSMI; 60 61 import ist.coach.coachEmsMibComponents.IpNodeMgmt; 62 import ist.coach.coachEmfServices.EmfBasicLog.*; 63 64 67 public class IpNodeFactoryProviderImpl 68 extends ist.coach.coachEmsMibComponents.IpNodeFactoryProviderComposition.IpNodeFactoryProvider_impl 69 { 70 78 79 80 intt.itu.itut_q816.ContainmentComponent c_admin = null; 81 intt.itu.itut_q816.Containment c_query = null; 82 84 private static final String FACTORY_CLASS = "IpNodeFactory"; 85 IpNodeMgmt facade = null; 86 87 ist.coach.coachEmfServices.SnmpAdapter.SnmpConnector connector = null; 88 89 private org.omg.CORBA.ORB orb = null; 90 91 private static final String SYS_CONTACT_OID = SnmpIdentifiers.SYS_CONTACT_OID; 92 private static final String SYS_NAME_OID = SnmpIdentifiers.SYS_NAME_OID; 93 private static final String SYS_LOCATION_OID = SnmpIdentifiers.SYS_LOCATION_OID; 94 private static final String [] IP_GROUP_OIDS = { 95 96 SnmpIdentifiers.IP_FWD_TYPE_OID, 97 SnmpIdentifiers.IP_DEFAULT_TTL_OID, 98 SnmpIdentifiers.IP_INRECEIVE_OID, 99 SnmpIdentifiers.IP_INHDRERRORS_OID, 100 SnmpIdentifiers.IP_INADDRERRORRS_OID, 101 SnmpIdentifiers.IP_FWDDATAGRAMS_OID, 102 SnmpIdentifiers.IP_INUNKNOWNPROTO_OID, 103 SnmpIdentifiers.IP_INDISCARDS_OID, 104 SnmpIdentifiers.IP_INDELIVERS_OID, 105 SnmpIdentifiers.IP_OUTREQUESTS_OID, 106 SnmpIdentifiers.IP_OUTDISCARDS_OID, 107 SnmpIdentifiers.IP_NOROUTE_OID, 108 SnmpIdentifiers.IP_REASMTIMEOUT_OID, 109 SnmpIdentifiers.IP_REASMREQ_OID, 110 SnmpIdentifiers.IP_REASMOK_OID, 111 SnmpIdentifiers.IP_REASMFAIL_OID, 112 SnmpIdentifiers.IP_FRAGOK_OID, 113 SnmpIdentifiers.IP_FRAGFAIL_OID, 114 SnmpIdentifiers.IP_FRAGCREATE_OID, 115 SnmpIdentifiers.IP_ROUTING_DISCARDS_OID 116 }; 117 private static final String [] SNMP_GROUP_OIDS = { 118 119 SnmpIdentifiers.SNMP_INPKTS_OID, 120 SnmpIdentifiers.SNMP_OUTPKTS_OID, 121 SnmpIdentifiers.SNMP_INBADVERSIONS_OID, 122 SnmpIdentifiers.SNMP_INBADCOMMUNITYNAME_OID, 123 SnmpIdentifiers.SNMP_INBADCOMMUNITYUSES_OID, 124 SnmpIdentifiers.SNMP_INASNPARSEERRORS_OID, 125 SnmpIdentifiers.SNMP_INTOOBIG_OID, 126 SnmpIdentifiers.SNMP_INNOSUCHNAMES_OID, 127 SnmpIdentifiers.SNMP_INBADVALUES_OID, 128 SnmpIdentifiers.SNMP_INREADONLYS_OID, 129 SnmpIdentifiers.SNMP_INGENERRS_OID, 130 SnmpIdentifiers.SNMP_INTOTALREQVARS_OID, 131 SnmpIdentifiers.SNMP_INTOTALSETVARS_OID, 132 SnmpIdentifiers.SNMP_INGETREQS_OID, 133 SnmpIdentifiers.SNMP_INGETNEXTS_OID, 134 SnmpIdentifiers.SNMP_INSETREQS_OID, 135 SnmpIdentifiers.SNMP_INGETRESPONSES_OID, 136 SnmpIdentifiers.SNMP_INTRAPS_OID, 137 SnmpIdentifiers.SNMP_OUTTOOBIG_OID, 138 SnmpIdentifiers.SNMP_OUTNOSUCHNAMES_OID, 139 SnmpIdentifiers.SNMP_OUTBADVALUES_OID, 140 SnmpIdentifiers.SNMP_OUTGENERRS_OID, 141 SnmpIdentifiers.SNMP_OUTGETREQS_OID, 142 SnmpIdentifiers.SNMP_OUTGETNEXTS_OID, 143 SnmpIdentifiers.SNMP_OUTSETREQS_OID, 144 SnmpIdentifiers.SNMP_OUTGETRESPONSES_OID, 145 SnmpIdentifiers.SNMP_OUTTRAPS_OID, 146 SnmpIdentifiers.SNMP_ENABLEAUTHTRAPS_OID 147 }; 148 149 private static final String READ_COMMUNITY = SnmpIdentifiers.READ_COMMUNITY; 150 private static final String NO_SUCH_OBJECT = "No Such Object"; 151 private static final String NO_SUCH_INSTANCE = "No Such Instance"; 152 153 private BasicLog logSupport; 154 155 163 public 164 IpNodeFactoryProviderImpl() 165 { 166 } 167 168 183 public void 184 configuration_complete() 185 throws org.omg.Components.InvalidConfiguration 186 { 187 if ((facade = get_context().get_connection_facade()) == null) 191 throw new org.omg.Components.InvalidConfiguration(); 192 193 if ((c_admin = get_context().get_connection_containment_admin()) == null) 194 throw new org.omg.Components.InvalidConfiguration(); 195 196 if ((c_query = get_context().get_connection_containment_query()) == null) 197 throw new org.omg.Components.InvalidConfiguration(); 198 199 intt.itu.itut_q816.FactoryFinderComponent factoryfinder_admin = 202 get_context().get_connection_factoryfinder_admin(); 203 204 if ((connector = get_context().get_connection_connector()) == null) 205 throw new org.omg.Components.InvalidConfiguration(); 206 207 if ((logSupport = get_context().get_connection_basic_log()) == null) 208 throw new org.omg.Components.InvalidConfiguration(); 209 210 org.omg.CORBA.Object myself_o; 211 IpNodeFactory myself = null; 212 213 try { 214 myself_o = ((org.omg.Components.SessionContext) get_context()).get_CCM_object(); 215 myself = IpNodeFactoryHelper.narrow(myself_o); 216 217 factoryfinder_admin.register(FACTORY_CLASS, myself); 218 } 219 catch(intt.itu.itut_x780.ApplicationError ex) { 220 throw new org.omg.Components.InvalidConfiguration(); 221 } 222 catch(Exception e) { 223 System.err.println("IpNodeFactory has problems retrieving CCM component"); 224 } 225 226 this.orb = org.objectweb.ccm.CORBA.TheORB.getORB(); 227 228 System.err.println("IpNodeFactoryProvider configuration completed..."); 229 230 } 231 232 243 public org.omg.CosNaming.NameComponent [] 244 create( java.lang.String nameBinding, 245 org.omg.CosNaming.NameComponent [] superior, 246 java.lang.String reqID, 247 java.lang.String [] packageNameList, 248 java.lang.String domainName, 249 java.lang.String hostname, 250 byte[] managementIPAddress, 251 int supportedSnmpVersions, 252 intt.itu.itut_x780.AdministrativeStateType administrativeState, 253 java.lang.String userLabel, 254 java.lang.String vendorName, 255 java.lang.String version, 256 java.lang.String locationName, 257 int snmpPort, 258 java.lang.String sysName, 259 java.lang.String sysContact) 260 throws intt.itu.itut_x780.ApplicationError, intt.itu.itut_x780.CreateError 261 { 262 266 String nameBinding_str = "ist.coach.coachEmsMib.NameBindings." + 267 nameBinding; 268 269 271 CreateBindingInfo info = CreateController.checkNameBinding(nameBinding_str); 272 273 String objectKind = info.objectKind; 274 short deletePolicy = info.deletePolicy; 275 276 if (! c_query.exists(superior)) { 278 ApplicationErrorInfoTypeImpl error_code = new ApplicationErrorInfoTypeImpl(); 279 error_code.error = new UIDType( 280 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 281 intt.itu.itut_x780.ApplicationErrorConst.objectNotFound.value); 282 283 error_code.details = Utils.name2string(superior) + 284 ExceptionMessages.parent_object_error; 285 286 throw new ApplicationError(error_code); 287 } 288 289 String allocatedId = reqID; 291 if (reqID == null || reqID.length() == 0) { 292 293 org.omg.CosNaming.NameComponent [][] siblings = 294 c_query.getContained(superior); 295 296 allocatedId = CreateController.autoCreateId(siblings); 297 } 298 299 org.omg.CosNaming.NameComponent [] name = CreateController.createFullName( 301 superior, 302 allocatedId, 303 Utils.name2facade(facade.facade_name()), 304 objectKind); 305 306 String [] supportedConditionalPackages = packageNameList; 308 309 Utils.pretty_log(logSupport, FACTORY_CLASS, "Factory", (short) LogSeverity._Info, 310 "proceed to create " + Utils.name2string(name)); 311 312 if (packageNameList.length == 0) { 313 314 317 if (vendorName.equalsIgnoreCase("Linux") || 318 vendorName.equalsIgnoreCase("RedHat Linux") || 319 vendorName.equalsIgnoreCase("RedHat")) { 320 321 330 supportedConditionalPackages = new String [5]; 331 332 supportedConditionalPackages[0] = sysInfoSetPackageType.value; 333 supportedConditionalPackages[1] = locationNamePackageType.value; 334 supportedConditionalPackages[2] = userLabelPackageType.value; 335 supportedConditionalPackages[3] = vendorNamePackageType.value; 336 supportedConditionalPackages[4] = versionPackageType.value; 337 } 338 } 339 else { 340 System.err.println("Factory will not determine supported conditional Packages," + 341 " because Manager already specified them."); 342 } 343 344 345 if (Utils.packageIsSupported(sysInfoSetPackageType.value, supportedConditionalPackages)) { 346 347 349 org.omg.CORBA.Any sysNameValue = orb.create_any(); 350 org.omg.CORBA.OctetSeqHelper.insert(sysNameValue, sysName.getBytes()); 351 352 DataTypeImpl sysNameDataType = new DataTypeImpl(SYS_NAME_OID, 353 sysNameValue, SnmpSMI.SMI_STRING); 354 355 356 361 org.omg.CORBA.Any sysContactValue = orb.create_any(); 363 org.omg.CORBA.OctetSeqHelper.insert(sysContactValue, sysContact.getBytes()); 365 DataTypeImpl sysContactDataType = new DataTypeImpl(SYS_CONTACT_OID, 366 sysContactValue, SnmpSMI.SMI_STRING); 367 372 DataTypeImpl [] sysData = {sysNameDataType, sysContactDataType}; 373 374 try { 375 connector.setBulk( 376 sysData, 377 new String (managementIPAddress), 378 snmpPort, 379 SnmpIdentifiers.WRITE_COMMUNITY); } 381 catch (SnmpApplicationError e) { 382 383 CreateErrorInfoTypeImpl error_code = new CreateErrorInfoTypeImpl(); 384 error_code.error = new UIDType( 385 intt.itu.itut_x780.CreateErrorConst.moduleName.value, 386 intt.itu.itut_x780.CreateErrorConst.unsupportedPackages.value); 387 388 error_code.details = e.reason; 389 390 throw new CreateError(error_code); 391 } 392 catch(Exception e) { 393 System.err.println("IpNodeFactory> Exception caught:" + e.getMessage()); 394 e.printStackTrace(System.err); 395 } 396 } 397 398 if (Utils.packageIsSupported(locationNamePackageType.value, supportedConditionalPackages)) { 399 400 org.omg.CORBA.Any sysLocationValue = orb.create_any(); 401 402 org.omg.CORBA.OctetSeqHelper.insert(sysLocationValue, locationName.getBytes()); 403 404 DataTypeImpl sysLocationDataType = new DataTypeImpl(SYS_LOCATION_OID, 407 sysLocationValue, SnmpSMI.SMI_STRING); 408 409 try { 410 connector.set( 411 sysLocationDataType, 412 new String (managementIPAddress), 413 snmpPort, 414 "private"); 415 } 416 catch (SnmpApplicationError e) { 417 418 CreateErrorInfoTypeImpl error_code = new CreateErrorInfoTypeImpl(); 419 error_code.error = new UIDType( 420 intt.itu.itut_x780.CreateErrorConst.moduleName.value, 421 intt.itu.itut_x780.CreateErrorConst.unsupportedPackages.value); 422 423 error_code.details = e.reason; 424 throw new CreateError(error_code); 425 } 426 catch (Exception e) { 427 System.err.println("System exception caught:" + e.getMessage()); 428 e.printStackTrace(System.err); 429 } 430 431 } 432 433 436 facade.create(name, objectKind, supportedConditionalPackages, deletePolicy, 437 intt.itu.itut_x780.SourceIndicatorType.managementOperation, 438 domainName, 439 hostname, 440 managementIPAddress, 441 supportedSnmpVersions, 442 administrativeState, 443 userLabel, 444 vendorName, 445 version, 446 locationName, 447 (short)snmpPort, 448 sysName, 449 sysContact); 450 451 c_admin.addName(name, superior); 453 455 System.err.println("IpNodeFactory> Proceeding to perform SNMP updates..."); 456 NameComponent [][] logical_interface_subordinates = new NameComponent [0][0]; 457 DataType[] ifTable = new DataType[0]; 458 try { 459 ifTable = this.connector.getSnmpTable( 460 SnmpIdentifiers.IF_TABLE_OID, 462 new String (managementIPAddress), 463 snmpPort, 464 SnmpIdentifiers.READ_COMMUNITY); } 466 catch(ist.coach.coachEmfServices.SnmpAdapter.SnmpApplicationError snmp_ex) { 467 System.err.println("SnmpApplicationError caught> " + 468 snmp_ex.reason); 469 return name; 470 } 471 catch(Exception e) { 472 System.err.println("IpNodeFactory: create>Exception caught: " + e.getMessage()); 473 e.printStackTrace(System.err); 474 } 475 476 int[] indexRows = { 1 }; 477 int [] ifTableIndexes = SnmpUtils.getIntColumnData(ifTable, 478 18, indexRows); 479 480 int[] ifDescrIndexRows = { 2 }; 481 String [] ifTableIfDescrs = SnmpUtils.getOctetColumnData(ifTable, 482 18, ifDescrIndexRows); 483 484 if (ifTableIndexes == null) { 485 System.err.println("Indexes could not be determined for" + 486 " Logical Interfaces. No Logical Interface objects will" + 487 " be created."); 488 } 489 else 490 if (ifTableIndexes.length == 0) 491 System.err.println("No LogicalInterface objects found"); 492 else 493 if (ifTableIfDescrs.length == 0) 494 System.err.println("Could not determine interface descriptions " + 495 "for Logical Interface Objects"); 496 else 497 if (ifTableIfDescrs.length != ifTableIndexes.length) 498 System.err.println("Mapping of ifDescr is not one-to-one with " + 499 "Logical Interface objects"); 500 else { 501 502 LogicalInterfaceFactory lif = 503 get_context().get_connection_logicalInterfaceFactory(); 504 505 if (lif == null) 506 System.err.println("Factory is null..." + 507 " No LogicalInterface Objects will be created."); 508 else { 509 510 514 String [] logicalInterfacePackages = new String [0]; 515 516 if (vendorName.equalsIgnoreCase("Linux") || 517 vendorName.equalsIgnoreCase("RedHat Linux") || 518 vendorName.equalsIgnoreCase("RedHat")) { 519 520 } 523 logical_interface_subordinates = new NameComponent [ifTableIndexes.length][0]; 524 for (int i = 0; i < ifTableIndexes.length; i++) { 525 526 logical_interface_subordinates[i] = lif.create( 527 "LogicalInterface_IpNode", 528 name, 529 ifTableIfDescrs[i], 530 logicalInterfacePackages, 531 ifTableIndexes[i], 532 managementIPAddress, 533 snmpPort, 534 supportedSnmpVersions, 535 ifTableIfDescrs[i]); 536 } 537 } 538 } 539 540 try { 542 543 DataType[] res = this.connector.getBulk( 544 IP_GROUP_OIDS, 545 new String (managementIPAddress), 546 snmpPort, 547 READ_COMMUNITY); 548 549 int count = 0; 550 551 for (int i = 0; i < res.length; i++) { 552 try { 553 if ( (res[i].value.extract_string().equalsIgnoreCase( 554 NO_SUCH_OBJECT)) || 555 (res[i].value.extract_string().equalsIgnoreCase( 556 NO_SUCH_INSTANCE)) ) 557 count ++; 558 } 559 catch (org.omg.CORBA.BAD_OPERATION badOp) { 560 } 564 } 565 566 if (count < res.length) { 567 569 IpProtocolMonitorFactory ipf = 570 get_context().get_connection_ipProtocolMonitorFactory(); 571 572 if (ipf == null) { 573 System.err.println("IpProtocolMonitorFactory is null..." + 574 " No IpProtocolMonitor Object will be created!"); 575 } 576 else { 577 579 String [] ipProtocolMonitorPackages = new String [0]; 580 581 if (vendorName.equalsIgnoreCase("Linux") || 582 vendorName.equalsIgnoreCase("RedHat Linux") || 583 vendorName.equalsIgnoreCase("RedHat")) { 584 585 } 588 589 ipf.create( 590 "IpProtocolMonitor_IpNode", 591 name, 592 "IpProtocol", 593 ipProtocolMonitorPackages, 594 managementIPAddress, 595 snmpPort, 596 supportedSnmpVersions 597 ); 598 599 } 600 } } 602 catch (SnmpApplicationError e) { 603 System.err.println("\nIpNodeFactory:SnmpApplicationError while trying to create IpProtocolMonitorFactory"); 604 System.err.println("Reason:" + e.reason); 605 606 } 608 610 615 DataType[] ipTable = new DataType[0]; 616 try { 617 ipTable = this.connector.getSnmpTable( 618 SnmpIdentifiers.IP_ADDR_TABLE_OID, 619 new String (managementIPAddress), 620 snmpPort, 621 READ_COMMUNITY); 622 } 623 catch(ist.coach.coachEmfServices.SnmpAdapter.SnmpApplicationError snmp_ex) { 624 System.err.println("SnmpApplicationError caught> " + 625 snmp_ex.reason); 626 return name; 627 } 628 catch(Exception e) { 629 System.err.println("IpNodeFactory: create>Exception caught: " + e.getMessage()); 630 e.printStackTrace(System.err); 631 } 632 634 int[] ipAdEntAddrIndexRows = { 1 }; 635 String [] ipAdEntAddresses = SnmpUtils.getStringColumnData(ipTable, 636 4, ipAdEntAddrIndexRows); 637 644 int[] ipAdEntIfIndexRows = { 2 }; 645 int [] ipAdEntIfIndexes = SnmpUtils.getIntColumnData(ipTable, 646 4, ipAdEntIfIndexRows); 647 648 655 if (ipAdEntAddresses == null) { 656 System.err.println("IpNodeFactory> Indexes could not be determined for" + 657 " Ip Address Data. No IPAddressData objects will" + 658 " be created."); 659 } 660 else 661 if (ipAdEntAddresses.length == 0) 662 System.err.println("IpNodeFactory> No IPAddressData objects found"); 663 else 664 if (ipAdEntIfIndexes.length == 0) 665 System.err.println("IpNodeFactory> Could not determine interface index " + 666 "for IpAddressData Objects"); 667 else 668 if (ipAdEntIfIndexes.length != ipAdEntAddresses.length) 669 System.err.println("IpNodeFactory> Mapping of IpAddressData is not one-to-one with " + 670 "Logical Interface objects"); 671 else { 672 IpAddressDataFactory ip_address_factory = 674 get_context().get_connection_ipAddressDataFactory(); 675 676 if (ip_address_factory == null) 677 System.err.println("IpNodeFactory> IpAddressDataFactory can not be located..." + 678 " No IpAddressData Objects will be created."); 679 else { 680 681 685 int interface_index; 686 for (int k = 0; k < ipAdEntAddresses.length; k++) { 687 688 interface_index = -1; 689 for (int l = 0; l < ifTableIndexes.length; l++) { 690 if (ipAdEntIfIndexes[k] == ifTableIndexes[l]) { 691 interface_index = l; 692 break; 693 } 694 } 695 if (interface_index < 0) { 696 System.err.println("IpNodeFactoryProvider> IpAddressData can not be associated with " + 697 " existing lofical interfaces..." + ipAdEntIfIndexes[k]); 698 continue; 699 700 } 701 NameComponent [] superior_interface = logical_interface_subordinates[interface_index]; 702 703 ip_address_factory.create("IpAddressData_LogicalInterface", 704 superior_interface, 705 new String (), 706 new String [0], 707 ipAdEntAddresses[k].getBytes(), 708 managementIPAddress, 709 snmpPort, 710 supportedSnmpVersions 711 ); 712 } 713 } 714 } 715 716 String [] snmpSupportedConditionalPackages = new String [0]; 718 if (vendorName.equalsIgnoreCase("Linux") || 719 vendorName.equalsIgnoreCase("RedHat Linux") || 720 vendorName.equalsIgnoreCase("RedHat")) { 721 722 snmpSupportedConditionalPackages = new String [1]; 723 snmpSupportedConditionalPackages[0] = snmpEnableAuthenTrapPackageType.value; 724 } 725 create_snmp_monitor(name, managementIPAddress, snmpPort, supportedSnmpVersions, 726 snmpSupportedConditionalPackages); 727 728 Utils.pretty_log(logSupport, FACTORY_CLASS, "Factory", (short) LogSeverity._Info, 729 "successfully created " + Utils.name2string(name)); 730 return name; 731 732 } 733 734 public void create_snmp_monitor(org.omg.CosNaming.NameComponent [] superior, 735 byte[] managementIPAddress, 736 int snmpPort, 737 int supportedSnmpVersions, 738 String [] supportedConditionalPackages) { 739 740 try { 742 DataType[] res = this.connector.getBulk( 745 SNMP_GROUP_OIDS, 746 new String (managementIPAddress), 747 snmpPort, 748 READ_COMMUNITY); 749 750 int count = 0; 751 752 for (int i = 0; i < res.length; i++) { 753 try { 754 if ( (res[i].value.extract_string().equalsIgnoreCase( 755 NO_SUCH_OBJECT)) || 756 (res[i].value.extract_string().equalsIgnoreCase( 757 NO_SUCH_INSTANCE)) ) 758 count ++; 759 } 760 catch (org.omg.CORBA.BAD_OPERATION badOp) { 761 } 765 } 766 System.err.println("SnmpProtocolMonitor must be created."); 769 770 SnmpProtocolMonitorFactory snmpf = 771 get_context().get_connection_snmpProtocolMonitorFactory(); 772 773 if (snmpf == null) { 774 System.err.println("SnmpProtocolMonitorFactory can not be found..." + 775 " No SnmpProtocolMonitor Object will be created!"); 776 } 777 else { 778 System.err.println("IpNodeFactoryProvider>Invoking SnmpProtocolMonitorFactory..."); 779 780 snmpf.create( 781 "SnmpProtocolMonitor_IpNode", 782 superior, 783 "SnmpProtocol", 784 supportedConditionalPackages, 785 managementIPAddress, 786 snmpPort, 787 supportedSnmpVersions 788 ); 789 790 } 791 } 793 catch (SnmpApplicationError e) { 794 System.err.println("\nIpNodeFactory:SnmpApplicationError while trying to create SnmpProtocolMonitorFactory"); 795 System.err.println("Reason:" + e.reason); 796 } 797 catch (ApplicationError appl_e) { 798 System.err.println("\nIpNodeFactory:ApplicationError while trying to create SnmpProtocolMonitorFactory"); 799 System.err.println("Reason:" + appl_e.getMessage()); 800 } 801 catch (CreateError create_e) { 802 System.err.println("\nIpNodeFactory:CreateError while trying to create SnmpProtocolMonitorFactory"); 803 System.err.println("Reason:" + create_e.getMessage()); 804 } 805 806 } 807 808 public org.omg.CosNaming.NameComponent [] 814 create_base(String nameBinding, 815 org.omg.CosNaming.NameComponent [] superior, 816 String reqId) 817 throws intt.itu.itut_x780.ApplicationError, intt.itu.itut_x780.CreateError { 818 819 return new NameComponent [0]; 820 } 821 } 822 | Popular Tags |