1 21 22 package ist.coach.coachEmsMibComponents; 23 24 import intt.itu.itut_x780.UIDType; 25 import intt.itu.itut_x780.CreateError; 26 import intt.itu.itut_x780.ApplicationError; 27 import intt.itu.itut_x780.AttributeValueChangeType; 28 import intt.itu.itut_x780.AttributeValueType; 29 import intt.itu.itut_x780.SourceIndicatorType; 30 import intt.itu.itut_x780.OperationalStateTypeHelper; 31 import intt.itu.itut_x780.OperationalStateType; 32 33 import ist.coach.coachEmfCommon.Utils; 34 import ist.coach.coachEmfCommon.StateChangedEventImpl; 35 import ist.coach.coachEmfCommon.StateChangedEventImpl; 36 import ist.coach.coachEmfCommon.ObjectCreationImpl; 37 import ist.coach.coachEmfCommon.ObjectDeletionImpl; 38 import ist.coach.coachEmfCommon.ExceptionMessages; 39 import ist.coach.coachEmfCommon.CreateErrorInfoTypeImpl; 40 import ist.coach.coachEmfCommon.ApplicationErrorInfoTypeImpl; 41 import ist.coach.coachEmfCommon.DataTypeImpl; 42 import ist.coach.coachEmfServices.SnmpAdapter.DataType; 43 import ist.coach.coachEmfServices.SnmpAdapter.SnmpApplicationError; 44 45 import ist.coach.coachEmsMib.LogicalInterfaceValueType; 46 import ist.coach.coachEmsMib.LogicalInterface_F; 47 import ist.coach.coachEmsMibComponents.LogicalInterfaceProviderHelper; 48 49 import ist.coach.coachEmsCommon.LogicalInterfaceValueTypeImpl; 50 51 import org.omg.CosNaming.NameComponent ; 52 import org.omg.CORBA.TCKind ; 53 54 import org.opennms.protocols.snmp.SnmpSMI; 55 56 import java.util.Hashtable ; 57 58 62 public class LogicalInterfaceProviderMonolithicImpl 63 extends org.omg.CORBA.LocalObject 64 implements CCM_LogicalInterfaceProvider, 65 ist.coach.coachEmsMibComponents.CCM_LogicalInterfaceMgmt, 66 ist.coach.coachEmfServices.SnmpAdapter.CCM_TrapCallback, 67 org.omg.Components.SessionComponent 68 { 69 77 private CCM_LogicalInterfaceProvider_Context the_context_; 78 79 org.omg.CORBA.ORB orb = null; 80 private String _facade_name; 81 82 private Hashtable elements; 83 private int notifId = 1100; 84 85 public static final String IF_TABLE_OID = ".1.3.6.1.2.1.2.2"; 86 87 private static final String IF_DESCR_OID = ".1.3.6.1.2.1.2.2.1.2"; 88 private static final String IF_TYPE_OID = ".1.3.6.1.2.1.2.2.1.3"; 89 private static final String IF_MTU_OID = ".1.3.6.1.2.1.2.2.1.4"; 90 private static final String IF_SPEED_OID = ".1.3.6.1.2.1.2.2.1.5"; 91 private static final String IF_PHYSADDR_OID = ".1.3.6.1.2.1.2.2.1.6"; 92 private static final String IF_ADMINSTATUS_OID = ".1.3.6.1.2.1.2.2.1.7"; 93 private static final String IF_OPERSTATUS_OID = ".1.3.6.1.2.1.2.2.1.8"; 94 private static final String IF_LASTCHANGE_OID = ".1.3.6.1.2.1.2.2.1.9"; 95 private static final String IF_INOCTETS_OID = ".1.3.6.1.2.1.2.2.1.10"; 96 private static final String IF_INUCASTPKTS_OID = ".1.3.6.1.2.1.2.2.1.11"; 97 private static final String IF_INNUCASTPKTS_OID = ".1.3.6.1.2.1.2.2.1.12"; 98 private static final String IF_INDISCARDS_OID = ".1.3.6.1.2.1.2.2.1.13"; 99 private static final String IF_INERRORS_OID = ".1.3.6.1.2.1.2.2.1.14"; 100 private static final String IF_INUNKNOWNPROTOS_OID = ".1.3.6.1.2.1.2.2.1.15"; 101 private static final String IF_OUTOCTETS_OID = ".1.3.6.1.2.1.2.2.1.16"; 102 private static final String IF_OUTUCASTPKTS_OID = ".1.3.6.1.2.1.2.2.1.17"; 103 private static final String IF_OUTNUCASTPKTS_OID = ".1.3.6.1.2.1.2.2.1.18"; 104 private static final String IF_OUTDISCARDS_OID = ".1.3.6.1.2.1.2.2.1.19"; 105 private static final String IF_OUTERRORS_OID = ".1.3.6.1.2.1.2.2.1.20"; 106 private static final String IF_OUTQLEN_OID = ".1.3.6.1.2.1.2.2.1.21"; 107 private static final String IF_SPECIFIC_OID = ".1.3.6.1.2.1.2.2.1.22"; 108 109 private static final String TIME_OID = ".1.3.6.1.2.1.1.3.0"; 110 private static final int COACH_LINK_UP = 2; 111 private static final int COACH_LINK_DOWN = 3; 112 113 private static final String IF_LAST_CHANGE_PACKAGE = "ifLastChangePackage"; 114 private static final String IF_ADMIN_STATUS_PACKAGE = "ifAdminStatusPackage"; 115 private static final String OPERATIONAL_STATE_PACKAGE = "operationalStatePackage"; 116 private static final String NON_UCAST_PACKAGE = "ifNUcastPackage"; 117 private static final String UNKNOWN_PROTOS_PACKAGE = "ifUnknownProtosPackage"; 118 119 private static final String READ_COMMUNITY = "public"; 120 private static final String WRITE_COMMUNITY = "private"; 121 123 ist.coach.coachEmfServices.SnmpAdapter.SnmpConnector connector = null; 124 ist.coach.coachEmfServices.SnmpAdapter.SnmpTrapDaemon config = null; 125 126 134 public 135 LogicalInterfaceProviderMonolithicImpl() 136 { 137 the_context_ = null; 138 139 this.elements = new Hashtable (); 140 } 141 147 148 159 public CCM_LogicalInterfaceProvider_Context 160 getContext() 161 { 162 return the_context_; 163 } 164 178 public void 179 configuration_complete() 180 throws org.omg.Components.InvalidConfiguration 181 { 182 186 if ((connector = the_context_.get_connection_connector()) == null) 187 throw new org.omg.Components.InvalidConfiguration(); 188 189 if ((config = the_context_.get_connection_config()) == null) 190 throw new org.omg.Components.InvalidConfiguration(); 191 192 orb = org.objectweb.ccm.CORBA.TheORB.getORB(); 193 System.err.println("LogicalInterface configuration completed..."); 194 195 196 } 197 213 public void 214 set_session_context(org.omg.Components.SessionContext context) 215 throws org.omg.Components.CCMException 216 { 217 the_context_ = (CCM_LogicalInterfaceProvider_Context)context; 218 } 219 229 public void 230 ccm_activate() 231 throws org.omg.Components.CCMException 232 { 233 } 237 247 public void 248 ccm_passivate() 249 throws org.omg.Components.CCMException 250 { 251 } 255 265 public void 266 ccm_remove() 267 throws org.omg.Components.CCMException 268 { 269 } 273 284 public ist.coach.coachEmsMibComponents.CCM_LogicalInterfaceMgmt 285 get_mgmt() 286 { 287 return this; 288 } 289 295 public ist.coach.coachEmfServices.SnmpAdapter.CCM_TrapCallback 296 get_snmp_callback() 297 { 298 return this; 299 } 300 306 public java.lang.String 307 facade_name() 308 { 309 return _facade_name; 313 } 314 315 318 public void 319 facade_name(java.lang.String val) 320 { 321 325 if (val != null) 326 _facade_name = new String (val); 327 } 328 334 public int 335 ifIndexGet(org.omg.CosNaming.NameComponent [] name) 336 { 337 341 343 String key = Utils.name2string(name); 344 345 if (this.elements.containsKey(key) == false) { 346 357 358 return -1; 359 } 360 361 LogicalInterfaceDataStructure data = 362 (LogicalInterfaceDataStructure) this.elements.get(key); 363 364 return data.ifIndex; 365 } 366 367 373 public java.lang.String 374 ifDescrGet(org.omg.CosNaming.NameComponent [] name) 375 throws intt.itu.itut_x780.ApplicationError 376 { 377 381 String key = Utils.name2string(name); 382 383 if (this.elements.containsKey(key) == false) { 384 ApplicationErrorInfoTypeImpl error_code = 385 new ApplicationErrorInfoTypeImpl(); 386 387 error_code.error = new UIDType( 388 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 389 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 390 391 error_code.details = new String ("object with name " + 392 key + " does not exist."); 393 394 throw new ApplicationError(error_code); 395 } 396 397 LogicalInterfaceDataStructure data = 398 (LogicalInterfaceDataStructure) this.elements.get(key); 399 400 int ifIndex = data.ifIndex; 401 402 String ifDescrOid = new String (IF_DESCR_OID + "." + ifIndex); 403 404 DataType ifDescrData = null; 405 406 408 try { 409 ifDescrData = this.connector.get( 410 ifDescrOid, 411 new String (data.mgmtIpAddress), 412 data.getSnmpPort(), 413 READ_COMMUNITY); 414 } 415 catch (SnmpApplicationError e) { 416 417 ApplicationErrorInfoTypeImpl error_code = 418 new ApplicationErrorInfoTypeImpl(); 419 420 error_code.error = new UIDType( 421 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 422 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 423 424 if (e.reason.equals(ExceptionMessages.agent_response_error)) 425 error_code.details = ExceptionMessages.agent_response_error; 426 else 427 error_code.details = new String ("Could not retrieve ifDescr " + 428 "for LogicalInterface Object with name " + key + ":" + 429 " Object with Snmp Object Identifier " + ifDescrOid + 430 " does not exist."); 431 throw new ApplicationError (error_code); 432 } 433 434 org.omg.CORBA.Any value = ifDescrData.value; 435 436 if (value.type().kind().value() != org.omg.CORBA.OctetSeqHelper.type().kind().value()) { 438 ApplicationErrorInfoTypeImpl error_code = 439 new ApplicationErrorInfoTypeImpl(); 440 441 error_code.error = new UIDType( 442 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 443 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 444 445 error_code.details = new String ("Could not retrieve ifDescr " + 446 "for LogicalInterface Object with name " + key + ":" + 447 " Object with Snmp Object Identifier " + ifDescrOid + 448 " is not of expected type."); 449 450 throw new ApplicationError (error_code); 451 452 } 453 String ifDescr = new String (org.omg.CORBA.OctetSeqHelper.extract(value)); 456 return ifDescr; 457 458 } 459 465 public int 466 ifTypeGet(org.omg.CosNaming.NameComponent [] name) 467 throws intt.itu.itut_x780.ApplicationError 468 { 469 473 String key = Utils.name2string(name); 474 475 if (this.elements.containsKey(key) == false) { 476 ApplicationErrorInfoTypeImpl error_code = 477 new ApplicationErrorInfoTypeImpl(); 478 479 error_code.error = new UIDType( 480 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 481 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 482 483 error_code.details = new String ("object with name " + 484 key + " does not exist."); 485 486 throw new ApplicationError(error_code); 487 } 488 489 LogicalInterfaceDataStructure data = 490 (LogicalInterfaceDataStructure) this.elements.get(key); 491 492 int ifIndex = data.ifIndex; 493 494 String ifTypeOid = new String (IF_TYPE_OID + "." + ifIndex); 495 496 DataType ifTypeData = null; 497 498 500 try { 501 ifTypeData = this.connector.get( 502 ifTypeOid, 503 new String (data.mgmtIpAddress), 504 data.getSnmpPort(), 505 READ_COMMUNITY); 506 } 507 catch (SnmpApplicationError e) { 508 509 ApplicationErrorInfoTypeImpl error_code = 510 new ApplicationErrorInfoTypeImpl(); 511 512 error_code.error = new UIDType( 513 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 514 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 515 516 if (e.reason.equals(ExceptionMessages.agent_response_error)) 517 error_code.details = ExceptionMessages.agent_response_error; 518 else 519 error_code.details = new String ("Could not retrieve ifType " + 520 "for LogicalInterface Object with name " + key + ":" + 521 " Object with Snmp Object Identifier " + ifTypeOid + 522 " does not exist."); 523 throw new ApplicationError (error_code); 524 } 525 526 org.omg.CORBA.Any value = ifTypeData.value; 527 528 if (value.type().kind().value() != TCKind._tk_long) { 529 530 ApplicationErrorInfoTypeImpl error_code = 531 new ApplicationErrorInfoTypeImpl(); 532 533 error_code.error = new UIDType( 534 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 535 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 536 537 error_code.details = new String ("Could not retrieve ifType " + 538 "for LogicalInterface Object with name " + key + ":" + 539 " Object with Snmp Object Identifier " + ifTypeOid + 540 " is not of type integer, as expected."); 541 542 throw new ApplicationError (error_code); 543 544 } 545 546 int ifType = value.extract_long(); 547 548 return ifType; 549 } 550 556 public int 557 ifMtuGet(org.omg.CosNaming.NameComponent [] name) 558 throws intt.itu.itut_x780.ApplicationError 559 { 560 String key = Utils.name2string(name); 564 565 if (this.elements.containsKey(key) == false) { 566 ApplicationErrorInfoTypeImpl error_code = 567 new ApplicationErrorInfoTypeImpl(); 568 569 error_code.error = new UIDType( 570 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 571 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 572 573 error_code.details = new String ("object with name " + 574 key + " does not exist."); 575 576 throw new ApplicationError(error_code); 577 } 578 579 LogicalInterfaceDataStructure data = 580 (LogicalInterfaceDataStructure) this.elements.get(key); 581 582 int ifIndex = data.ifIndex; 583 584 String ifMtuOid = new String (IF_MTU_OID + "." + ifIndex); 585 586 DataType ifMtuData = null; 587 588 590 try { 591 592 ifMtuData = this.connector.get( 593 ifMtuOid, 594 new String (data.mgmtIpAddress), 595 data.getSnmpPort(), 596 READ_COMMUNITY); 597 } 598 catch (SnmpApplicationError e) { 599 600 ApplicationErrorInfoTypeImpl error_code = 601 new ApplicationErrorInfoTypeImpl(); 602 603 error_code.error = new UIDType( 604 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 605 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 606 607 if (e.reason.equals(ExceptionMessages.agent_response_error)) 608 error_code.details = ExceptionMessages.agent_response_error; 609 else 610 error_code.details = new String ("Could not retrieve ifMtu " + 611 "for LogicalInterface Object with name " + key + ":" + 612 " Object with Snmp Object Identifier " + ifMtuOid + 613 " does not exist."); 614 throw new ApplicationError (error_code); 615 } 616 617 org.omg.CORBA.Any value = ifMtuData.value; 618 619 if (value.type().kind().value() != TCKind._tk_long) { 620 621 ApplicationErrorInfoTypeImpl error_code = 622 new ApplicationErrorInfoTypeImpl(); 623 624 error_code.error = new UIDType( 625 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 626 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 627 628 error_code.details = new String ("Could not retrieve ifMtu " + 629 "for LogicalInterface Object with name " + key + ":" + 630 " Object with Snmp Object Identifier " + ifMtuOid + 631 " is not of type integer, as expected."); 632 633 throw new ApplicationError (error_code); 634 635 } 636 637 int ifMtu = value.extract_long(); 638 639 return ifMtu; 640 } 641 647 public long 648 ifSpeedGet(org.omg.CosNaming.NameComponent [] name) 649 throws intt.itu.itut_x780.ApplicationError 650 { 651 String key = Utils.name2string(name); 655 656 if (this.elements.containsKey(key) == false) { 657 ApplicationErrorInfoTypeImpl error_code = 658 new ApplicationErrorInfoTypeImpl(); 659 660 error_code.error = new UIDType( 661 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 662 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 663 664 error_code.details = new String ("object with name " + 665 key + " does not exist."); 666 667 throw new ApplicationError(error_code); 668 } 669 670 LogicalInterfaceDataStructure data = 671 (LogicalInterfaceDataStructure) this.elements.get(key); 672 673 int ifIndex = data.ifIndex; 674 675 String ifSpeedOid = new String (IF_SPEED_OID + "." + ifIndex); 676 677 DataType ifSpeedData = null; 678 679 681 try { 682 ifSpeedData = this.connector.get( 683 ifSpeedOid, 684 new String (data.mgmtIpAddress), 685 data.getSnmpPort(), 686 READ_COMMUNITY); 687 } 688 catch (SnmpApplicationError e) { 689 690 ApplicationErrorInfoTypeImpl error_code = 691 new ApplicationErrorInfoTypeImpl(); 692 693 error_code.error = new UIDType( 694 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 695 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 696 697 if (e.reason.equals(ExceptionMessages.agent_response_error)) 698 error_code.details = ExceptionMessages.agent_response_error; 699 else 700 error_code.details = new String ("Could not retrieve ifMtu " + 701 "for LogicalInterface Object with name " + key + ":" + 702 " Object with Snmp Object Identifier " + ifSpeedOid + 703 " does not exist."); 704 throw new ApplicationError (error_code); 705 } 706 707 org.omg.CORBA.Any value = ifSpeedData.value; 708 709 if (value.type().kind().value() != TCKind._tk_longlong) { 710 711 ApplicationErrorInfoTypeImpl error_code = 712 new ApplicationErrorInfoTypeImpl(); 713 714 error_code.error = new UIDType( 715 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 716 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 717 718 error_code.details = new String ("Could not retrieve ifSpeed " + 719 "for LogicalInterface Object with name " + key + ":" + 720 " Object with Snmp Object Identifier " + ifSpeedOid + 721 " is not of type integer, as expected."); 722 723 throw new ApplicationError (error_code); 724 725 } 726 727 long ifSpeed = value.extract_longlong(); 728 729 return ifSpeed; 730 } 731 737 public byte[] 738 ifPhysAddressGet(org.omg.CosNaming.NameComponent [] name) 739 throws intt.itu.itut_x780.ApplicationError 740 { 741 String key = Utils.name2string(name); 745 746 if (this.elements.containsKey(key) == false) { 747 ApplicationErrorInfoTypeImpl error_code = 748 new ApplicationErrorInfoTypeImpl(); 749 750 error_code.error = new UIDType( 751 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 752 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 753 754 error_code.details = new String ("object with name " + 755 key + " does not exist."); 756 757 throw new ApplicationError(error_code); 758 } 759 760 LogicalInterfaceDataStructure data = 761 (LogicalInterfaceDataStructure) this.elements.get(key); 762 763 int ifIndex = data.ifIndex; 764 765 String ifPhysAddrOid = new String (IF_PHYSADDR_OID + "." + ifIndex); 766 767 DataType ifPhysAddrData = null; 768 769 771 try { 772 ifPhysAddrData = this.connector.get( 773 ifPhysAddrOid, 774 new String (data.mgmtIpAddress), 775 data.getSnmpPort(), 776 READ_COMMUNITY); 777 } 778 catch (SnmpApplicationError e) { 779 780 ApplicationErrorInfoTypeImpl error_code = 781 new ApplicationErrorInfoTypeImpl(); 782 783 error_code.error = new UIDType( 784 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 785 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 786 787 if (e.reason.equals(ExceptionMessages.agent_response_error)) 788 error_code.details = ExceptionMessages.agent_response_error; 789 else 790 error_code.details = new String ("Could not retrieve ifPhysAddr " + 791 "for LogicalInterface Object with name " + key + ":" + 792 " Object with Snmp Object Identifier " + ifPhysAddrOid + 793 " does not exist."); 794 throw new ApplicationError (error_code); 795 } 796 797 org.omg.CORBA.Any value = ifPhysAddrData.value; 798 799 if (value.type().kind().value() != org.omg.CORBA.OctetSeqHelper.type().kind().value()) { 801 ApplicationErrorInfoTypeImpl error_code = 802 new ApplicationErrorInfoTypeImpl(); 803 804 error_code.error = new UIDType( 805 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 806 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 807 808 error_code.details = new String ("Could not retrieve ifPhysAddr " + 809 "for LogicalInterface Object with name " + key + ":" + 810 " Object with Snmp Object Identifier " + ifPhysAddrOid + 811 " is not of expected type."); 812 813 throw new ApplicationError (error_code); 814 815 } 816 820 byte [] ifPhysAddr = org.omg.CORBA.OctetSeqHelper.extract(value); 821 return ifPhysAddr; 822 } 823 829 public int 830 ifAdminStatusGet(org.omg.CosNaming.NameComponent [] name) 831 throws intt.itu.itut_x780.ApplicationError 832 { 833 String key = Utils.name2string(name); 837 838 if (this.elements.containsKey(key) == false) { 839 ApplicationErrorInfoTypeImpl error_code = 840 new ApplicationErrorInfoTypeImpl(); 841 842 error_code.error = new UIDType( 843 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 844 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 845 846 error_code.details = new String ("object with name " + 847 key + " does not exist."); 848 849 throw new ApplicationError(error_code); 850 } 851 852 LogicalInterfaceDataStructure data = 853 (LogicalInterfaceDataStructure) this.elements.get(key); 854 855 int ifIndex = data.ifIndex; 856 857 String ifAdminStatusOid = new String (IF_ADMINSTATUS_OID + "." + ifIndex); 858 859 DataType ifAdminStatusData = null; 860 861 863 try { 864 ifAdminStatusData = this.connector.get( 865 ifAdminStatusOid, 866 new String (data.mgmtIpAddress), 867 data.getSnmpPort(), 868 READ_COMMUNITY); 869 } 870 catch (SnmpApplicationError e) { 871 872 ApplicationErrorInfoTypeImpl error_code = 873 new ApplicationErrorInfoTypeImpl(); 874 875 error_code.error = new UIDType( 876 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 877 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 878 879 if (e.reason.equals(ExceptionMessages.agent_response_error)) 880 error_code.details = ExceptionMessages.agent_response_error; 881 else 882 error_code.details = new String ("Could not retrieve ifAdminStatus " + 883 "for LogicalInterface Object with name " + key + ":" + 884 " Object with Snmp Object Identifier " + ifAdminStatusOid + 885 " does not exist."); 886 throw new ApplicationError (error_code); 887 } 888 889 org.omg.CORBA.Any value = ifAdminStatusData.value; 890 891 if (value.type().kind().value() != TCKind._tk_long) { 892 893 ApplicationErrorInfoTypeImpl error_code = 894 new ApplicationErrorInfoTypeImpl(); 895 896 error_code.error = new UIDType( 897 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 898 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 899 900 error_code.details = new String ("Could not retrieve ifAdminStatus " + 901 "for LogicalInterface Object with name " + key + ":" + 902 " Object with Snmp Object Identifier " + ifAdminStatusOid + 903 " is not of type integer, as expected."); 904 905 throw new ApplicationError (error_code); 906 907 } 908 909 int ifAdminStatus = value.extract_long(); 910 911 return ifAdminStatus; 912 } 913 919 public void 920 ifAdminStatusSet(org.omg.CosNaming.NameComponent [] name, int ifAdminStatus) 921 throws intt.itu.itut_x780.ApplicationError, ist.coach.coachEmsMib.NOifAdminStatusPackageException 922 { 923 String key = Utils.name2string(name); 927 928 if (this.elements.containsKey(key) == false) { 929 ApplicationErrorInfoTypeImpl error_code = 930 new ApplicationErrorInfoTypeImpl(); 931 932 error_code.error = new UIDType( 933 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 934 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 935 936 error_code.details = new String ("object with name " + 937 key + " does not exist."); 938 939 throw new ApplicationError(error_code); 940 } 941 942 if (!Utils.packageIsSupported(IF_ADMIN_STATUS_PACKAGE, 943 packagesGet(name))) { 944 throw new ist.coach.coachEmsMib.NOifAdminStatusPackageException(); 945 } 946 947 LogicalInterfaceDataStructure data = 948 (LogicalInterfaceDataStructure) this.elements.get(key); 949 950 int ifIndex = data.ifIndex; 951 String ifAdminStatusOid = new String (IF_DESCR_OID + "." + ifIndex); 952 953 org.omg.CORBA.Any value = orb.create_any(); 954 value.insert_long(ifAdminStatus); 955 DataTypeImpl ifAdminStatusData = new DataTypeImpl( 956 ifAdminStatusOid, 957 value, 958 SnmpSMI.SMI_INTEGER); 959 960 962 try { 963 this.connector.set( 964 ifAdminStatusData, 965 new String (data.mgmtIpAddress), 966 data.getSnmpPort(), 967 WRITE_COMMUNITY); 968 } 969 catch (SnmpApplicationError e) { 970 971 ApplicationErrorInfoTypeImpl error_code = 972 new ApplicationErrorInfoTypeImpl(); 973 974 error_code.error = new UIDType( 975 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 976 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 977 978 if (e.reason.equals(ExceptionMessages.agent_response_error)) 979 error_code.details = ExceptionMessages.agent_response_error; 980 else 981 error_code.details = new String ("Could not set ifAdminStatus " + 982 "for LogicalInterface Object with name " + key + "."); 983 throw new ApplicationError (error_code); 984 } 985 986 } 987 993 public int 994 ifOperStatusGet(org.omg.CosNaming.NameComponent [] name) 995 throws intt.itu.itut_x780.ApplicationError 996 { 997 String key = Utils.name2string(name); 1001 1002 if (this.elements.containsKey(key) == false) { 1003 ApplicationErrorInfoTypeImpl error_code = 1004 new ApplicationErrorInfoTypeImpl(); 1005 1006 error_code.error = new UIDType( 1007 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1008 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1009 1010 error_code.details = new String ("object with name " + 1011 key + " does not exist."); 1012 1013 throw new ApplicationError(error_code); 1014 } 1015 1016 LogicalInterfaceDataStructure data = 1017 (LogicalInterfaceDataStructure) this.elements.get(key); 1018 1019 int ifIndex = data.ifIndex; 1020 1021 String ifOperStatusOid = new String (IF_OPERSTATUS_OID + "." + ifIndex); 1022 1023 DataType ifOperStatusData = null; 1024 1025 1027 try { 1028 ifOperStatusData = this.connector.get( 1029 ifOperStatusOid, 1030 new String (data.mgmtIpAddress), 1031 data.getSnmpPort(), 1032 READ_COMMUNITY); 1033 } 1034 catch (SnmpApplicationError e) { 1035 1036 ApplicationErrorInfoTypeImpl error_code = 1037 new ApplicationErrorInfoTypeImpl(); 1038 1039 error_code.error = new UIDType( 1040 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1041 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1042 1043 if (e.reason.equals(ExceptionMessages.agent_response_error)) 1044 error_code.details = ExceptionMessages.agent_response_error; 1045 else 1046 error_code.details = new String ("Could not retrieve ifOperStatus " + 1047 "for LogicalInterface Object with name " + key + ":" + 1048 " Object with Snmp Object Identifier " + ifOperStatusOid + 1049 " does not exist."); 1050 throw new ApplicationError (error_code); 1051 } 1052 1053 org.omg.CORBA.Any value = ifOperStatusData.value; 1054 1055 if (value.type().kind().value() != TCKind._tk_long) { 1056 1057 ApplicationErrorInfoTypeImpl error_code = 1058 new ApplicationErrorInfoTypeImpl(); 1059 1060 error_code.error = new UIDType( 1061 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1062 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1063 1064 error_code.details = new String ("Could not retrieve ifOperStatus " + 1065 "for LogicalInterface Object with name " + key + ":" + 1066 " Object with Snmp Object Identifier " + ifOperStatusOid + 1067 " is not of type integer, as expected."); 1068 1069 throw new ApplicationError (error_code); 1070 1071 } 1072 1073 int ifOperStatus = value.extract_long(); 1074 1075 return ifOperStatus; 1076 } 1077 1083 public long 1084 ifLastChangeGet(org.omg.CosNaming.NameComponent [] name) 1085 throws intt.itu.itut_x780.ApplicationError, ist.coach.coachEmsMib.NOifLastChangePackageException 1086 { 1087 1091 String key = Utils.name2string(name); 1092 1093 if (this.elements.containsKey(key) == false) { 1094 ApplicationErrorInfoTypeImpl error_code = 1095 new ApplicationErrorInfoTypeImpl(); 1096 1097 error_code.error = new UIDType( 1098 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1099 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1100 1101 error_code.details = new String ("object with name " + 1102 key + " does not exist."); 1103 1104 throw new ApplicationError(error_code); 1105 } 1106 1107 if (!Utils.packageIsSupported(IF_LAST_CHANGE_PACKAGE, 1108 packagesGet(name))) { 1109 throw new ist.coach.coachEmsMib.NOifLastChangePackageException(); 1110 } 1111 1112 LogicalInterfaceDataStructure data = 1113 (LogicalInterfaceDataStructure) this.elements.get(key); 1114 1115 int ifIndex = data.ifIndex; 1116 1117 String ifLastChangeOid = new String (IF_LASTCHANGE_OID + "." + ifIndex); 1118 1119 DataType ifLastChangeData = null; 1120 1121 1123 try { 1124 ifLastChangeData = this.connector.get( 1125 ifLastChangeOid, 1126 new String (data.mgmtIpAddress), 1127 data.getSnmpPort(), 1128 READ_COMMUNITY); 1129 } 1130 catch (SnmpApplicationError e) { 1131 1132 ApplicationErrorInfoTypeImpl error_code = 1133 new ApplicationErrorInfoTypeImpl(); 1134 1135 error_code.error = new UIDType( 1136 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1137 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1138 1139 if (e.reason.equals(ExceptionMessages.agent_response_error)) 1140 error_code.details = ExceptionMessages.agent_response_error; 1141 else 1142 error_code.details = new String ("Could not retrieve ifLastChange " + 1143 "for LogicalInterface Object with name " + key + ":" + 1144 " Object with Snmp Object Identifier " + ifLastChangeOid + 1145 " does not exist."); 1146 throw new ApplicationError (error_code); 1147 } 1148 1149 org.omg.CORBA.Any value = ifLastChangeData.value; 1150 1151 if (value.type().kind().value() != TCKind._tk_longlong) { 1152 1153 ApplicationErrorInfoTypeImpl error_code = 1154 new ApplicationErrorInfoTypeImpl(); 1155 1156 error_code.error = new UIDType( 1157 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1158 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1159 1160 error_code.details = new String ("Could not retrieve ifLastChange " + 1161 "for LogicalInterface Object with name " + key + ":" + 1162 " Object with Snmp Object Identifier " + ifLastChangeOid + 1163 " is not of type string, as expected."); 1164 1165 throw new ApplicationError (error_code); 1166 1167 } 1168 1169 long ifLastChange = value.extract_longlong(); 1170 1171 return ifLastChange; 1172 } 1173 1174 1180 public long 1181 ifInOctetsGet(org.omg.CosNaming.NameComponent [] name) 1182 throws intt.itu.itut_x780.ApplicationError 1183 { 1184 String key = Utils.name2string(name); 1188 1189 if (this.elements.containsKey(key) == false) { 1190 ApplicationErrorInfoTypeImpl error_code = 1191 new ApplicationErrorInfoTypeImpl(); 1192 1193 error_code.error = new UIDType( 1194 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1195 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1196 1197 error_code.details = new String ("object with name " + 1198 key + " does not exist."); 1199 1200 throw new ApplicationError(error_code); 1201 } 1202 1203 LogicalInterfaceDataStructure data = 1204 (LogicalInterfaceDataStructure) this.elements.get(key); 1205 1206 int ifIndex = data.ifIndex; 1207 1208 String ifInOctetsOid = new String (IF_INOCTETS_OID + "." + ifIndex); 1209 1210 DataType ifInOctetsData = null; 1211 1212 1214 try { 1215 ifInOctetsData = this.connector.get( 1216 ifInOctetsOid, 1217 new String (data.mgmtIpAddress), 1218 data.getSnmpPort(), 1219 READ_COMMUNITY); 1220 } 1221 catch (SnmpApplicationError e) { 1222 1223 ApplicationErrorInfoTypeImpl error_code = 1224 new ApplicationErrorInfoTypeImpl(); 1225 1226 error_code.error = new UIDType( 1227 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1228 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1229 1230 if (e.reason.equals(ExceptionMessages.agent_response_error)) 1231 error_code.details = ExceptionMessages.agent_response_error; 1232 else 1233 error_code.details = new String ("Could not retrieve ifInOctets " + 1234 "for LogicalInterface Object with name " + key + ":" + 1235 " Object with Snmp Object Identifier " + ifInOctetsOid + 1236 " does not exist."); 1237 throw new ApplicationError (error_code); 1238 } 1239 1240 org.omg.CORBA.Any value = ifInOctetsData.value; 1241 1242 if (value.type().kind().value() != TCKind._tk_longlong) { 1243 1244 ApplicationErrorInfoTypeImpl error_code = 1245 new ApplicationErrorInfoTypeImpl(); 1246 1247 error_code.error = new UIDType( 1248 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1249 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1250 1251 error_code.details = new String ("Could not retrieve ifInOctets " + 1252 "for LogicalInterface Object with name " + key + ":" + 1253 " Object with Snmp Object Identifier " + ifInOctetsOid + 1254 " is not of type integer, as expected."); 1255 1256 throw new ApplicationError (error_code); 1257 1258 } 1259 1260 long ifInOctets = value.extract_longlong(); 1261 1262 return ifInOctets; 1263 } 1264 1270 public long 1271 ifInUcastPktsGet(org.omg.CosNaming.NameComponent [] name) 1272 throws intt.itu.itut_x780.ApplicationError 1273 { 1274 String key = Utils.name2string(name); 1278 1279 if (this.elements.containsKey(key) == false) { 1280 ApplicationErrorInfoTypeImpl error_code = 1281 new ApplicationErrorInfoTypeImpl(); 1282 1283 error_code.error = new UIDType( 1284 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1285 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1286 1287 error_code.details = new String ("object with name " + 1288 key + " does not exist."); 1289 1290 throw new ApplicationError(error_code); 1291 } 1292 1293 LogicalInterfaceDataStructure data = 1294 (LogicalInterfaceDataStructure) this.elements.get(key); 1295 1296 int ifIndex = data.ifIndex; 1297 1298 String ifInUcastPktsOid = new String (IF_INUCASTPKTS_OID + "." + ifIndex); 1299 1300 DataType ifInUcastPktsData = null; 1301 1302 1304 try { 1305 ifInUcastPktsData = this.connector.get( 1306 ifInUcastPktsOid, 1307 new String (data.mgmtIpAddress), 1308 data.getSnmpPort(), 1309 READ_COMMUNITY); 1310 } 1311 catch (SnmpApplicationError e) { 1312 1313 ApplicationErrorInfoTypeImpl error_code = 1314 new ApplicationErrorInfoTypeImpl(); 1315 1316 error_code.error = new UIDType( 1317 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1318 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1319 1320 if (e.reason.equals(ExceptionMessages.agent_response_error)) 1321 error_code.details = ExceptionMessages.agent_response_error; 1322 else 1323 error_code.details = new String ("Could not retrieve ifInUcastPkts " + 1324 "for LogicalInterface Object with name " + key + ":" + 1325 " Object with Snmp Object Identifier " + ifInUcastPktsOid + 1326 " does not exist."); 1327 throw new ApplicationError (error_code); 1328 } 1329 1330 org.omg.CORBA.Any value = ifInUcastPktsData.value; 1331 1332 if (value.type().kind().value() != TCKind._tk_longlong) { 1333 1334 ApplicationErrorInfoTypeImpl error_code = 1335 new ApplicationErrorInfoTypeImpl(); 1336 1337 error_code.error = new UIDType( 1338 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1339 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1340 1341 error_code.details = new String ("Could not retrieve ifInUcastPkts " + 1342 "for LogicalInterface Object with name " + key + ":" + 1343 " Object with Snmp Object Identifier " + ifInUcastPktsOid + 1344 " is not of type integer, as expected."); 1345 1346 throw new ApplicationError (error_code); 1347 1348 } 1349 1350 long ifInUcastPkts = value.extract_longlong(); 1351 1352 return ifInUcastPkts; 1353 } 1354 1360 public long 1361 ifInNUcastPktsGet(org.omg.CosNaming.NameComponent [] name) 1362 throws intt.itu.itut_x780.ApplicationError, ist.coach.coachEmsMib.NOnonUcastPackageException 1363 { 1364 String key = Utils.name2string(name); 1368 1369 if (this.elements.containsKey(key) == false) { 1370 ApplicationErrorInfoTypeImpl error_code = 1371 new ApplicationErrorInfoTypeImpl(); 1372 1373 error_code.error = new UIDType( 1374 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1375 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1376 1377 error_code.details = new String ("object with name " + 1378 key + " does not exist."); 1379 1380 throw new ApplicationError(error_code); 1381 } 1382 1383 if (!Utils.packageIsSupported(NON_UCAST_PACKAGE, 1384 packagesGet(name))) { 1385 throw new ist.coach.coachEmsMib.NOnonUcastPackageException(); 1386 } 1387 1388 LogicalInterfaceDataStructure data = 1389 (LogicalInterfaceDataStructure) this.elements.get(key); 1390 1391 int ifIndex = data.ifIndex; 1392 1393 String ifInNUcastPktsOid = new String (IF_INNUCASTPKTS_OID + "." + ifIndex); 1394 1395 DataType ifInNUcastPktsData = null; 1396 1397 1399 try { 1400 ifInNUcastPktsData = this.connector.get( 1401 ifInNUcastPktsOid, 1402 new String (data.mgmtIpAddress), 1403 data.getSnmpPort(), 1404 READ_COMMUNITY); 1405 } 1406 catch (SnmpApplicationError e) { 1407 1408 ApplicationErrorInfoTypeImpl error_code = 1409 new ApplicationErrorInfoTypeImpl(); 1410 1411 error_code.error = new UIDType( 1412 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1413 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1414 1415 if (e.reason.equals(ExceptionMessages.agent_response_error)) 1416 error_code.details = ExceptionMessages.agent_response_error; 1417 else 1418 error_code.details = new String ("Could not retrieve ifInNUcastPkts " + 1419 "for LogicalInterface Object with name " + key + ":" + 1420 " Object with Snmp Object Identifier " + ifInNUcastPktsOid + 1421 " does not exist."); 1422 throw new ApplicationError (error_code); 1423 } 1424 1425 org.omg.CORBA.Any value = ifInNUcastPktsData.value; 1426 1427 if (value.type().kind().value() != TCKind._tk_longlong) { 1428 1429 ApplicationErrorInfoTypeImpl error_code = 1430 new ApplicationErrorInfoTypeImpl(); 1431 1432 error_code.error = new UIDType( 1433 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1434 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1435 1436 error_code.details = new String ("Could not retrieve ifInNUcastPkts " + 1437 "for LogicalInterface Object with name " + key + ":" + 1438 " Object with Snmp Object Identifier " + ifInNUcastPktsOid + 1439 " is not of type integer, as expected."); 1440 1441 throw new ApplicationError (error_code); 1442 1443 } 1444 1445 long ifInNUcastPkts = value.extract_longlong(); 1446 1447 return ifInNUcastPkts; 1448 } 1449 1455 public long 1456 ifInDiscardsGet(org.omg.CosNaming.NameComponent [] name) 1457 throws intt.itu.itut_x780.ApplicationError 1458 { 1459 String key = Utils.name2string(name); 1463 1464 if (this.elements.containsKey(key) == false) { 1465 ApplicationErrorInfoTypeImpl error_code = 1466 new ApplicationErrorInfoTypeImpl(); 1467 1468 error_code.error = new UIDType( 1469 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1470 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1471 1472 error_code.details = new String ("object with name " + 1473 key + " does not exist."); 1474 1475 throw new ApplicationError(error_code); 1476 } 1477 1478 LogicalInterfaceDataStructure data = 1479 (LogicalInterfaceDataStructure) this.elements.get(key); 1480 1481 int ifIndex = data.ifIndex; 1482 1483 String ifInDiscardsOid = new String (IF_INDISCARDS_OID + "." + ifIndex); 1484 1485 DataType ifInDiscardsData = null; 1486 1487 1489 try { 1490 ifInDiscardsData = this.connector.get( 1491 ifInDiscardsOid, 1492 new String (data.mgmtIpAddress), 1493 data.getSnmpPort(), 1494 READ_COMMUNITY); 1495 } 1496 catch (SnmpApplicationError e) { 1497 1498 ApplicationErrorInfoTypeImpl error_code = 1499 new ApplicationErrorInfoTypeImpl(); 1500 1501 error_code.error = new UIDType( 1502 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1503 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1504 1505 if (e.reason.equals(ExceptionMessages.agent_response_error)) 1506 error_code.details = ExceptionMessages.agent_response_error; 1507 else 1508 error_code.details = new String ("Could not retrieve ifInDiscards " + 1509 "for LogicalInterface Object with name " + key + ":" + 1510 " Object with Snmp Object Identifier " + ifInDiscardsOid + 1511 " does not exist."); 1512 throw new ApplicationError (error_code); 1513 } 1514 1515 org.omg.CORBA.Any value = ifInDiscardsData.value; 1516 1517 if (value.type().kind().value() != TCKind._tk_longlong) { 1518 1519 ApplicationErrorInfoTypeImpl error_code = 1520 new ApplicationErrorInfoTypeImpl(); 1521 1522 error_code.error = new UIDType( 1523 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1524 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1525 1526 error_code.details = new String ("Could not retrieve ifInDiscards " + 1527 "for LogicalInterface Object with name " + key + ":" + 1528 " Object with Snmp Object Identifier " + ifInDiscardsOid + 1529 " is not of type integer, as expected."); 1530 1531 throw new ApplicationError (error_code); 1532 1533 } 1534 1535 long ifInDiscards = value.extract_longlong(); 1536 1537 return ifInDiscards; 1538 } 1539 1545 public long 1546 ifInErrorsGet(org.omg.CosNaming.NameComponent [] name) 1547 throws intt.itu.itut_x780.ApplicationError 1548 { 1549 String key = Utils.name2string(name); 1553 1554 if (this.elements.containsKey(key) == false) { 1555 ApplicationErrorInfoTypeImpl error_code = 1556 new ApplicationErrorInfoTypeImpl(); 1557 1558 error_code.error = new UIDType( 1559 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1560 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1561 1562 error_code.details = new String ("object with name " + 1563 key + " does not exist."); 1564 1565 throw new ApplicationError(error_code); 1566 } 1567 1568 LogicalInterfaceDataStructure data = 1569 (LogicalInterfaceDataStructure) this.elements.get(key); 1570 1571 int ifIndex = data.ifIndex; 1572 1573 String ifInErrorsOid = new String (IF_INERRORS_OID + "." + ifIndex); 1574 1575 DataType ifInErrorsData = null; 1576 1577 1579 try { 1580 ifInErrorsData = this.connector.get( 1581 ifInErrorsOid, 1582 new String (data.mgmtIpAddress), 1583 data.getSnmpPort(), 1584 READ_COMMUNITY); 1585 } 1586 catch (SnmpApplicationError e) { 1587 1588 ApplicationErrorInfoTypeImpl error_code = 1589 new ApplicationErrorInfoTypeImpl(); 1590 1591 error_code.error = new UIDType( 1592 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1593 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1594 1595 if (e.reason.equals(ExceptionMessages.agent_response_error)) 1596 error_code.details = ExceptionMessages.agent_response_error; 1597 else 1598 error_code.details = new String ("Could not retrieve ifInErrors " + 1599 "for LogicalInterface Object with name " + key + ":" + 1600 " Object with Snmp Object Identifier " + ifInErrorsOid + 1601 " does not exist."); 1602 throw new ApplicationError (error_code); 1603 } 1604 1605 org.omg.CORBA.Any value = ifInErrorsData.value; 1606 1607 if (value.type().kind().value() != TCKind._tk_longlong) { 1608 1609 ApplicationErrorInfoTypeImpl error_code = 1610 new ApplicationErrorInfoTypeImpl(); 1611 1612 error_code.error = new UIDType( 1613 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1614 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1615 1616 error_code.details = new String ("Could not retrieve ifInErrors " + 1617 "for LogicalInterface Object with name " + key + ":" + 1618 " Object with Snmp Object Identifier " + ifInErrorsOid + 1619 " is not of type integer, as expected."); 1620 1621 throw new ApplicationError (error_code); 1622 1623 } 1624 1625 long ifInErrors = value.extract_longlong(); 1626 1627 return ifInErrors; 1628 } 1629 1635 public long 1636 ifInUnknownProtosGet(org.omg.CosNaming.NameComponent [] name) 1637 throws intt.itu.itut_x780.ApplicationError, ist.coach.coachEmsMib.NOunknownProtosPackageException 1638 { 1639 String key = Utils.name2string(name); 1643 1644 if (this.elements.containsKey(key) == false) { 1645 ApplicationErrorInfoTypeImpl error_code = 1646 new ApplicationErrorInfoTypeImpl(); 1647 1648 error_code.error = new UIDType( 1649 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1650 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1651 1652 error_code.details = new String ("object with name " + 1653 key + " does not exist."); 1654 1655 throw new ApplicationError(error_code); 1656 } 1657 1658 if (!Utils.packageIsSupported(UNKNOWN_PROTOS_PACKAGE, 1659 packagesGet(name))) { 1660 throw new ist.coach.coachEmsMib.NOunknownProtosPackageException(); 1661 } 1662 1663 LogicalInterfaceDataStructure data = 1664 (LogicalInterfaceDataStructure) this.elements.get(key); 1665 1666 int ifIndex = data.ifIndex; 1667 1668 String ifInUnknownProtosOid = new String (IF_INUNKNOWNPROTOS_OID + "." + ifIndex); 1669 1670 DataType ifInUnknownProtosData = null; 1671 1672 1674 try { 1675 ifInUnknownProtosData = this.connector.get( 1676 ifInUnknownProtosOid, 1677 new String (data.mgmtIpAddress), 1678 data.getSnmpPort(), 1679 READ_COMMUNITY); 1680 } 1681 catch (SnmpApplicationError e) { 1682 1683 ApplicationErrorInfoTypeImpl error_code = 1684 new ApplicationErrorInfoTypeImpl(); 1685 1686 error_code.error = new UIDType( 1687 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1688 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1689 1690 if (e.reason.equals(ExceptionMessages.agent_response_error)) 1691 error_code.details = ExceptionMessages.agent_response_error; 1692 else 1693 error_code.details = new String ("Could not retrieve ifInUnknownProtos " + 1694 "for LogicalInterface Object with name " + key + ":" + 1695 " Object with Snmp Object Identifier " + ifInUnknownProtosOid + 1696 " does not exist."); 1697 throw new ApplicationError (error_code); 1698 } 1699 1700 org.omg.CORBA.Any value = ifInUnknownProtosData.value; 1701 1702 if (value.type().kind().value() != TCKind._tk_longlong) { 1703 1704 ApplicationErrorInfoTypeImpl error_code = 1705 new ApplicationErrorInfoTypeImpl(); 1706 1707 error_code.error = new UIDType( 1708 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1709 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1710 1711 error_code.details = new String ("Could not retrieve ifInUnknownProtos " + 1712 "for LogicalInterface Object with name " + key + ":" + 1713 " Object with Snmp Object Identifier " + ifInUnknownProtosOid + 1714 " is not of type integer, as expected."); 1715 1716 throw new ApplicationError (error_code); 1717 1718 } 1719 1720 long ifInUnknownProtos = value.extract_longlong(); 1721 1722 return ifInUnknownProtos; 1723 } 1724 1730 public long 1731 ifOutOctetsGet(org.omg.CosNaming.NameComponent [] name) 1732 throws intt.itu.itut_x780.ApplicationError 1733 { 1734 String key = Utils.name2string(name); 1738 1739 if (this.elements.containsKey(key) == false) { 1740 ApplicationErrorInfoTypeImpl error_code = 1741 new ApplicationErrorInfoTypeImpl(); 1742 1743 error_code.error = new UIDType( 1744 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1745 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1746 1747 error_code.details = new String ("object with name " + 1748 key + " does not exist."); 1749 1750 throw new ApplicationError(error_code); 1751 } 1752 1753 LogicalInterfaceDataStructure data = 1754 (LogicalInterfaceDataStructure) this.elements.get(key); 1755 1756 int ifIndex = data.ifIndex; 1757 1758 String ifOutOctetsOid = new String (IF_OUTOCTETS_OID + "." + ifIndex); 1759 1760 DataType ifOutOctetsData = null; 1761 1762 1764 try { 1765 ifOutOctetsData = this.connector.get( 1766 ifOutOctetsOid, 1767 new String (data.mgmtIpAddress), 1768 data.getSnmpPort(), 1769 READ_COMMUNITY); 1770 } 1771 catch (SnmpApplicationError e) { 1772 1773 ApplicationErrorInfoTypeImpl error_code = 1774 new ApplicationErrorInfoTypeImpl(); 1775 1776 error_code.error = new UIDType( 1777 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1778 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1779 1780 if (e.reason.equals(ExceptionMessages.agent_response_error)) 1781 error_code.details = ExceptionMessages.agent_response_error; 1782 else 1783 error_code.details = new String ("Could not retrieve ifOutOctets " + 1784 "for LogicalInterface Object with name " + key + ":" + 1785 " Object with Snmp Object Identifier " + ifOutOctetsOid + 1786 " does not exist."); 1787 throw new ApplicationError (error_code); 1788 } 1789 1790 org.omg.CORBA.Any value = ifOutOctetsData.value; 1791 1792 if (value.type().kind().value() != TCKind._tk_longlong) { 1793 1794 ApplicationErrorInfoTypeImpl error_code = 1795 new ApplicationErrorInfoTypeImpl(); 1796 1797 error_code.error = new UIDType( 1798 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1799 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1800 1801 error_code.details = new String ("Could not retrieve ifOutOctets " + 1802 "for LogicalInterface Object with name " + key + ":" + 1803 " Object with Snmp Object Identifier " + ifOutOctetsOid + 1804 " is not of type integer, as expected."); 1805 1806 throw new ApplicationError (error_code); 1807 1808 } 1809 1810 long ifOutOctets = value.extract_longlong(); 1811 1812 return ifOutOctets; 1813 } 1814 1820 public long 1821 ifOutUcastPktsGet(org.omg.CosNaming.NameComponent [] name) 1822 throws intt.itu.itut_x780.ApplicationError 1823 { 1824 String key = Utils.name2string(name); 1828 1829 if (this.elements.containsKey(key) == false) { 1830 ApplicationErrorInfoTypeImpl error_code = 1831 new ApplicationErrorInfoTypeImpl(); 1832 1833 error_code.error = new UIDType( 1834 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1835 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1836 1837 error_code.details = new String ("object with name " + 1838 key + " does not exist."); 1839 1840 throw new ApplicationError(error_code); 1841 } 1842 1843 LogicalInterfaceDataStructure data = 1844 (LogicalInterfaceDataStructure) this.elements.get(key); 1845 1846 int ifIndex = data.ifIndex; 1847 1848 String ifOutUcastPktsOid = new String (IF_OUTUCASTPKTS_OID + "." + ifIndex); 1849 1850 DataType ifOutUcastPktsData = null; 1851 1852 1854 try { 1855 ifOutUcastPktsData = this.connector.get( 1856 ifOutUcastPktsOid, 1857 new String (data.mgmtIpAddress), 1858 data.getSnmpPort(), 1859 READ_COMMUNITY); 1860 } 1861 catch (SnmpApplicationError e) { 1862 1863 ApplicationErrorInfoTypeImpl error_code = 1864 new ApplicationErrorInfoTypeImpl(); 1865 1866 error_code.error = new UIDType( 1867 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1868 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1869 1870 if (e.reason.equals(ExceptionMessages.agent_response_error)) 1871 error_code.details = ExceptionMessages.agent_response_error; 1872 else 1873 error_code.details = new String ("Could not retrieve ifOutUcastPkts " + 1874 "for LogicalInterface Object with name " + key + ":" + 1875 " Object with Snmp Object Identifier " + ifOutUcastPktsOid + 1876 " does not exist."); 1877 throw new ApplicationError (error_code); 1878 } 1879 1880 org.omg.CORBA.Any value = ifOutUcastPktsData.value; 1881 1882 if (value.type().kind().value() != TCKind._tk_longlong) { 1883 1884 ApplicationErrorInfoTypeImpl error_code = 1885 new ApplicationErrorInfoTypeImpl(); 1886 1887 error_code.error = new UIDType( 1888 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1889 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1890 1891 error_code.details = new String ("Could not retrieve ifOutUcastPkts " + 1892 "for LogicalInterface Object with name " + key + ":" + 1893 " Object with Snmp Object Identifier " + ifOutUcastPktsOid + 1894 " is not of type integer, as expected."); 1895 1896 throw new ApplicationError (error_code); 1897 1898 } 1899 1900 long ifOutUcastPkts = value.extract_longlong(); 1901 1902 return ifOutUcastPkts; 1903 } 1904 1910 public long 1911 ifOutNUcastPktsGet(org.omg.CosNaming.NameComponent [] name) 1912 throws intt.itu.itut_x780.ApplicationError, ist.coach.coachEmsMib.NOnonUcastPackageException 1913 { 1914 String key = Utils.name2string(name); 1918 1919 if (this.elements.containsKey(key) == false) { 1920 ApplicationErrorInfoTypeImpl error_code = 1921 new ApplicationErrorInfoTypeImpl(); 1922 1923 error_code.error = new UIDType( 1924 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1925 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1926 1927 error_code.details = new String ("object with name " + 1928 key + " does not exist."); 1929 1930 throw new ApplicationError(error_code); 1931 } 1932 1933 if (!Utils.packageIsSupported(NON_UCAST_PACKAGE, 1934 packagesGet(name))) { 1935 throw new ist.coach.coachEmsMib.NOnonUcastPackageException(); 1936 } 1937 1938 LogicalInterfaceDataStructure data = 1939 (LogicalInterfaceDataStructure) this.elements.get(key); 1940 1941 int ifIndex = data.ifIndex; 1942 1943 String ifOutNUcastPktsOid = new String (IF_OUTNUCASTPKTS_OID + "." + ifIndex); 1944 1945 DataType ifOutNUcastPktsData = null; 1946 1947 1949 try { 1950 ifOutNUcastPktsData = this.connector.get( 1951 ifOutNUcastPktsOid, 1952 new String (data.mgmtIpAddress), 1953 data.getSnmpPort(), 1954 READ_COMMUNITY); 1955 } 1956 catch (SnmpApplicationError e) { 1957 1958 ApplicationErrorInfoTypeImpl error_code = 1959 new ApplicationErrorInfoTypeImpl(); 1960 1961 error_code.error = new UIDType( 1962 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1963 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1964 1965 if (e.reason.equals(ExceptionMessages.agent_response_error)) 1966 error_code.details = ExceptionMessages.agent_response_error; 1967 else 1968 error_code.details = new String ("Could not retrieve ifOutNUcastPkts " + 1969 "for LogicalInterface Object with name " + key + ":" + 1970 " Object with Snmp Object Identifier " + ifOutNUcastPktsOid + 1971 " does not exist."); 1972 throw new ApplicationError (error_code); 1973 } 1974 1975 org.omg.CORBA.Any value = ifOutNUcastPktsData.value; 1976 1977 if (value.type().kind().value() != TCKind._tk_longlong) { 1978 1979 ApplicationErrorInfoTypeImpl error_code = 1980 new ApplicationErrorInfoTypeImpl(); 1981 1982 error_code.error = new UIDType( 1983 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1984 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1985 1986 error_code.details = new String ("Could not retrieve ifOutNUcastPkts " + 1987 "for LogicalInterface Object with name " + key + ":" + 1988 " Object with Snmp Object Identifier " + ifOutNUcastPktsOid + 1989 " is not of type integer, as expected."); 1990 1991 throw new ApplicationError (error_code); 1992 1993 } 1994 1995 long ifOutNUcastPkts = value.extract_longlong(); 1996 1997 return ifOutNUcastPkts; 1998 } 1999 2005 public long 2006 ifOutDiscardsGet(org.omg.CosNaming.NameComponent [] name) 2007 throws intt.itu.itut_x780.ApplicationError 2008 { 2009 String key = Utils.name2string(name); 2013 2014 if (this.elements.containsKey(key) == false) { 2015 ApplicationErrorInfoTypeImpl error_code = 2016 new ApplicationErrorInfoTypeImpl(); 2017 2018 error_code.error = new UIDType( 2019 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 2020 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 2021 2022 error_code.details = new String ("object with name " + 2023 key + " does not exist."); 2024 2025 throw new ApplicationError(error_code); 2026 } 2027 2028 LogicalInterfaceDataStructure data = 2029 (LogicalInterfaceDataStructure) this.elements.get(key); 2030 2031 int ifIndex = data.ifIndex; 2032 2033 String ifOutDiscardsOid = new String (IF_OUTDISCARDS_OID + "." + ifIndex); 2034 2035 DataType ifOutDiscardsData = null; 2036 2037 2039 try { 2040 ifOutDiscardsData = this.connector.get( 2041 ifOutDiscardsOid, 2042 new String (data.mgmtIpAddress), 2043 data.getSnmpPort(), 2044 READ_COMMUNITY); 2045 } 2046 catch (SnmpApplicationError e) { 2047 2048 ApplicationErrorInfoTypeImpl error_code = 2049 new ApplicationErrorInfoTypeImpl(); 2050 2051 error_code.error = new UIDType( 2052 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 2053 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 2054 2055 if (e.reason.equals(ExceptionMessages.agent_response_error)) 2056 error_code.details = ExceptionMessages.agent_response_error; 2057 else 2058 error_code.details = new String ("Could not retrieve ifOutDiscards " + 2059 "for LogicalInterface Object with name " + key + ":" + 2060 " Object with Snmp Object Identifier " + ifOutDiscardsOid + 2061 " does not exist."); 2062 throw new ApplicationError (error_code); 2063 } 2064 2065 org.omg.CORBA.Any value = ifOutDiscardsData.value; 2066 2067 if (value.type().kind().value() != TCKind._tk_longlong) { 2068 2069 ApplicationErrorInfoTypeImpl error_code = 2070 new ApplicationErrorInfoTypeImpl(); 2071 2072 error_code.error = new UIDType( 2073 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 2074 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 2075 2076 error_code.details = new String ("Could not retrieve ifOutDiscards " + 2077 "for LogicalInterface Object with name " + key + ":" + 2078 " Object with Snmp Object Identifier " + ifOutDiscardsOid + 2079 " is not of type integer, as expected."); 2080 2081 throw new ApplicationError (error_code); 2082 2083 } 2084 2085 long ifOutDiscards = value.extract_longlong(); 2086 2087 return ifOutDiscards; 2088 } 2089 2095 public long 2096 ifOutErrorsGet(org.omg.CosNaming.NameComponent [] name) 2097 throws intt.itu.itut_x780.ApplicationError 2098 { 2099 String key = Utils.name2string(name); 2103 2104 if (this.elements.containsKey(key) == false) { 2105 ApplicationErrorInfoTypeImpl error_code = 2106 new ApplicationErrorInfoTypeImpl(); 2107 2108 error_code.error = new UIDType( 2109 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 2110 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 2111 2112 error_code.details = new String ("object with name " + 2113 key + " does not exist."); 2114 2115 throw new ApplicationError(error_code); 2116 } 2117 2118 LogicalInterfaceDataStructure data = 2119 (LogicalInterfaceDataStructure) this.elements.get(key); 2120 2121 int ifIndex = data.ifIndex; 2122 2123 String ifOutErrorsOid = new String (IF_OUTERRORS_OID + "." + ifIndex); 2124 2125 DataType ifOutErrorsData = null; 2126 2127 2129 try { 2130 ifOutErrorsData = this.connector.get( 2131 ifOutErrorsOid, 2132 new String (data.mgmtIpAddress), 2133 data.getSnmpPort(), 2134 READ_COMMUNITY); 2135 } 2136 catch (SnmpApplicationError e) { 2137 2138 ApplicationErrorInfoTypeImpl error_code = 2139 new ApplicationErrorInfoTypeImpl(); 2140 2141 error_code.error = new UIDType( 2142 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 2143 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 2144 2145 if (e.reason.equals(ExceptionMessages.agent_response_error)) 2146 error_code.details = ExceptionMessages.agent_response_error; 2147 else 2148 error_code.details = new String ("Could not retrieve ifOutErrors " + 2149 "for LogicalInterface Object with name " + key + ":" + 2150 " Object with Snmp Object Identifier " + ifOutErrorsOid + 2151 " does not exist."); 2152 throw new ApplicationError (error_code); 2153 } 2154 2155 org.omg.CORBA.Any value = ifOutErrorsData.value; 2156 2157 if (value.type().kind().value() != TCKind._tk_longlong) { 2158 2159 ApplicationErrorInfoTypeImpl error_code = 2160 new ApplicationErrorInfoTypeImpl(); 2161 2162 error_code.error = new UIDType( 2163 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 2164 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 2165 2166 error_code.details = new String ("Could not retrieve ifOutErrors " + 2167 "for LogicalInterface Object with name " + key + ":" + 2168 " Object with Snmp Object Identifier " + ifOutErrorsOid + 2169 " is not of type integer, as expected."); 2170 2171 throw new ApplicationError (error_code); 2172 2173 } 2174 2175 long ifOutErrors = value.extract_longlong(); 2176 2177 return ifOutErrors; 2178 } 2179 2185 public long 2186 ifOutQLenGet(org.omg.CosNaming.NameComponent [] name) 2187 throws intt.itu.itut_x780.ApplicationError 2188 { 2189 String key = Utils.name2string(name); 2193 2194 if (this.elements.containsKey(key) == false) { 2195 ApplicationErrorInfoTypeImpl error_code = 2196 new ApplicationErrorInfoTypeImpl(); 2197 2198 error_code.error = new UIDType( 2199 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 2200 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 2201 2202 error_code.details = new String ("object with name " + 2203 key + " does not exist."); 2204 2205 throw new ApplicationError(error_code); 2206 } 2207 2208 LogicalInterfaceDataStructure data = 2209 (LogicalInterfaceDataStructure) this.elements.get(key); 2210 2211 int ifIndex = data.ifIndex; 2212 2213 String ifOutQLenOid = new String (IF_OUTQLEN_OID + "." + ifIndex); 2214 2215 DataType ifOutQLenData = null; 2216 2217 2219 try { 2220 ifOutQLenData = this.connector.get( 2221 ifOutQLenOid, 2222 new String (data.mgmtIpAddress), 2223 data.getSnmpPort(), 2224 READ_COMMUNITY); 2225 } 2226 catch (SnmpApplicationError e) { 2227 2228 ApplicationErrorInfoTypeImpl error_code = 2229 new ApplicationErrorInfoTypeImpl(); 2230 2231 error_code.error = new UIDType( 2232 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 2233 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 2234 2235 if (e.reason.equals(ExceptionMessages.agent_response_error)) 2236 error_code.details = ExceptionMessages.agent_response_error; 2237 else 2238 error_code.details = new String ("Could not retrieve ifOutQLen " + 2239 "for LogicalInterface Object with name " + key + ":" + 2240 " Object with Snmp Object Identifier " + ifOutQLenOid + 2241 " does not exist."); 2242 throw new ApplicationError (error_code); 2243 } 2244 2245 org.omg.CORBA.Any value = ifOutQLenData.value; 2246 2247 if (value.type().kind().value() != TCKind._tk_longlong) { 2248 2249 ApplicationErrorInfoTypeImpl error_code = 2250 new ApplicationErrorInfoTypeImpl(); 2251 2252 error_code.error = new UIDType( 2253 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 2254 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 2255 2256 error_code.details = new String ("Could not retrieve ifOutQLen " + 2257 "for LogicalInterface Object with name " + key + ":" + 2258 " Object with Snmp Object Identifier " + ifOutQLenOid + 2259 " is not of type integer, as expected."); 2260 2261 throw new ApplicationError (error_code); 2262 2263 } 2264 2265 long ifOutQLen = value.extract_longlong(); 2266 2267 return ifOutQLen; 2268 } 2269 2275 public java.lang.String 2276 ifSpecificGet(org.omg.CosNaming.NameComponent [] name) 2277 throws intt.itu.itut_x780.ApplicationError 2278 { 2279 String key = Utils.name2string(name); 2283 2284 if (this.elements.containsKey(key) == false) { 2285 ApplicationErrorInfoTypeImpl error_code = 2286 new ApplicationErrorInfoTypeImpl(); 2287 2288 error_code.error = new UIDType( 2289 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 2290 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 2291 2292 error_code.details = new String ("object with name " + 2293 key + " does not exist."); 2294 2295 throw new ApplicationError(error_code); 2296 } 2297 2298 LogicalInterfaceDataStructure data = 2299 (LogicalInterfaceDataStructure) this.elements.get(key); 2300 2301 int ifIndex = data.ifIndex; 2302 2303 String ifSpecificOid = new String (IF_SPECIFIC_OID + "." + ifIndex); 2304 2305 DataType ifSpecificData = null; 2306 2307 2309 try { 2310 ifSpecificData = this.connector.get( 2311 ifSpecificOid, 2312 new String (data.mgmtIpAddress), 2313 data.getSnmpPort(), 2314 READ_COMMUNITY); 2315 } 2316 catch (SnmpApplicationError e) { 2317 2318 ApplicationErrorInfoTypeImpl error_code = 2319 new ApplicationErrorInfoTypeImpl(); 2320 2321 error_code.error = new UIDType( 2322 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 2323 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 2324 2325 if (e.reason.equals(ExceptionMessages.agent_response_error)) 2326 error_code.details = ExceptionMessages.agent_response_error; 2327 else 2328 error_code.details = new String ("Could not retrieve ifSpecific " + 2329 "for LogicalInterface Object with name " + key + ":" + 2330 " Object with Snmp Object Identifier " + ifSpecificOid + 2331 " does not exist."); 2332 throw new ApplicationError (error_code); 2333 } 2334 2335 org.omg.CORBA.Any value = ifSpecificData.value; 2336 2337 if (value.type().kind().value() != TCKind._tk_string) { 2338 2339 ApplicationErrorInfoTypeImpl error_code = 2340 new ApplicationErrorInfoTypeImpl(); 2341 2342 error_code.error = new UIDType( 2343 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 2344 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 2345 2346 error_code.details = new String ("Could not retrieve ifSpecific " + 2347 "for LogicalInterface Object with name " + key + ":" + 2348 " Object with Snmp Object Identifier " + ifSpecificOid + 2349 " is not of type string, as expected."); 2350 2351 throw new ApplicationError (error_code); 2352 2353 } 2354 2355 String ifSpecific = value.extract_string(); 2356 2357 return ifSpecific; 2358 } 2359 2365 public org.omg.CosNaming.NameComponent [][] 2366 supportedByObjectListGet(org.omg.CosNaming.NameComponent [] name) 2367 throws intt.itu.itut_x780.ApplicationError 2368 { 2369 String key = Utils.name2string(name); 2373 2374 if (this.elements.containsKey(key) == false) { 2375 ApplicationErrorInfoTypeImpl error_code = 2376 new ApplicationErrorInfoTypeImpl(); 2377 2378 error_code.error = new UIDType( 2379 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 2380 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 2381 2382 error_code.details = new String ("object with name " + 2383 key + " does not exist."); 2384 2385 throw new ApplicationError(error_code); 2386 } 2387 2388 return new org.omg.CosNaming.NameComponent [0][0]; 2389 2390 } 2391 2397 public intt.itu.itut_x780.OperationalStateType 2398 operationalStateGet(org.omg.CosNaming.NameComponent [] name) 2399 throws intt.itu.itut_x780.ApplicationError, intt.itu.itut_m3120.NOoperationalStatePackageException 2400 { 2401 2405 String key = Utils.name2string(name); 2406 2407 if (this.elements.containsKey(key) == false) { 2408 ApplicationErrorInfoTypeImpl error_code = 2409 new ApplicationErrorInfoTypeImpl(); 2410 2411 error_code.error = new UIDType( 2412 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 2413 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 2414 2415 error_code.details = new String ("object with name " + 2416 key + " does not exist."); 2417 2418 throw new ApplicationError(error_code); 2419 } 2420 2421 if (!Utils.packageIsSupported(OPERATIONAL_STATE_PACKAGE, 2422 packagesGet(name))) { 2423 throw new intt.itu.itut_m3120.NOoperationalStatePackageException(); 2424 } 2425 2426 LogicalInterfaceDataStructure data = 2427 (LogicalInterfaceDataStructure) this.elements.get(key); 2428 2429 int ifIndex = data.ifIndex; 2430 2431 String ifOperStatusOid = new String (IF_OPERSTATUS_OID + "." + ifIndex); 2432 2433 DataType ifOperStatusData = null; 2434 2435 2437 try { 2438 ifOperStatusData = this.connector.get( 2439 ifOperStatusOid, 2440 new String (data.mgmtIpAddress), 2441 data.getSnmpPort(), 2442 READ_COMMUNITY); 2443 } 2444 catch (SnmpApplicationError e) { 2445 2446 ApplicationErrorInfoTypeImpl error_code = 2447 new ApplicationErrorInfoTypeImpl(); 2448 2449 error_code.error = new UIDType( 2450 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 2451 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 2452 2453 if (e.reason.equals(ExceptionMessages.agent_response_error)) 2454 error_code.details = ExceptionMessages.agent_response_error; 2455 else 2456 error_code.details = new String ("Could not retrieve Operational State " + 2457 "for LogicalInterface Object with name " + key + ":" + 2458 " Object with Snmp Object Identifier " + ifOperStatusOid + 2459 " does not exist."); 2460 throw new ApplicationError (error_code); 2461 } 2462 2463 org.omg.CORBA.Any value = ifOperStatusData.value; 2464 2465 if (value.type().kind().value() != TCKind._tk_long) { 2466 2467 ApplicationErrorInfoTypeImpl error_code = 2468 new ApplicationErrorInfoTypeImpl(); 2469 2470 error_code.error = new UIDType( 2471 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 2472 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 2473 2474 error_code.details = new String ("Could not retrieve Operational State " + 2475 "for LogicalInterface Object with name " + key + ":" + 2476 " Object with Snmp Object Identifier " + ifOperStatusOid + 2477 " is not of type integer, as expected."); 2478 2479 throw new ApplicationError (error_code); 2480 2481 } 2482 2483 int ifOperStatusInt = value.extract_long(); 2484 OperationalStateType operationalState = null; 2485 2486 if (ifOperStatusInt == LogicalInterface_F.up || 2487 ifOperStatusInt == LogicalInterface_F.testing) 2488 operationalState = OperationalStateType.enabled; 2489 else 2490 operationalState = OperationalStateType.disabled; 2491 2492 return operationalState; 2493 } 2494 2500 public org.omg.CosNaming.NameComponent [] 2501 nameGet() 2502 { 2503 return Utils.string2name(_facade_name); 2507 } 2508 2514 public java.lang.String 2515 objectClassGet(org.omg.CosNaming.NameComponent [] name) 2516 throws intt.itu.itut_x780.ApplicationError 2517 { 2518 2522 String key = Utils.name2string(name); 2523 2524 if (this.elements.containsKey(key) == false) { 2525 ApplicationErrorInfoTypeImpl error_code = 2526 new ApplicationErrorInfoTypeImpl(); 2527 2528 error_code.error = new UIDType( 2529 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 2530 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 2531 2532 error_code.details = new String ("object with name " + 2533 key + " does not exist."); 2534 2535 throw new ApplicationError(error_code); 2536 } 2537 2538 LogicalInterfaceDataStructure data = 2539 (LogicalInterfaceDataStructure) this.elements.get(key); 2540 2541 return data.objectclass; 2542 } 2543 2544 2550 public intt.itu.itut_x780.ManagedObjectValueType 2551 attributesGet(org.omg.CosNaming.NameComponent [] name, intt.itu.itut_x780.StringSetTypeHolder attributeNames) 2552 throws intt.itu.itut_x780.ApplicationError 2553 { 2554 2558 String key = Utils.name2string(name); 2559 2560 if (this.elements.containsKey(key) == false) { 2561 ApplicationErrorInfoTypeImpl error_code = 2562 new ApplicationErrorInfoTypeImpl(); 2563 2564 error_code.error = new UIDType( 2565 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 2566 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 2567 2568 error_code.details = new String ("object with name " + 2569 key + " does not exist."); 2570 2571 throw new ApplicationError(error_code); 2572 } 2573 2574 LogicalInterfaceDataStructure data = 2575 (LogicalInterfaceDataStructure) this.elements.get(key); 2576 2577 long ifLastChange = -1; 2578 OperationalStateType operationalState = OperationalStateType.enabled; 2579 long ifInNUcastPkts = -1; 2580 long ifOutNUcastPkts = -1; 2581 long ifInUnknownProtos = -1; 2582 2583 try { 2584 ifInNUcastPkts = this.ifInNUcastPktsGet(name); 2585 } 2586 catch (ist.coach.coachEmsMib.NOnonUcastPackageException nonUcastPackage) { 2587 } 2588 2589 try { 2590 ifOutNUcastPkts = this.ifOutNUcastPktsGet(name); 2591 } 2592 catch (ist.coach.coachEmsMib.NOnonUcastPackageException nonUcastPackage) { 2593 } 2594 2595 try { 2596 ifInUnknownProtos = this.ifInUnknownProtosGet(name); 2597 } 2598 catch (ist.coach.coachEmsMib.NOunknownProtosPackageException unknownProtosPackage) { 2599 } 2600 2601 try { 2602 ifLastChange = ifLastChangeGet(name); 2603 } 2604 catch (ist.coach.coachEmsMib.NOifLastChangePackageException noIfLastChange) { 2605 System.err.println("ifLastChangePackage is not supported!"); 2606 System.err.println("Keeping value of " + ifLastChange + " for ifLastChange"); 2607 } 2608 2609 try { 2610 operationalState = operationalStateGet(name); 2611 } 2612 catch (intt.itu.itut_m3120.NOoperationalStatePackageException noOperationalState) { 2613 } 2614 2615 LogicalInterfaceValueTypeImpl logicalInterfaceValueType = 2616 new LogicalInterfaceValueTypeImpl( 2617 2618 supportedByObjectListGet(name), 2619 operationalState, 2620 2621 data.ifIndex, 2622 this.ifDescrGet(name), 2623 this.ifTypeGet(name), 2624 this.ifMtuGet(name), 2625 this.ifSpeedGet(name), 2626 this.ifPhysAddressGet(name), 2627 this.ifAdminStatusGet(name), 2628 ifLastChange, 2629 this.ifInOctetsGet(name), 2630 this.ifInUcastPktsGet(name), 2631 ifInNUcastPkts, 2632 this.ifInErrorsGet(name), 2633 ifInUnknownProtos, 2634 this.ifOutOctetsGet(name), 2635 this.ifOutUcastPktsGet(name), 2636 ifOutNUcastPkts, 2637 this.ifOutDiscardsGet(name), 2638 this.ifOutErrorsGet(name), 2639 this.ifOutQLenGet(name), 2640 this.ifSpecificGet(name), 2641 2642 data.name, 2643 data.objectclass, 2644 data.packages, 2645 data.sourceIndicator, 2646 data.deletePolicy 2647 ); 2648 2649 return logicalInterfaceValueType; 2650 2651 } 2652 2658 public java.lang.String [] 2659 packagesGet(org.omg.CosNaming.NameComponent [] name) 2660 throws intt.itu.itut_x780.ApplicationError 2661 { 2662 2666 String key = Utils.name2string(name); 2667 2668 if (this.elements.containsKey(key) == false) { 2669 ApplicationErrorInfoTypeImpl error_code = 2670 new ApplicationErrorInfoTypeImpl(); 2671 2672 error_code.error = new UIDType( 2673 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 2674 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 2675 2676 error_code.details = new String ("object with name " + 2677 key + " does not exist."); 2678 2679 throw new ApplicationError(error_code); 2680 } 2681 2682 LogicalInterfaceDataStructure data = 2683 (LogicalInterfaceDataStructure) this.elements.get(key); 2684 2685 return data.packages; 2686 } 2687 2693 public intt.itu.itut_x780.SourceIndicatorType 2694 creationSourceGet(org.omg.CosNaming.NameComponent [] name) 2695 throws intt.itu.itut_x780.ApplicationError 2696 { 2697 String key = Utils.name2string(name); 2701 2702 if (this.elements.containsKey(key) == false) { 2703 ApplicationErrorInfoTypeImpl error_code = 2704 new ApplicationErrorInfoTypeImpl(); 2705 2706 error_code.error = new UIDType( 2707 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 2708 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 2709 2710 error_code.details = new String ("object with name " + 2711 key + " does not exist."); 2712 2713 throw new ApplicationError(error_code); 2714 } 2715 2716 LogicalInterfaceDataStructure data = 2717 (LogicalInterfaceDataStructure) this.elements.get(key); 2718 2719 return data.sourceIndicator; 2720 } 2721 2727 public short 2728 deletePolicyGet(org.omg.CosNaming.NameComponent [] name) 2729 throws intt.itu.itut_x780.ApplicationError 2730 { 2731 2735 String key = Utils.name2string(name); 2736 2737 if (this.elements.containsKey(key) == false) { 2738 ApplicationErrorInfoTypeImpl error_code = 2739 new ApplicationErrorInfoTypeImpl(); 2740 2741 error_code.error = new UIDType( 2742 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 2743 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 2744 2745 error_code.details = new String ("object with name " + 2746 key + " does not exist."); 2747 2748 throw new ApplicationError(error_code); 2749 } 2750 2751 LogicalInterfaceDataStructure data = 2752 (LogicalInterfaceDataStructure) this.elements.get(key); 2753 2754 return data.deletePolicy; 2755 } 2756 2762 public void 2763 destroy(org.omg.CosNaming.NameComponent [] name) 2764 throws intt.itu.itut_x780.ApplicationError, intt.itu.itut_x780.DeleteError 2765 { 2766 2770 if (!this.elements.containsKey(Utils.name2string(name))) { 2771 2772 ApplicationErrorInfoTypeImpl error_code = 2773 new ApplicationErrorInfoTypeImpl(); 2774 2775 error_code.error = new UIDType( 2776 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 2777 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 2778 2779 error_code.details = new String ("object with name " + 2780 Utils.name2string(name) + " does not exist."); 2781 2782 throw new ApplicationError(error_code); 2783 2784 } 2785 2786 LogicalInterfaceDataStructure logicalInterfaceData = 2787 (LogicalInterfaceDataStructure) this.elements.remove( 2788 Utils.name2string(name)); 2789 2790 try { 2791 config.unregister(name); 2792 } 2793 catch (ist.coach.coachEmfServices.SnmpAdapter.SnmpApplicationError snmp_e) { 2794 System.err.println("There was a problem unregistering " + Utils.name2string(name) + 2795 "from the SNMP Trap Daemon"); 2796 } 2797 2798 org.omg.TimeBase.UtcT eventTime = new org.omg.TimeBase.UtcT(System.currentTimeMillis(), 2799 0, (short) 0, (short) 0); 2800 the_context_.push_objectDeletion(new ObjectDeletionImpl(eventTime, name, 2801 logicalInterfaceData.objectclass, 2802 getUniqueNotificationIdentifier(), 2803 logicalInterfaceData.sourceIndicator, 2805 new AttributeValueType[0])); 2806 } 2807 2818 public void 2819 create( 2820 org.omg.CosNaming.NameComponent [] name, 2821 String objectClass, 2822 java.lang.String [] packages, 2823 short deletePolicy, 2824 intt.itu.itut_x780.SourceIndicatorType sourceIndicator, 2825 org.omg.CosNaming.NameComponent [] superior, 2826 int ifIndex, 2827 byte [] mgmtIpAddress, 2828 int snmpPort, 2829 int supportedSnmpVersions, 2830 String ifDescr) 2831 2832 throws intt.itu.itut_x780.ApplicationError, intt.itu.itut_x780.CreateError 2833 { 2834 2838 if (this.elements.containsKey(Utils.name2string(name))) { 2839 2840 CreateErrorInfoTypeImpl errorCode = 2841 new CreateErrorInfoTypeImpl(); 2842 2843 errorCode.error = new UIDType( 2844 intt.itu.itut_x780.CreateErrorConst.moduleName.value, 2845 intt.itu.itut_x780.CreateErrorConst.duplicateName.value); 2846 2847 errorCode.details = new String (Utils.name2string(name) + 2848 " object already exists."); 2849 throw new intt.itu.itut_x780.CreateError(errorCode); 2850 } 2851 2852 2853 LogicalInterfaceDataStructure logicalInterfaceData = 2854 new LogicalInterfaceDataStructure( 2855 ifIndex, 2856 name, 2857 objectClass, 2858 packages, 2859 sourceIndicator, 2860 deletePolicy, 2861 new String (mgmtIpAddress), 2862 snmpPort, 2863 supportedSnmpVersions, 2864 ifDescr); 2865 2866 this.elements.put(Utils.name2string(name), logicalInterfaceData); 2867 System.err.println("LogicalInterfaceProvider setting data FINISHED...!"); 2868 2869 try { 2872 org.omg.CORBA.Any ifDescrAny = orb.create_any(); 2873 System.err.println("LogicalInterfaceProvider setting any data for " + ifDescr); 2874 org.omg.CORBA.OctetSeqHelper.insert(ifDescrAny, ifDescr.getBytes()); 2875 2876 System.err.println("Trying to register interface with description " + 2877 Utils.name2string(name)); 2878 config.registerValue(name, new String (mgmtIpAddress), ifDescrAny); 2879 } 2880 catch (ist.coach.coachEmfServices.SnmpAdapter.SnmpApplicationError snmp_ex) { 2881 2882 System.err.println("Could not register LogicalInterface " + 2883 Utils.name2string(name) + " to the SNMP Trap Service"); 2884 System.err.println("Reason = " + snmp_ex.reason); 2885 2886 ApplicationErrorInfoTypeImpl error_code = new ApplicationErrorInfoTypeImpl(); 2887 2888 error_code.error = new UIDType( 2889 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 2890 intt.itu.itut_x780.ApplicationErrorConst.downstreamError.value); 2891 2892 error_code.details = snmp_ex.reason; 2893 2894 throw new ApplicationError(error_code); 2895 } 2896 catch(Exception e) { 2897 System.err.println("LogicalInterfaceProvider Exception caught: " + e.getMessage()); 2898 e.printStackTrace(); 2899 } 2900 2901 org.omg.TimeBase.UtcT eventTime = new org.omg.TimeBase.UtcT (System.currentTimeMillis(), 2902 0, (short) 0, (short) 0); 2903 the_context_.push_objectCreation(new ObjectCreationImpl(eventTime, 2904 name, 2905 objectClass, 2906 getUniqueNotificationIdentifier(), 2907 sourceIndicator, 2909 new AttributeValueType[0])); 2910 2911 } 2912 2923 public void 2924 notifyTrap(org.omg.CosNaming.NameComponent [] name, 2925 java.lang.String community, 2926 int trapID, 2927 int trapType, 2928 ist.coach.coachEmfServices.SnmpAdapter.DataType[] trapData) 2929 throws intt.itu.itut_x780.ApplicationError, ist.coach.coachEmfServices.SnmpAdapter.SnmpApplicationError 2930 { 2931 2935 String key = Utils.name2string(name); 2936 2937 if (this.elements.containsKey(Utils.name2string(name)) == false) { 2938 2939 ApplicationErrorInfoTypeImpl errorCode = 2940 new ApplicationErrorInfoTypeImpl(); 2941 2942 errorCode.error = new UIDType( 2943 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 2944 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 2945 2946 errorCode.details = new String ("object with name " + 2947 key + " does not exists."); 2948 2949 System.err.println("Object with name " + key + " does not exist!"); 2950 2951 throw new intt.itu.itut_x780.ApplicationError(errorCode); 2952 } 2953 2954 LogicalInterfaceDataStructure data = 2955 (LogicalInterfaceDataStructure) this.elements.get(key); 2956 2957 intt.itu.itut_x780.OperationalStateType newValue = null; 2958 intt.itu.itut_x780.OperationalStateType oldValue = null; 2959 2960 if (trapType == COACH_LINK_UP) { 2961 newValue = intt.itu.itut_x780.OperationalStateType.enabled; 2962 oldValue = intt.itu.itut_x780.OperationalStateType.disabled; 2963 } 2964 else 2965 if (trapType == COACH_LINK_DOWN) { 2966 newValue = intt.itu.itut_x780.OperationalStateType.disabled; 2967 oldValue = intt.itu.itut_x780.OperationalStateType.enabled; 2968 } 2969 else { 2970 System.err.println("LogicalInterface_F down not know how to handle trap of type " + 2971 trapType); 2972 2973 ApplicationErrorInfoTypeImpl error_code = 2974 new ApplicationErrorInfoTypeImpl(); 2975 2976 error_code.error = new UIDType( 2977 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 2978 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 2979 error_code.details = new String ("LogicalInterface_F does not know how to handle trap of type " + trapType + "."); 2980 2981 throw new ApplicationError(error_code); 2982 } 2983 2984 long trapTime = 0; 2985 boolean trapTimeFound = false; 2986 2987 for (int i = 0; i < trapData.length; i++) { 2988 if (trapData[i].identifier.equals(TIME_OID)) { 2989 System.err.println("Found Time..."); 2990 org.omg.CORBA.Any value = trapData[i].value; 2991 2992 if (value.type().kind().value() != TCKind._tk_longlong) { 2993 2994 ApplicationErrorInfoTypeImpl error_code = 2995 new ApplicationErrorInfoTypeImpl(); 2996 2997 error_code.error = new UIDType( 2998 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 2999 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 3000 3001 3002 error_code.details = new String ("Could not retrieve event time " + 3003 "for trap. Object with Snmp Object Identifier " + TIME_OID + 3004 " is not of type long, as expected."); 3005 3006 System.err.println("Event time is not of type long, as expected..."); 3007 3008 throw new ApplicationError(error_code); 3009 } 3010 3011 trapTime = value.extract_longlong(); 3012 trapTimeFound = true; 3013 break; 3014 } 3015 } 3016 3017 if (trapTimeFound == false) { 3018 3019 System.err.println("Trap Time could not be determined. No such VarBinding"); 3020 3021 ApplicationErrorInfoTypeImpl error_code = 3022 new ApplicationErrorInfoTypeImpl(); 3023 3024 error_code.error = new UIDType( 3025 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 3026 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 3027 3028 error_code.details = new String ("Could not retrieve event time " + 3029 "for trap."); 3030 3031 throw new ApplicationError(error_code); 3032 } 3033 3034 org.omg.TimeBase.UtcT eventTime = new org.omg.TimeBase.UtcT(System.currentTimeMillis(), 3036 0,(short) 0,(short) 0); 3037 3038 3039 int notificationId = getUniqueNotificationIdentifier(); 3041 3042 String sourceClass = data.objectclass; 3043 3044 SourceIndicatorType sourceIndicator = SourceIndicatorType.unknown; 3045 3046 org.omg.CORBA.Any oldValue_any = orb.create_any(); 3047 OperationalStateTypeHelper.insert(oldValue_any, oldValue); 3048 3049 org.omg.CORBA.Any newValue_any = orb.create_any(); 3050 OperationalStateTypeHelper.insert(newValue_any, newValue); 3051 3052 AttributeValueChangeType [] changedValues = new AttributeValueChangeType[1]; 3053 3054 changedValues[0] = new AttributeValueChangeType( 3055 "operationalState", 3056 oldValue_any, 3057 newValue_any); 3058 3059 StateChangedEventImpl stateChangedEvent = new StateChangedEventImpl( 3060 eventTime, 3061 name, 3062 sourceClass, 3063 notificationId, 3064 sourceIndicator, 3065 changedValues); 3066 3067 System.err.println("LogicalInterfaceProvider> Before pushing StateChange event with identifier " + 3068 stateChangedEvent.notificationIdentifier + " for " + 3069 Utils.name2string(stateChangedEvent.source) + " of objectclass " + 3070 stateChangedEvent.sourceClass + " generated after SNMP agent " + 3071 "has been up for " + stateChangedEvent.eventTime.time + 3072 " caused by an action of type " + sourceIndicator + "."); 3073 3074 the_context_.push_stateChange(stateChangedEvent); 3075 3076 } 3077 3078 private int getUniqueNotificationIdentifier() { 3079 3080 notifId++; 3081 3082 return (notifId); 3083 } 3084 3085 class LogicalInterfaceDataStructure { 3086 3087 public int ifIndex; 3088 public NameComponent [] name; 3089 public String objectclass; 3090 public String [] packages; 3091 public SourceIndicatorType sourceIndicator; 3092 public short deletePolicy; 3093 3095 private int notificationIdentifier; 3096 private String mgmtIpAddress; 3097 private int snmpPort; 3098 private int supportedSnmpVersions; 3099 private String ifDescr; 3100 3101 public LogicalInterfaceDataStructure() {} 3102 3103 public LogicalInterfaceDataStructure( 3104 int ifIndex, 3105 NameComponent [] name, 3106 String objectclass, 3107 String [] packages, 3108 SourceIndicatorType sourceIndicator, 3109 short deletePolicy, 3110 String mgmtIpAddress, 3112 int snmpPort, 3113 int supportedSnmpVersions, 3114 String ifDescr) { 3115 3116 this.ifIndex = ifIndex; 3117 this.name = name; 3118 this.objectclass = objectclass; 3119 this.packages = packages; 3120 this.sourceIndicator = sourceIndicator; 3121 this.deletePolicy = deletePolicy; 3122 this.notificationIdentifier = 0; 3124 this.mgmtIpAddress = mgmtIpAddress; 3125 this.snmpPort = snmpPort; 3126 this.supportedSnmpVersions = supportedSnmpVersions; 3127 this.ifDescr = ifDescr; 3128 } 3129 3130 public int getUniqueNotificationIdentifier() { 3131 3132 this.notificationIdentifier++; 3133 3134 return (this.notificationIdentifier); 3135 } 3136 3137 public String getMgmtIpAddress() { 3138 return mgmtIpAddress; 3139 } 3140 3141 public int getSnmpPort() { 3142 return snmpPort; 3143 } 3144 3145 public int getSupportedSnmpVersions() { 3146 return supportedSnmpVersions; 3147 } 3148 3149 public String getIfDescr() { 3150 return ifDescr; 3151 } 3152 } 3153} 3154 | Popular Tags |