1 21 package ist.coach.coachEmsMibComponents; 22 23 import intt.itu.itut_x780.UIDType; 24 import intt.itu.itut_x780.CreateError; 25 import intt.itu.itut_x780.ApplicationError; 26 import intt.itu.itut_x780.SourceIndicatorType; 27 import intt.itu.itut_x780.AttributeValueType; 28 29 import ist.coach.coachEmfCommon.Utils; 30 import ist.coach.coachEmfCommon.ObjectCreationImpl; 31 import ist.coach.coachEmfCommon.ObjectDeletionImpl; 32 import ist.coach.coachEmfCommon.ExceptionMessages; 33 import ist.coach.coachEmfCommon.CreateErrorInfoTypeImpl; 34 import ist.coach.coachEmfCommon.ApplicationErrorInfoTypeImpl; 35 import ist.coach.coachEmfCommon.DataTypeImpl; 36 import ist.coach.coachEmfServices.SnmpAdapter.DataType; 37 import ist.coach.coachEmfServices.SnmpAdapter.SnmpApplicationError; 38 39 import ist.coach.coachEmsMib.IpProtocolMonitorValueType; 40 import ist.coach.coachEmsMib.IpProtocolMonitor_F; 41 import ist.coach.coachEmsMibComponents.IpProtocolMonitorProviderHelper; 42 43 import ist.coach.coachEmsCommon.IpProtocolMonitorValueTypeImpl; 44 import org.omg.CosNaming.NameComponent ; 45 import org.omg.CORBA.TCKind ; 46 47 import org.opennms.protocols.snmp.SnmpSMI; 48 49 import java.util.Hashtable ; 50 51 55 public class IpProtocolMonitorProviderMonolithicImpl 56 extends org.omg.CORBA.LocalObject 57 implements CCM_IpProtocolMonitorProvider, 58 ist.coach.coachEmsMibComponents.CCM_IpProtocolMonitorMgmt, 59 org.omg.Components.SessionComponent 60 { 61 69 private CCM_IpProtocolMonitorProvider_Context the_context_; 70 71 org.omg.CORBA.ORB orb = null; 72 private String _facade_name; 73 74 private Hashtable elements; 75 private int notifId = 1200; 76 77 ist.coach.coachEmfServices.SnmpAdapter.SnmpConnector connector = null; 78 79 public static final String IP_FWD_TYPE_OID = ".1.3.6.1.2.1.4.1.0"; 80 public static final String IP_DEFAULT_TTL_OID = ".1.3.6.1.2.1.4.2.0"; 81 public static final String IP_INRECEIVE_OID = ".1.3.6.1.2.1.4.3.0"; 82 public static final String IP_INHDRERRORS_OID = ".1.3.6.1.2.1.4.4.0"; 83 public static final String IP_INADDRERRORRS_OID = ".1.3.6.1.2.1.4.5.0"; 84 public static final String IP_FWDDATAGRAMS_OID = ".1.3.6.1.2.1.4.6.0"; 85 public static final String IP_INUNKNOWNPROTO_OID = ".1.3.6.1.2.1.4.7.0"; 86 public static final String IP_INDISCARDS_OID = ".1.3.6.1.2.1.4.8.0"; 87 public static final String IP_INDELIVERS_OID = ".1.3.6.1.2.1.4.9.0"; 88 public static final String IP_OUTREQUESTS_OID = ".1.3.6.1.2.1.4.10.0"; 89 public static final String IP_OUTDISCARDS_OID = ".1.3.6.1.2.1.4.11.0"; 90 public static final String IP_NOROUTE_OID = ".1.3.6.1.2.1.4.12.0"; 91 public static final String IP_REASMTIMEOUT_OID = ".1.3.6.1.2.1.4.13.0"; 92 public static final String IP_REASMREQ_OID = ".1.3.6.1.2.1.4.14.0"; 93 public static final String IP_REASMOK_OID = ".1.3.6.1.2.1.4.15.0"; 94 public static final String IP_REASMFAIL_OID = ".1.3.6.1.2.1.4.16.0"; 95 public static final String IP_FRAGOK_OID = ".1.3.6.1.2.1.4.17.0"; 96 public static final String IP_FRAGFAIL_OID = ".1.3.6.1.2.1.4.18.0"; 97 public static final String IP_FRAGCREATE_OID = ".1.3.6.1.2.1.4.19.0"; 98 public static final String IP_ROUTING_DISCARDS_OID = ".1.3.6.1.2.1.4.23.0"; 99 100 private static final String IP_PROTOCOL_CONFIG_PACKAGE = "ipProtocolConfigurationSetPackage"; 101 102 private static final String READ_COMMUNITY = "public"; 103 private static final String WRITE_COMMUNITY = "private"; 104 105 113 public 114 IpProtocolMonitorProviderMonolithicImpl() 115 { 116 the_context_ = null; 117 118 this.elements = new Hashtable (); 119 } 120 126 137 public CCM_IpProtocolMonitorProvider_Context 138 getContext() 139 { 140 return the_context_; 141 } 142 156 public void 157 configuration_complete() 158 throws org.omg.Components.InvalidConfiguration 159 { 160 164 if ((connector = the_context_.get_connection_connector()) == null) 165 throw new org.omg.Components.InvalidConfiguration(); 166 orb = org.objectweb.ccm.CORBA.TheORB.getORB(); 167 168 System.err.println("IpProtocolMonitorProvider configuration completed..."); 169 170 } 171 187 public void 188 set_session_context(org.omg.Components.SessionContext context) 189 throws org.omg.Components.CCMException 190 { 191 the_context_ = (CCM_IpProtocolMonitorProvider_Context)context; 192 } 193 203 public void 204 ccm_activate() 205 throws org.omg.Components.CCMException 206 { 207 } 211 221 public void 222 ccm_passivate() 223 throws org.omg.Components.CCMException 224 { 225 } 229 239 public void 240 ccm_remove() 241 throws org.omg.Components.CCMException 242 { 243 } 247 258 public ist.coach.coachEmsMibComponents.CCM_IpProtocolMonitorMgmt 259 get_mgmt() 260 { 261 return this; 262 } 263 267 270 public void 271 facade_name(java.lang.String val) 272 { 273 if (val != null) 277 _facade_name = new String (val); 278 279 } 280 286 public int 287 ipForwardingGet(org.omg.CosNaming.NameComponent [] name) 288 throws intt.itu.itut_x780.ApplicationError 289 { 290 294 String key = Utils.name2string(name); 295 296 if (this.elements.containsKey(key) == false) { 297 ApplicationErrorInfoTypeImpl error_code = 298 new ApplicationErrorInfoTypeImpl(); 299 300 error_code.error = new UIDType( 301 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 302 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 303 304 error_code.details = new String ("object with name " + 305 key + " does not exist."); 306 307 throw new ApplicationError(error_code); 308 } 309 310 IpProtocolMonitorDataStructure data = 311 (IpProtocolMonitorDataStructure) this.elements.get(key); 312 313 DataType ipForwaringData = null; 314 315 try { 316 ipForwaringData = this.connector.get( 317 IP_FWD_TYPE_OID, 318 new String (data.mgmtIpAddress), 319 data.getSnmpPort(), 320 READ_COMMUNITY); 321 } 322 catch (SnmpApplicationError e) { 323 324 ApplicationErrorInfoTypeImpl error_code = 325 new ApplicationErrorInfoTypeImpl(); 326 327 error_code.error = new UIDType( 328 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 329 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 330 331 if (e.reason.equals(ExceptionMessages.agent_response_error)) 332 error_code.details = ExceptionMessages.agent_response_error; 333 else 334 error_code.details = new String ("Could not retrieve ipForwaring " + 335 "for IpProtocolMonitor Object with name " + key + ":" + 336 " Object with Snmp Object Identifier " + IP_FWD_TYPE_OID + 337 " does not exist."); 338 throw new ApplicationError (error_code); 339 } 340 341 org.omg.CORBA.Any value = ipForwaringData.value; 342 343 if (value.type().kind().value() != TCKind._tk_long) { 344 345 ApplicationErrorInfoTypeImpl error_code = 346 new ApplicationErrorInfoTypeImpl(); 347 348 error_code.error = new UIDType( 349 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 350 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 351 352 error_code.details = new String ("Could not retrieve ipForwaring " + 353 "for IpProtocolMonitor Object with name " + key + ":" + 354 " Object with Snmp Object Identifier " + IP_FWD_TYPE_OID + 355 " is not of type integer, as expected."); 356 357 throw new ApplicationError (error_code); 358 } 359 360 int ipForwarding = value.extract_long(); 361 362 return ipForwarding; 363 364 } 365 371 public void 372 ipForwardingSet(org.omg.CosNaming.NameComponent [] name, int ipForwarding) 373 throws intt.itu.itut_x780.ApplicationError, ist.coach.coachEmsMib.NOipProtocolConfigurationSetPackageException 374 { 375 String key = Utils.name2string(name); 379 380 if (this.elements.containsKey(key) == false) { 381 ApplicationErrorInfoTypeImpl error_code = 382 new ApplicationErrorInfoTypeImpl(); 383 384 error_code.error = new UIDType( 385 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 386 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 387 388 error_code.details = new String ("object with name " + 389 key + " does not exist."); 390 391 throw new ApplicationError(error_code); 392 } 393 394 IpProtocolMonitorDataStructure data = 395 (IpProtocolMonitorDataStructure) this.elements.get(key); 396 397 if (!Utils.packageIsSupported(IP_PROTOCOL_CONFIG_PACKAGE, packagesGet(name))) { 398 System.err.println("Package " + IP_PROTOCOL_CONFIG_PACKAGE + " is not supported " + 399 "by IpProtocolMonitor Object " + key); 400 401 throw new ist.coach.coachEmsMib.NOipProtocolConfigurationSetPackageException(); 402 } 403 404 org.omg.CORBA.Any value = orb.create_any(); 405 406 value.insert_long(ipForwarding); 407 DataTypeImpl ipForwardingData = new DataTypeImpl( 408 IP_FWDDATAGRAMS_OID, 409 value, 410 SnmpSMI.SMI_INTEGER); 411 412 try { 413 this.connector.set( 414 ipForwardingData, 415 new String (data.getMgmtIpAddress()), 416 data.getSnmpPort(), 417 WRITE_COMMUNITY); 418 } 419 catch (SnmpApplicationError e) { 420 421 ApplicationErrorInfoTypeImpl error_code = 422 new ApplicationErrorInfoTypeImpl(); 423 424 error_code.error = new UIDType( 425 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 426 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 427 428 error_code.details = new String ("Could not set ipForwarding " + 429 "for IpProtocolMonitor Object with name " + key + "."); 430 431 throw new ApplicationError(error_code); 432 433 } 434 435 436 } 437 443 public int 444 ipDefaultTTLGet(org.omg.CosNaming.NameComponent [] name) 445 throws intt.itu.itut_x780.ApplicationError 446 { 447 String key = Utils.name2string(name); 451 452 if (this.elements.containsKey(key) == false) { 453 ApplicationErrorInfoTypeImpl error_code = 454 new ApplicationErrorInfoTypeImpl(); 455 456 error_code.error = new UIDType( 457 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 458 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 459 460 error_code.details = new String ("object with name " + 461 key + " does not exist."); 462 463 throw new ApplicationError(error_code); 464 } 465 466 IpProtocolMonitorDataStructure data = 467 (IpProtocolMonitorDataStructure) this.elements.get(key); 468 469 DataType ipDefaultTTLData = null; 470 471 try { 472 ipDefaultTTLData = this.connector.get( 473 IP_DEFAULT_TTL_OID, 474 new String (data.mgmtIpAddress), 475 data.getSnmpPort(), 476 READ_COMMUNITY); 477 } 478 catch (SnmpApplicationError e) { 479 480 ApplicationErrorInfoTypeImpl error_code = 481 new ApplicationErrorInfoTypeImpl(); 482 483 error_code.error = new UIDType( 484 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 485 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 486 487 if (e.reason.equals(ExceptionMessages.agent_response_error)) 488 error_code.details = ExceptionMessages.agent_response_error; 489 else 490 error_code.details = new String ("Could not retrieve ipDefaultTTL " + 491 "for IpProtocolMonitor Object with name " + key + ":" + 492 " Object with Snmp Object Identifier " + IP_DEFAULT_TTL_OID + 493 " does not exist."); 494 throw new ApplicationError (error_code); 495 } 496 497 org.omg.CORBA.Any value = ipDefaultTTLData.value; 498 499 if (value.type().kind().value() != TCKind._tk_long) { 500 501 ApplicationErrorInfoTypeImpl error_code = 502 new ApplicationErrorInfoTypeImpl(); 503 504 error_code.error = new UIDType( 505 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 506 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 507 508 error_code.details = new String ("Could not retrieve ipDefaultTTL " + 509 "for IpProtocolMonitor Object with name " + key + ":" + 510 " Object with Snmp Object Identifier " + IP_DEFAULT_TTL_OID + 511 " is not of type integer, as expected."); 512 513 throw new ApplicationError (error_code); 514 } 515 516 int ipDefaultTTL = value.extract_long(); 517 518 return ipDefaultTTL; 519 520 } 521 527 public void 528 ipDefaultTTLSet(org.omg.CosNaming.NameComponent [] name, int ipDefaultTTL) 529 throws intt.itu.itut_x780.ApplicationError, ist.coach.coachEmsMib.NOipProtocolConfigurationSetPackageException 530 { 531 String key = Utils.name2string(name); 535 536 if (this.elements.containsKey(key) == false) { 537 ApplicationErrorInfoTypeImpl error_code = 538 new ApplicationErrorInfoTypeImpl(); 539 540 error_code.error = new UIDType( 541 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 542 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 543 544 error_code.details = new String ("object with name " + 545 key + " does not exist."); 546 547 throw new ApplicationError(error_code); 548 } 549 550 IpProtocolMonitorDataStructure data = 551 (IpProtocolMonitorDataStructure) this.elements.get(key); 552 553 if (!Utils.packageIsSupported(IP_PROTOCOL_CONFIG_PACKAGE, packagesGet(name))) { 554 System.err.println("Package " + IP_PROTOCOL_CONFIG_PACKAGE + " is not supported " + 555 "by IpProtocolMonitor Object " + key); 556 557 throw new ist.coach.coachEmsMib.NOipProtocolConfigurationSetPackageException(); 558 } 559 560 org.omg.CORBA.Any value = orb.create_any(); 561 562 value.insert_long(ipDefaultTTL); 563 DataTypeImpl ipDefaultTTLData = new DataTypeImpl( 564 IP_DEFAULT_TTL_OID, 565 value, 566 SnmpSMI.SMI_INTEGER); 567 568 try { 569 this.connector.set( 570 ipDefaultTTLData, 571 new String (data.getMgmtIpAddress()), 572 data.getSnmpPort(), 573 WRITE_COMMUNITY); 574 } 575 catch (SnmpApplicationError e) { 576 577 ApplicationErrorInfoTypeImpl error_code = 578 new ApplicationErrorInfoTypeImpl(); 579 580 error_code.error = new UIDType( 581 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 582 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 583 584 error_code.details = new String ("Could not set ipDefaultTTL " + 585 "for IpProtocolMonitor Object with name " + key + "."); 586 587 throw new ApplicationError(error_code); 588 589 } 590 591 } 592 598 public long 599 ipInReceivesGet(org.omg.CosNaming.NameComponent [] name) 600 throws intt.itu.itut_x780.ApplicationError 601 { 602 String key = Utils.name2string(name); 606 607 if (this.elements.containsKey(key) == false) { 608 ApplicationErrorInfoTypeImpl error_code = 609 new ApplicationErrorInfoTypeImpl(); 610 611 error_code.error = new UIDType( 612 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 613 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 614 615 error_code.details = new String ("object with name " + 616 key + " does not exist."); 617 618 throw new ApplicationError(error_code); 619 } 620 621 IpProtocolMonitorDataStructure data = 622 (IpProtocolMonitorDataStructure) this.elements.get(key); 623 624 DataType ipInReceivesData = null; 625 626 try { 627 ipInReceivesData = this.connector.get( 628 IP_INRECEIVE_OID, 629 new String (data.mgmtIpAddress), 630 data.getSnmpPort(), 631 READ_COMMUNITY); 632 } 633 catch (SnmpApplicationError e) { 634 635 ApplicationErrorInfoTypeImpl error_code = 636 new ApplicationErrorInfoTypeImpl(); 637 638 error_code.error = new UIDType( 639 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 640 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 641 642 if (e.reason.equals(ExceptionMessages.agent_response_error)) 643 error_code.details = ExceptionMessages.agent_response_error; 644 else 645 error_code.details = new String ("Could not retrieve ipInReceivesData " + 646 "for IpProtocolMonitor Object with name " + key + ":" + 647 " Object with Snmp Object Identifier " + IP_INRECEIVE_OID + 648 " does not exist."); 649 throw new ApplicationError (error_code); 650 } 651 652 org.omg.CORBA.Any value = ipInReceivesData.value; 653 654 if (value.type().kind().value() != TCKind._tk_longlong) { 655 656 ApplicationErrorInfoTypeImpl error_code = 657 new ApplicationErrorInfoTypeImpl(); 658 659 error_code.error = new UIDType( 660 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 661 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 662 663 error_code.details = new String ("Could not retrieve ipInReceivesData " + 664 "for IpProtocolMonitor Object with name " + key + ":" + 665 " Object with Snmp Object Identifier " + IP_INRECEIVE_OID + 666 " is not of type integer, as expected."); 667 668 throw new ApplicationError (error_code); 669 } 670 671 long ipInReceives = value.extract_longlong(); 672 673 return ipInReceives; 674 } 675 681 public long 682 ipInHdrErrorsGet(org.omg.CosNaming.NameComponent [] name) 683 throws intt.itu.itut_x780.ApplicationError 684 { 685 String key = Utils.name2string(name); 689 690 if (this.elements.containsKey(key) == false) { 691 ApplicationErrorInfoTypeImpl error_code = 692 new ApplicationErrorInfoTypeImpl(); 693 694 error_code.error = new UIDType( 695 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 696 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 697 698 error_code.details = new String ("object with name " + 699 key + " does not exist."); 700 701 throw new ApplicationError(error_code); 702 } 703 704 IpProtocolMonitorDataStructure data = 705 (IpProtocolMonitorDataStructure) this.elements.get(key); 706 707 DataType ipInHeaderErrorsData = null; 708 709 try { 710 ipInHeaderErrorsData = this.connector.get( 711 IP_INHDRERRORS_OID, 712 new String (data.mgmtIpAddress), 713 data.getSnmpPort(), 714 READ_COMMUNITY); 715 } 716 catch (SnmpApplicationError e) { 717 718 ApplicationErrorInfoTypeImpl error_code = 719 new ApplicationErrorInfoTypeImpl(); 720 721 error_code.error = new UIDType( 722 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 723 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 724 725 if (e.reason.equals(ExceptionMessages.agent_response_error)) 726 error_code.details = ExceptionMessages.agent_response_error; 727 else 728 error_code.details = new String ("Could not retrieve ipInErrorHeaders " + 729 "for IpProtocolMonitor Object with name " + key + ":" + 730 " Object with Snmp Object Identifier " + IP_INHDRERRORS_OID + 731 " does not exist."); 732 throw new ApplicationError (error_code); 733 } 734 735 org.omg.CORBA.Any value = ipInHeaderErrorsData.value; 736 737 if (value.type().kind().value() != TCKind._tk_longlong) { 738 739 ApplicationErrorInfoTypeImpl error_code = 740 new ApplicationErrorInfoTypeImpl(); 741 742 error_code.error = new UIDType( 743 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 744 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 745 746 error_code.details = new String ("Could not retrieve ipInHeaderErrors " + 747 "for IpProtocolMonitor Object with name " + key + ":" + 748 " Object with Snmp Object Identifier " + IP_INHDRERRORS_OID + 749 " is not of type long, as expected."); 750 751 throw new ApplicationError (error_code); 752 } 753 754 long ipInHeaderErrors = value.extract_longlong(); 755 756 return ipInHeaderErrors; 757 } 758 764 public long 765 ipInAddrErrorsGet(org.omg.CosNaming.NameComponent [] name) 766 throws intt.itu.itut_x780.ApplicationError 767 { 768 String key = Utils.name2string(name); 772 773 if (this.elements.containsKey(key) == false) { 774 ApplicationErrorInfoTypeImpl error_code = 775 new ApplicationErrorInfoTypeImpl(); 776 777 error_code.error = new UIDType( 778 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 779 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 780 781 error_code.details = new String ("object with name " + 782 key + " does not exist."); 783 784 throw new ApplicationError(error_code); 785 } 786 787 IpProtocolMonitorDataStructure data = 788 (IpProtocolMonitorDataStructure) this.elements.get(key); 789 790 DataType ipInAddrErrorsData = null; 791 792 try { 793 ipInAddrErrorsData = this.connector.get( 794 IP_INADDRERRORRS_OID, 795 new String (data.mgmtIpAddress), 796 data.getSnmpPort(), 797 READ_COMMUNITY); 798 } 799 catch (SnmpApplicationError e) { 800 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 if (e.reason.equals(ExceptionMessages.agent_response_error)) 809 error_code.details = ExceptionMessages.agent_response_error; 810 else 811 error_code.details = new String ("Could not retrieve ipInAddrErrors " + 812 "for IpProtocolMonitor Object with name " + key + ":" + 813 " Object with Snmp Object Identifier " + IP_INADDRERRORRS_OID + 814 " does not exist."); 815 throw new ApplicationError (error_code); 816 } 817 818 org.omg.CORBA.Any value = ipInAddrErrorsData.value; 819 820 if (value.type().kind().value() != TCKind._tk_longlong) { 821 822 ApplicationErrorInfoTypeImpl error_code = 823 new ApplicationErrorInfoTypeImpl(); 824 825 error_code.error = new UIDType( 826 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 827 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 828 829 error_code.details = new String ("Could not retrieve ipInAddrErrors " + 830 "for IpProtocolMonitor Object with name " + key + ":" + 831 " Object with Snmp Object Identifier " + IP_INADDRERRORRS_OID + 832 " is not of type long, as expected."); 833 834 throw new ApplicationError (error_code); 835 } 836 837 long ipInAddrErrors = value.extract_longlong(); 838 839 return ipInAddrErrors; 840 } 841 847 public long 848 ipForwDatagramsGet(org.omg.CosNaming.NameComponent [] name) 849 throws intt.itu.itut_x780.ApplicationError 850 { 851 String key = Utils.name2string(name); 855 856 if (this.elements.containsKey(key) == false) { 857 ApplicationErrorInfoTypeImpl error_code = 858 new ApplicationErrorInfoTypeImpl(); 859 860 error_code.error = new UIDType( 861 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 862 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 863 864 error_code.details = new String ("object with name " + 865 key + " does not exist."); 866 867 throw new ApplicationError(error_code); 868 } 869 870 IpProtocolMonitorDataStructure data = 871 (IpProtocolMonitorDataStructure) this.elements.get(key); 872 873 DataType ipForwardedDatagramsData = null; 874 875 try { 876 ipForwardedDatagramsData = this.connector.get( 877 IP_FWDDATAGRAMS_OID, 878 new String (data.mgmtIpAddress), 879 data.getSnmpPort(), 880 READ_COMMUNITY); 881 } 882 catch (SnmpApplicationError e) { 883 884 ApplicationErrorInfoTypeImpl error_code = 885 new ApplicationErrorInfoTypeImpl(); 886 887 error_code.error = new UIDType( 888 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 889 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 890 891 if (e.reason.equals(ExceptionMessages.agent_response_error)) 892 error_code.details = ExceptionMessages.agent_response_error; 893 else 894 error_code.details = new String ("Could not retrieve ipForwardedDatagrams " + 895 "for IpProtocolMonitor Object with name " + key + ":" + 896 " Object with Snmp Object Identifier " + IP_FWDDATAGRAMS_OID + 897 " does not exist."); 898 throw new ApplicationError (error_code); 899 } 900 901 org.omg.CORBA.Any value = ipForwardedDatagramsData.value; 902 903 if (value.type().kind().value() != TCKind._tk_longlong) { 904 905 ApplicationErrorInfoTypeImpl error_code = 906 new ApplicationErrorInfoTypeImpl(); 907 908 error_code.error = new UIDType( 909 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 910 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 911 912 error_code.details = new String ("Could not retrieve ipForwardedDatagrams " + 913 "for IpProtocolMonitor Object with name " + key + ":" + 914 " Object with Snmp Object Identifier " + IP_FWDDATAGRAMS_OID + 915 " is not of type long, as expected."); 916 917 throw new ApplicationError (error_code); 918 } 919 920 long ipForwardedDatagrams = value.extract_longlong(); 921 922 return ipForwardedDatagrams; 923 } 924 930 public long 931 ipInUnknownProtosGet(org.omg.CosNaming.NameComponent [] name) 932 throws intt.itu.itut_x780.ApplicationError 933 { 934 String key = Utils.name2string(name); 938 939 if (this.elements.containsKey(key) == false) { 940 ApplicationErrorInfoTypeImpl error_code = 941 new ApplicationErrorInfoTypeImpl(); 942 943 error_code.error = new UIDType( 944 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 945 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 946 947 error_code.details = new String ("object with name " + 948 key + " does not exist."); 949 950 throw new ApplicationError(error_code); 951 } 952 953 IpProtocolMonitorDataStructure data = 954 (IpProtocolMonitorDataStructure) this.elements.get(key); 955 956 DataType ipInUnknownProtosData = null; 957 958 try { 959 ipInUnknownProtosData = this.connector.get( 960 IP_INUNKNOWNPROTO_OID, 961 new String (data.mgmtIpAddress), 962 data.getSnmpPort(), 963 READ_COMMUNITY); 964 } 965 catch (SnmpApplicationError e) { 966 967 ApplicationErrorInfoTypeImpl error_code = 968 new ApplicationErrorInfoTypeImpl(); 969 970 error_code.error = new UIDType( 971 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 972 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 973 974 if (e.reason.equals(ExceptionMessages.agent_response_error)) 975 error_code.details = ExceptionMessages.agent_response_error; 976 else 977 error_code.details = new String ("Could not retrieve ipInUnknownProtos " + 978 "for IpProtocolMonitor Object with name " + key + ":" + 979 " Object with Snmp Object Identifier " + IP_INUNKNOWNPROTO_OID + 980 " does not exist."); 981 throw new ApplicationError (error_code); 982 } 983 984 org.omg.CORBA.Any value = ipInUnknownProtosData.value; 985 986 if (value.type().kind().value() != TCKind._tk_longlong) { 987 988 ApplicationErrorInfoTypeImpl error_code = 989 new ApplicationErrorInfoTypeImpl(); 990 991 error_code.error = new UIDType( 992 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 993 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 994 995 error_code.details = new String ("Could not retrieve ipInUnknownProtos " + 996 "for IpProtocolMonitor Object with name " + key + ":" + 997 " Object with Snmp Object Identifier " + IP_INUNKNOWNPROTO_OID + 998 " is not of type long, as expected."); 999 1000 throw new ApplicationError (error_code); 1001 } 1002 1003 long ipInUnknownProtos = value.extract_longlong(); 1004 1005 return ipInUnknownProtos; 1006 1007 } 1008 1014 public long 1015 ipInDiscardsGet(org.omg.CosNaming.NameComponent [] name) 1016 throws intt.itu.itut_x780.ApplicationError 1017 { 1018 String key = Utils.name2string(name); 1022 1023 if (this.elements.containsKey(key) == false) { 1024 ApplicationErrorInfoTypeImpl error_code = 1025 new ApplicationErrorInfoTypeImpl(); 1026 1027 error_code.error = new UIDType( 1028 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1029 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1030 1031 error_code.details = new String ("object with name " + 1032 key + " does not exist."); 1033 1034 throw new ApplicationError(error_code); 1035 } 1036 1037 IpProtocolMonitorDataStructure data = 1038 (IpProtocolMonitorDataStructure) this.elements.get(key); 1039 1040 DataType ipInDiscardsData = null; 1041 1042 try { 1043 ipInDiscardsData = this.connector.get( 1044 IP_INDISCARDS_OID, 1045 new String (data.mgmtIpAddress), 1046 data.getSnmpPort(), 1047 READ_COMMUNITY); 1048 } 1049 catch (SnmpApplicationError e) { 1050 1051 ApplicationErrorInfoTypeImpl error_code = 1052 new ApplicationErrorInfoTypeImpl(); 1053 1054 error_code.error = new UIDType( 1055 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1056 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1057 1058 if (e.reason.equals(ExceptionMessages.agent_response_error)) 1059 error_code.details = ExceptionMessages.agent_response_error; 1060 else 1061 error_code.details = new String ("Could not retrieve ipInDiscards " + 1062 "for IpProtocolMonitor Object with name " + key + ":" + 1063 " Object with Snmp Object Identifier " + IP_INDISCARDS_OID + 1064 " does not exist."); 1065 throw new ApplicationError (error_code); 1066 } 1067 1068 org.omg.CORBA.Any value = ipInDiscardsData.value; 1069 1070 if (value.type().kind().value() != TCKind._tk_longlong) { 1071 1072 ApplicationErrorInfoTypeImpl error_code = 1073 new ApplicationErrorInfoTypeImpl(); 1074 1075 error_code.error = new UIDType( 1076 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1077 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1078 1079 error_code.details = new String ("Could not retrieve ipInDiscards " + 1080 "for IpProtocolMonitor Object with name " + key + ":" + 1081 " Object with Snmp Object Identifier " + IP_INDISCARDS_OID + 1082 " is not of type long, as expected."); 1083 1084 throw new ApplicationError (error_code); 1085 } 1086 1087 long ipInDiscards = value.extract_longlong(); 1088 1089 return ipInDiscards; 1090 } 1091 1097 public long 1098 ipInDeliversGet(org.omg.CosNaming.NameComponent [] name) 1099 throws intt.itu.itut_x780.ApplicationError 1100 { 1101 String key = Utils.name2string(name); 1105 1106 if (this.elements.containsKey(key) == false) { 1107 ApplicationErrorInfoTypeImpl error_code = 1108 new ApplicationErrorInfoTypeImpl(); 1109 1110 error_code.error = new UIDType( 1111 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1112 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1113 1114 error_code.details = new String ("object with name " + 1115 key + " does not exist."); 1116 1117 throw new ApplicationError(error_code); 1118 } 1119 1120 IpProtocolMonitorDataStructure data = 1121 (IpProtocolMonitorDataStructure) this.elements.get(key); 1122 1123 DataType ipInDeliversData = null; 1124 1125 try { 1126 ipInDeliversData = this.connector.get( 1127 IP_INDELIVERS_OID, 1128 new String (data.mgmtIpAddress), 1129 data.getSnmpPort(), 1130 READ_COMMUNITY); 1131 } 1132 catch (SnmpApplicationError e) { 1133 1134 ApplicationErrorInfoTypeImpl error_code = 1135 new ApplicationErrorInfoTypeImpl(); 1136 1137 error_code.error = new UIDType( 1138 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1139 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1140 1141 if (e.reason.equals(ExceptionMessages.agent_response_error)) 1142 error_code.details = ExceptionMessages.agent_response_error; 1143 else 1144 error_code.details = new String ("Could not retrieve ipInDelivers " + 1145 "for IpProtocolMonitor Object with name " + key + ":" + 1146 " Object with Snmp Object Identifier " + IP_INDELIVERS_OID + 1147 " does not exist."); 1148 throw new ApplicationError (error_code); 1149 } 1150 1151 org.omg.CORBA.Any value = ipInDeliversData.value; 1152 1153 if (value.type().kind().value() != TCKind._tk_longlong) { 1154 1155 ApplicationErrorInfoTypeImpl error_code = 1156 new ApplicationErrorInfoTypeImpl(); 1157 1158 error_code.error = new UIDType( 1159 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1160 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1161 1162 error_code.details = new String ("Could not retrieve ipInDelivers " + 1163 "for IpProtocolMonitor Object with name " + key + ":" + 1164 " Object with Snmp Object Identifier " + IP_INDELIVERS_OID + 1165 " is not of type long, as expected."); 1166 1167 throw new ApplicationError (error_code); 1168 } 1169 1170 long ipInDelivers = value.extract_longlong(); 1171 1172 return ipInDelivers; 1173 } 1174 1180 public long 1181 ipOutRequestsGet(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 IpProtocolMonitorDataStructure data = 1204 (IpProtocolMonitorDataStructure) this.elements.get(key); 1205 1206 DataType ipOutRequestsData = null; 1207 1208 try { 1209 ipOutRequestsData = this.connector.get( 1210 IP_OUTREQUESTS_OID, 1211 new String (data.mgmtIpAddress), 1212 data.getSnmpPort(), 1213 READ_COMMUNITY); 1214 } 1215 catch (SnmpApplicationError e) { 1216 1217 ApplicationErrorInfoTypeImpl error_code = 1218 new ApplicationErrorInfoTypeImpl(); 1219 1220 error_code.error = new UIDType( 1221 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1222 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1223 1224 if (e.reason.equals(ExceptionMessages.agent_response_error)) 1225 error_code.details = ExceptionMessages.agent_response_error; 1226 else 1227 error_code.details = new String ("Could not retrieve ipOutRequests " + 1228 "for IpProtocolMonitor Object with name " + key + ":" + 1229 " Object with Snmp Object Identifier " + IP_OUTREQUESTS_OID + 1230 " does not exist."); 1231 throw new ApplicationError (error_code); 1232 } 1233 1234 org.omg.CORBA.Any value = ipOutRequestsData.value; 1235 1236 if (value.type().kind().value() != TCKind._tk_longlong) { 1237 1238 ApplicationErrorInfoTypeImpl error_code = 1239 new ApplicationErrorInfoTypeImpl(); 1240 1241 error_code.error = new UIDType( 1242 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1243 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1244 1245 error_code.details = new String ("Could not retrieve ipOutRequests " + 1246 "for IpProtocolMonitor Object with name " + key + ":" + 1247 " Object with Snmp Object Identifier " + IP_OUTREQUESTS_OID + 1248 " is not of type long, as expected."); 1249 1250 throw new ApplicationError (error_code); 1251 } 1252 1253 long ipOutRequests = value.extract_longlong(); 1254 1255 return ipOutRequests; 1256 } 1257 1263 public long 1264 ipOutDiscardsGet(org.omg.CosNaming.NameComponent [] name) 1265 throws intt.itu.itut_x780.ApplicationError 1266 { 1267 String key = Utils.name2string(name); 1271 1272 if (this.elements.containsKey(key) == false) { 1273 ApplicationErrorInfoTypeImpl error_code = 1274 new ApplicationErrorInfoTypeImpl(); 1275 1276 error_code.error = new UIDType( 1277 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1278 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1279 1280 error_code.details = new String ("object with name " + 1281 key + " does not exist."); 1282 1283 throw new ApplicationError(error_code); 1284 } 1285 1286 IpProtocolMonitorDataStructure data = 1287 (IpProtocolMonitorDataStructure) this.elements.get(key); 1288 1289 DataType ipOutDiscardsData = null; 1290 1291 try { 1292 ipOutDiscardsData = this.connector.get( 1293 IP_OUTDISCARDS_OID, 1294 new String (data.mgmtIpAddress), 1295 data.getSnmpPort(), 1296 READ_COMMUNITY); 1297 } 1298 catch (SnmpApplicationError e) { 1299 1300 ApplicationErrorInfoTypeImpl error_code = 1301 new ApplicationErrorInfoTypeImpl(); 1302 1303 error_code.error = new UIDType( 1304 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1305 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1306 1307 if (e.reason.equals(ExceptionMessages.agent_response_error)) 1308 error_code.details = ExceptionMessages.agent_response_error; 1309 else 1310 error_code.details = new String ("Could not retrieve ipOutDiscards " + 1311 "for IpProtocolMonitor Object with name " + key + ":" + 1312 " Object with Snmp Object Identifier " + IP_OUTDISCARDS_OID + 1313 " does not exist."); 1314 throw new ApplicationError (error_code); 1315 } 1316 1317 org.omg.CORBA.Any value = ipOutDiscardsData.value; 1318 1319 if (value.type().kind().value() != TCKind._tk_longlong) { 1320 1321 ApplicationErrorInfoTypeImpl error_code = 1322 new ApplicationErrorInfoTypeImpl(); 1323 1324 error_code.error = new UIDType( 1325 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1326 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1327 1328 error_code.details = new String ("Could not retrieve ipOutDiscards " + 1329 "for IpProtocolMonitor Object with name " + key + ":" + 1330 " Object with Snmp Object Identifier " + IP_ROUTING_DISCARDS_OID + 1331 " is not of type long, as expected."); 1332 1333 throw new ApplicationError (error_code); 1334 } 1335 1336 long ipOutDiscards = value.extract_longlong(); 1337 1338 return ipOutDiscards; 1339 } 1340 1346 public long 1347 ipOutNoRoutesGet(org.omg.CosNaming.NameComponent [] name) 1348 throws intt.itu.itut_x780.ApplicationError 1349 { 1350 String key = Utils.name2string(name); 1354 1355 if (this.elements.containsKey(key) == false) { 1356 ApplicationErrorInfoTypeImpl error_code = 1357 new ApplicationErrorInfoTypeImpl(); 1358 1359 error_code.error = new UIDType( 1360 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1361 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1362 1363 error_code.details = new String ("object with name " + 1364 key + " does not exist."); 1365 1366 throw new ApplicationError(error_code); 1367 } 1368 1369 IpProtocolMonitorDataStructure data = 1370 (IpProtocolMonitorDataStructure) this.elements.get(key); 1371 1372 DataType ipNoRoutesData = null; 1373 1374 try { 1375 ipNoRoutesData = this.connector.get( 1376 IP_NOROUTE_OID, 1377 new String (data.mgmtIpAddress), 1378 data.getSnmpPort(), 1379 READ_COMMUNITY); 1380 } 1381 catch (SnmpApplicationError e) { 1382 1383 ApplicationErrorInfoTypeImpl error_code = 1384 new ApplicationErrorInfoTypeImpl(); 1385 1386 error_code.error = new UIDType( 1387 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1388 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1389 1390 if (e.reason.equals(ExceptionMessages.agent_response_error)) 1391 error_code.details = ExceptionMessages.agent_response_error; 1392 else 1393 error_code.details = new String ("Could not retrieve ipNoRoutes " + 1394 "for IpProtocolMonitor Object with name " + key + ":" + 1395 " Object with Snmp Object Identifier " + IP_NOROUTE_OID + 1396 " does not exist."); 1397 throw new ApplicationError (error_code); 1398 } 1399 1400 org.omg.CORBA.Any value = ipNoRoutesData.value; 1401 1402 if (value.type().kind().value() != TCKind._tk_longlong) { 1403 1404 ApplicationErrorInfoTypeImpl error_code = 1405 new ApplicationErrorInfoTypeImpl(); 1406 1407 error_code.error = new UIDType( 1408 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1409 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1410 1411 error_code.details = new String ("Could not retrieve ipNoRoutes " + 1412 "for IpProtocolMonitor Object with name " + key + ":" + 1413 " Object with Snmp Object Identifier " + IP_NOROUTE_OID + 1414 " is not of type long, as expected."); 1415 1416 throw new ApplicationError (error_code); 1417 } 1418 1419 long ipNoRoutes = value.extract_longlong(); 1420 1421 return ipNoRoutes; 1422 } 1423 1429 public int 1430 ipReasmTimeoutGet(org.omg.CosNaming.NameComponent [] name) 1431 throws intt.itu.itut_x780.ApplicationError 1432 { 1433 String key = Utils.name2string(name); 1437 1438 if (this.elements.containsKey(key) == false) { 1439 ApplicationErrorInfoTypeImpl error_code = 1440 new ApplicationErrorInfoTypeImpl(); 1441 1442 error_code.error = new UIDType( 1443 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1444 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1445 1446 error_code.details = new String ("object with name " + 1447 key + " does not exist."); 1448 1449 throw new ApplicationError(error_code); 1450 } 1451 1452 IpProtocolMonitorDataStructure data = 1453 (IpProtocolMonitorDataStructure) this.elements.get(key); 1454 1455 DataType ipReasmTimeoutData = null; 1456 1457 try { 1458 ipReasmTimeoutData = this.connector.get( 1459 IP_REASMTIMEOUT_OID, 1460 new String (data.mgmtIpAddress), 1461 data.getSnmpPort(), 1462 READ_COMMUNITY); 1463 } 1464 catch (SnmpApplicationError e) { 1465 1466 ApplicationErrorInfoTypeImpl error_code = 1467 new ApplicationErrorInfoTypeImpl(); 1468 1469 error_code.error = new UIDType( 1470 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1471 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1472 1473 if (e.reason.equals(ExceptionMessages.agent_response_error)) 1474 error_code.details = ExceptionMessages.agent_response_error; 1475 else 1476 error_code.details = new String ("Could not retrieve ipReasmTimeouts " + 1477 "for IpProtocolMonitor Object with name " + key + ":" + 1478 " Object with Snmp Object Identifier " + IP_REASMTIMEOUT_OID + 1479 " does not exist."); 1480 throw new ApplicationError (error_code); 1481 } 1482 1483 org.omg.CORBA.Any value = ipReasmTimeoutData.value; 1484 1485 if (value.type().kind().value() != TCKind._tk_long) { 1486 1487 ApplicationErrorInfoTypeImpl error_code = 1488 new ApplicationErrorInfoTypeImpl(); 1489 1490 error_code.error = new UIDType( 1491 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1492 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1493 1494 error_code.details = new String ("Could not retrieve ipReasmTimeouts " + 1495 "for IpProtocolMonitor Object with name " + key + ":" + 1496 " Object with Snmp Object Identifier " + IP_REASMTIMEOUT_OID + 1497 " is not of type long, as expected."); 1498 1499 throw new ApplicationError (error_code); 1500 } 1501 1502 int ipReasmTimeouts = value.extract_long(); 1503 1504 return ipReasmTimeouts; 1505 } 1506 1512 public long 1513 ipReasmReqdsGet(org.omg.CosNaming.NameComponent [] name) 1514 throws intt.itu.itut_x780.ApplicationError 1515 { 1516 String key = Utils.name2string(name); 1520 1521 if (this.elements.containsKey(key) == false) { 1522 ApplicationErrorInfoTypeImpl error_code = 1523 new ApplicationErrorInfoTypeImpl(); 1524 1525 error_code.error = new UIDType( 1526 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1527 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1528 1529 error_code.details = new String ("object with name " + 1530 key + " does not exist."); 1531 1532 throw new ApplicationError(error_code); 1533 } 1534 1535 IpProtocolMonitorDataStructure data = 1536 (IpProtocolMonitorDataStructure) this.elements.get(key); 1537 1538 DataType ipReasmReqsData = null; 1539 1540 try { 1541 ipReasmReqsData = this.connector.get( 1542 IP_REASMREQ_OID, 1543 new String (data.mgmtIpAddress), 1544 data.getSnmpPort(), 1545 READ_COMMUNITY); 1546 } 1547 catch (SnmpApplicationError e) { 1548 1549 ApplicationErrorInfoTypeImpl error_code = 1550 new ApplicationErrorInfoTypeImpl(); 1551 1552 error_code.error = new UIDType( 1553 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1554 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1555 1556 if (e.reason.equals(ExceptionMessages.agent_response_error)) 1557 error_code.details = ExceptionMessages.agent_response_error; 1558 else 1559 error_code.details = new String ("Could not retrieve ipReasmReqs " + 1560 "for IpProtocolMonitor Object with name " + key + ":" + 1561 " Object with Snmp Object Identifier " + IP_REASMREQ_OID + 1562 " does not exist."); 1563 throw new ApplicationError (error_code); 1564 } 1565 1566 org.omg.CORBA.Any value = ipReasmReqsData.value; 1567 1568 if (value.type().kind().value() != TCKind._tk_longlong) { 1569 1570 ApplicationErrorInfoTypeImpl error_code = 1571 new ApplicationErrorInfoTypeImpl(); 1572 1573 error_code.error = new UIDType( 1574 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1575 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1576 1577 error_code.details = new String ("Could not retrieve ipReasmReqs " + 1578 "for IpProtocolMonitor Object with name " + key + ":" + 1579 " Object with Snmp Object Identifier " + IP_REASMREQ_OID + 1580 " is not of type long, as expected."); 1581 1582 throw new ApplicationError (error_code); 1583 } 1584 1585 long ipReasmReqs = value.extract_longlong(); 1586 1587 return ipReasmReqs; 1588 } 1589 1595 public long 1596 ipReasmOKsGet(org.omg.CosNaming.NameComponent [] name) 1597 throws intt.itu.itut_x780.ApplicationError 1598 { 1599 String key = Utils.name2string(name); 1603 1604 if (this.elements.containsKey(key) == false) { 1605 ApplicationErrorInfoTypeImpl error_code = 1606 new ApplicationErrorInfoTypeImpl(); 1607 1608 error_code.error = new UIDType( 1609 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1610 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1611 1612 error_code.details = new String ("object with name " + 1613 key + " does not exist."); 1614 1615 throw new ApplicationError(error_code); 1616 } 1617 1618 IpProtocolMonitorDataStructure data = 1619 (IpProtocolMonitorDataStructure) this.elements.get(key); 1620 1621 DataType ipReasmOKsData = null; 1622 1623 try { 1624 ipReasmOKsData = this.connector.get( 1625 IP_REASMOK_OID, 1626 new String (data.mgmtIpAddress), 1627 data.getSnmpPort(), 1628 READ_COMMUNITY); 1629 } 1630 catch (SnmpApplicationError e) { 1631 1632 ApplicationErrorInfoTypeImpl error_code = 1633 new ApplicationErrorInfoTypeImpl(); 1634 1635 error_code.error = new UIDType( 1636 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1637 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1638 1639 if (e.reason.equals(ExceptionMessages.agent_response_error)) 1640 error_code.details = ExceptionMessages.agent_response_error; 1641 else 1642 error_code.details = new String ("Could not retrieve ipReasmOKs " + 1643 "for IpProtocolMonitor Object with name " + key + ":" + 1644 " Object with Snmp Object Identifier " + IP_REASMOK_OID + 1645 " does not exist."); 1646 throw new ApplicationError (error_code); 1647 } 1648 1649 org.omg.CORBA.Any value = ipReasmOKsData.value; 1650 1651 if (value.type().kind().value() != TCKind._tk_longlong) { 1652 1653 ApplicationErrorInfoTypeImpl error_code = 1654 new ApplicationErrorInfoTypeImpl(); 1655 1656 error_code.error = new UIDType( 1657 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1658 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1659 1660 error_code.details = new String ("Could not retrieve ipReasmOKs " + 1661 "for IpProtocolMonitor Object with name " + key + ":" + 1662 " Object with Snmp Object Identifier " + IP_REASMOK_OID + 1663 " is not of type long, as expected."); 1664 1665 throw new ApplicationError (error_code); 1666 } 1667 1668 long ipReasmOKs = value.extract_longlong(); 1669 1670 return ipReasmOKs; 1671 } 1672 1678 public long 1679 ipReasmFailsGet(org.omg.CosNaming.NameComponent [] name) 1680 throws intt.itu.itut_x780.ApplicationError 1681 { 1682 String key = Utils.name2string(name); 1686 1687 if (this.elements.containsKey(key) == false) { 1688 ApplicationErrorInfoTypeImpl error_code = 1689 new ApplicationErrorInfoTypeImpl(); 1690 1691 error_code.error = new UIDType( 1692 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1693 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1694 1695 error_code.details = new String ("object with name " + 1696 key + " does not exist."); 1697 1698 throw new ApplicationError(error_code); 1699 } 1700 1701 IpProtocolMonitorDataStructure data = 1702 (IpProtocolMonitorDataStructure) this.elements.get(key); 1703 1704 DataType ipReasmFailsData = null; 1705 1706 try { 1707 ipReasmFailsData = this.connector.get( 1708 IP_REASMFAIL_OID, 1709 new String (data.mgmtIpAddress), 1710 data.getSnmpPort(), 1711 READ_COMMUNITY); 1712 } 1713 catch (SnmpApplicationError e) { 1714 1715 ApplicationErrorInfoTypeImpl error_code = 1716 new ApplicationErrorInfoTypeImpl(); 1717 1718 error_code.error = new UIDType( 1719 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1720 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1721 1722 if (e.reason.equals(ExceptionMessages.agent_response_error)) 1723 error_code.details = ExceptionMessages.agent_response_error; 1724 else 1725 error_code.details = new String ("Could not retrieve ipReasmFails " + 1726 "for IpProtocolMonitor Object with name " + key + ":" + 1727 " Object with Snmp Object Identifier " + IP_REASMFAIL_OID + 1728 " does not exist."); 1729 throw new ApplicationError (error_code); 1730 } 1731 1732 org.omg.CORBA.Any value = ipReasmFailsData.value; 1733 1734 if (value.type().kind().value() != TCKind._tk_longlong) { 1735 1736 ApplicationErrorInfoTypeImpl error_code = 1737 new ApplicationErrorInfoTypeImpl(); 1738 1739 error_code.error = new UIDType( 1740 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1741 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1742 1743 error_code.details = new String ("Could not retrieve ipReasmFails " + 1744 "for IpProtocolMonitor Object with name " + key + ":" + 1745 " Object with Snmp Object Identifier " + IP_REASMFAIL_OID + 1746 " is not of type long, as expected."); 1747 1748 throw new ApplicationError (error_code); 1749 } 1750 1751 long ipReasmFails = value.extract_longlong(); 1752 1753 return ipReasmFails; 1754 } 1755 1761 public long 1762 ipFragOKsGet(org.omg.CosNaming.NameComponent [] name) 1763 throws intt.itu.itut_x780.ApplicationError 1764 { 1765 String key = Utils.name2string(name); 1769 1770 if (this.elements.containsKey(key) == false) { 1771 ApplicationErrorInfoTypeImpl error_code = 1772 new ApplicationErrorInfoTypeImpl(); 1773 1774 error_code.error = new UIDType( 1775 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1776 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1777 1778 error_code.details = new String ("object with name " + 1779 key + " does not exist."); 1780 1781 throw new ApplicationError(error_code); 1782 } 1783 1784 IpProtocolMonitorDataStructure data = 1785 (IpProtocolMonitorDataStructure) this.elements.get(key); 1786 1787 DataType ipFragOKsData = null; 1788 1789 try { 1790 ipFragOKsData = this.connector.get( 1791 IP_FRAGOK_OID, 1792 new String (data.mgmtIpAddress), 1793 data.getSnmpPort(), 1794 READ_COMMUNITY); 1795 } 1796 catch (SnmpApplicationError e) { 1797 1798 ApplicationErrorInfoTypeImpl error_code = 1799 new ApplicationErrorInfoTypeImpl(); 1800 1801 error_code.error = new UIDType( 1802 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1803 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1804 1805 if (e.reason.equals(ExceptionMessages.agent_response_error)) 1806 error_code.details = ExceptionMessages.agent_response_error; 1807 else 1808 error_code.details = new String ("Could not retrieve ipFragOKs " + 1809 "for IpProtocolMonitor Object with name " + key + ":" + 1810 " Object with Snmp Object Identifier " + IP_FRAGOK_OID + 1811 " does not exist."); 1812 throw new ApplicationError (error_code); 1813 } 1814 1815 org.omg.CORBA.Any value = ipFragOKsData.value; 1816 1817 if (value.type().kind().value() != TCKind._tk_longlong) { 1818 1819 ApplicationErrorInfoTypeImpl error_code = 1820 new ApplicationErrorInfoTypeImpl(); 1821 1822 error_code.error = new UIDType( 1823 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1824 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1825 1826 error_code.details = new String ("Could not retrieve ipFragOKs " + 1827 "for IpProtocolMonitor Object with name " + key + ":" + 1828 " Object with Snmp Object Identifier " + IP_FRAGOK_OID + 1829 " is not of type long, as expected."); 1830 1831 throw new ApplicationError (error_code); 1832 } 1833 1834 long ipFragOKs = value.extract_longlong(); 1835 1836 return ipFragOKs; 1837 } 1838 1844 public long 1845 ipFragFailsGet(org.omg.CosNaming.NameComponent [] name) 1846 throws intt.itu.itut_x780.ApplicationError 1847 { 1848 String key = Utils.name2string(name); 1852 1853 if (this.elements.containsKey(key) == false) { 1854 ApplicationErrorInfoTypeImpl error_code = 1855 new ApplicationErrorInfoTypeImpl(); 1856 1857 error_code.error = new UIDType( 1858 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1859 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1860 1861 error_code.details = new String ("object with name " + 1862 key + " does not exist."); 1863 1864 throw new ApplicationError(error_code); 1865 } 1866 1867 IpProtocolMonitorDataStructure data = 1868 (IpProtocolMonitorDataStructure) this.elements.get(key); 1869 1870 DataType ipFragFailsData = null; 1871 1872 try { 1873 ipFragFailsData = this.connector.get( 1874 IP_FRAGFAIL_OID, 1875 new String (data.mgmtIpAddress), 1876 data.getSnmpPort(), 1877 READ_COMMUNITY); 1878 } 1879 catch (SnmpApplicationError e) { 1880 1881 ApplicationErrorInfoTypeImpl error_code = 1882 new ApplicationErrorInfoTypeImpl(); 1883 1884 error_code.error = new UIDType( 1885 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1886 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1887 1888 if (e.reason.equals(ExceptionMessages.agent_response_error)) 1889 error_code.details = ExceptionMessages.agent_response_error; 1890 else 1891 error_code.details = new String ("Could not retrieve ipFragFails " + 1892 "for IpProtocolMonitor Object with name " + key + ":" + 1893 " Object with Snmp Object Identifier " + IP_FRAGFAIL_OID + 1894 " does not exist."); 1895 throw new ApplicationError (error_code); 1896 } 1897 1898 org.omg.CORBA.Any value = ipFragFailsData.value; 1899 1900 if (value.type().kind().value() != TCKind._tk_longlong) { 1901 1902 ApplicationErrorInfoTypeImpl error_code = 1903 new ApplicationErrorInfoTypeImpl(); 1904 1905 error_code.error = new UIDType( 1906 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1907 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1908 1909 error_code.details = new String ("Could not retrieve ipFragFails " + 1910 "for IpProtocolMonitor Object with name " + key + ":" + 1911 " Object with Snmp Object Identifier " + IP_FRAGFAIL_OID + 1912 " is not of type long, as expected."); 1913 1914 throw new ApplicationError (error_code); 1915 } 1916 1917 long ipFragFails = value.extract_longlong(); 1918 1919 return ipFragFails; 1920 } 1921 1927 public long 1928 ipFragCreatesGet(org.omg.CosNaming.NameComponent [] name) 1929 throws intt.itu.itut_x780.ApplicationError 1930 { 1931 String key = Utils.name2string(name); 1935 1936 if (this.elements.containsKey(key) == false) { 1937 ApplicationErrorInfoTypeImpl error_code = 1938 new ApplicationErrorInfoTypeImpl(); 1939 1940 error_code.error = new UIDType( 1941 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1942 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1943 1944 error_code.details = new String ("object with name " + 1945 key + " does not exist."); 1946 1947 throw new ApplicationError(error_code); 1948 } 1949 1950 IpProtocolMonitorDataStructure data = 1951 (IpProtocolMonitorDataStructure) this.elements.get(key); 1952 1953 DataType ipFragCreatesData = null; 1954 1955 try { 1956 ipFragCreatesData = this.connector.get( 1957 IP_FRAGCREATE_OID, 1958 new String (data.mgmtIpAddress), 1959 data.getSnmpPort(), 1960 READ_COMMUNITY); 1961 } 1962 catch (SnmpApplicationError e) { 1963 1964 ApplicationErrorInfoTypeImpl error_code = 1965 new ApplicationErrorInfoTypeImpl(); 1966 1967 error_code.error = new UIDType( 1968 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1969 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1970 1971 if (e.reason.equals(ExceptionMessages.agent_response_error)) 1972 error_code.details = ExceptionMessages.agent_response_error; 1973 else 1974 error_code.details = new String ("Could not retrieve ipFragCreates " + 1975 "for IpProtocolMonitor Object with name " + key + ":" + 1976 " Object with Snmp Object Identifier " + IP_FRAGCREATE_OID + 1977 " does not exist."); 1978 throw new ApplicationError (error_code); 1979 } 1980 1981 org.omg.CORBA.Any value = ipFragCreatesData.value; 1982 1983 if (value.type().kind().value() != TCKind._tk_longlong) { 1984 1985 ApplicationErrorInfoTypeImpl error_code = 1986 new ApplicationErrorInfoTypeImpl(); 1987 1988 error_code.error = new UIDType( 1989 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 1990 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 1991 1992 error_code.details = new String ("Could not retrieve ipFragCreates " + 1993 "for IpProtocolMonitor Object with name " + key + ":" + 1994 " Object with Snmp Object Identifier " + IP_FRAGCREATE_OID + 1995 " is not of type long, as expected."); 1996 1997 throw new ApplicationError (error_code); 1998 } 1999 2000 long ipFragCreates = value.extract_longlong(); 2001 2002 return ipFragCreates; 2003 } 2004 2010 public long 2011 ipRoutingDiscardsGet(org.omg.CosNaming.NameComponent [] name) 2012 throws intt.itu.itut_x780.ApplicationError 2013 { 2014 String key = Utils.name2string(name); 2018 2019 if (this.elements.containsKey(key) == false) { 2020 ApplicationErrorInfoTypeImpl error_code = 2021 new ApplicationErrorInfoTypeImpl(); 2022 2023 error_code.error = new UIDType( 2024 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 2025 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 2026 2027 error_code.details = new String ("object with name " + 2028 key + " does not exist."); 2029 2030 throw new ApplicationError(error_code); 2031 } 2032 2033 IpProtocolMonitorDataStructure data = 2034 (IpProtocolMonitorDataStructure) this.elements.get(key); 2035 2036 DataType ipRoutingDiscardsData = null; 2037 2038 try { 2039 ipRoutingDiscardsData = this.connector.get( 2040 IP_ROUTING_DISCARDS_OID, 2041 new String (data.mgmtIpAddress), 2042 data.getSnmpPort(), 2043 READ_COMMUNITY); 2044 } 2045 catch (SnmpApplicationError e) { 2046 2047 ApplicationErrorInfoTypeImpl error_code = 2048 new ApplicationErrorInfoTypeImpl(); 2049 2050 error_code.error = new UIDType( 2051 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 2052 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 2053 2054 if (e.reason.equals(ExceptionMessages.agent_response_error)) 2055 error_code.details = ExceptionMessages.agent_response_error; 2056 else 2057 error_code.details = new String ("Could not retrieve ipRoutingDiscards " + 2058 "for IpProtocolMonitor Object with name " + key + ":" + 2059 " Object with Snmp Object Identifier " + IP_ROUTING_DISCARDS_OID + 2060 " does not exist."); 2061 throw new ApplicationError (error_code); 2062 } 2063 2064 org.omg.CORBA.Any value = ipRoutingDiscardsData.value; 2065 2066 if (value.type().kind().value() != TCKind._tk_longlong) { 2067 2068 ApplicationErrorInfoTypeImpl error_code = 2069 new ApplicationErrorInfoTypeImpl(); 2070 2071 error_code.error = new UIDType( 2072 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 2073 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 2074 2075 error_code.details = new String ("Could not retrieve ipRoutingDiscards " + 2076 "for IpProtocolMonitor Object with name " + key + ":" + 2077 " Object with Snmp Object Identifier " + IP_ROUTING_DISCARDS_OID + 2078 " is not of type long, as expected."); 2079 2080 throw new ApplicationError (error_code); 2081 } 2082 2083 long ipRoutingDiscards = value.extract_longlong(); 2084 2085 return ipRoutingDiscards; 2086 } 2087 2093 public org.omg.CosNaming.NameComponent [] 2094 nameGet() 2095 { 2096 return Utils.string2name(_facade_name); 2100 } 2101 2107 public java.lang.String 2108 objectClassGet(org.omg.CosNaming.NameComponent [] name) 2109 throws intt.itu.itut_x780.ApplicationError 2110 { 2111 String key = Utils.name2string(name); 2115 2116 if (this.elements.containsKey(key) == false) { 2117 ApplicationErrorInfoTypeImpl error_code = 2118 new ApplicationErrorInfoTypeImpl(); 2119 2120 error_code.error = new UIDType( 2121 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 2122 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 2123 2124 error_code.details = new String ("object with name " + 2125 key + " does not exist."); 2126 2127 throw new ApplicationError(error_code); 2128 } 2129 2130 IpProtocolMonitorDataStructure data = 2131 (IpProtocolMonitorDataStructure) this.elements.get(key); 2132 2133 return data.objectclass; 2134 2135 } 2136 2142 public intt.itu.itut_x780.ManagedObjectValueType 2143 attributesGet(org.omg.CosNaming.NameComponent [] name, intt.itu.itut_x780.StringSetTypeHolder attributeNames) 2144 throws intt.itu.itut_x780.ApplicationError 2145 { 2146 String key = Utils.name2string(name); 2150 2151 if (this.elements.containsKey(key) == false) { 2152 ApplicationErrorInfoTypeImpl error_code = 2153 new ApplicationErrorInfoTypeImpl(); 2154 2155 error_code.error = new UIDType( 2156 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 2157 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 2158 2159 error_code.details = new String ("object with name " + 2160 key + " does not exist."); 2161 2162 throw new ApplicationError(error_code); 2163 } 2164 2165 IpProtocolMonitorDataStructure data = 2166 (IpProtocolMonitorDataStructure) this.elements.get(key); 2167 2168 IpProtocolMonitorValueTypeImpl ipProtocolMonitorValueType = 2169 new IpProtocolMonitorValueTypeImpl( 2170 ipForwardingGet(name), 2171 ipDefaultTTLGet(name), 2172 ipInReceivesGet(name), 2173 ipInHdrErrorsGet(name), 2174 ipInAddrErrorsGet(name), 2175 ipForwDatagramsGet(name), 2176 ipInUnknownProtosGet(name), 2177 ipInDiscardsGet(name), 2178 ipInDeliversGet(name), 2179 ipOutRequestsGet(name), 2180 ipOutDiscardsGet(name), 2181 ipOutNoRoutesGet(name), 2182 ipReasmTimeoutGet(name), 2183 ipReasmReqdsGet(name), 2184 ipReasmOKsGet(name), 2185 ipReasmFailsGet(name), 2186 ipFragOKsGet(name), 2187 ipFragFailsGet(name), 2188 ipFragCreatesGet(name), 2189 ipRoutingDiscardsGet(name), 2190 2191 data.name, 2192 data.objectclass, 2193 data.packages, 2194 data.sourceIndicator, 2195 data.deletePolicy 2196 ); 2197 2198 return ipProtocolMonitorValueType; 2199 } 2200 2206 public java.lang.String [] 2207 packagesGet(org.omg.CosNaming.NameComponent [] name) 2208 throws intt.itu.itut_x780.ApplicationError 2209 { 2210 String key = Utils.name2string(name); 2214 2215 if (this.elements.containsKey(key) == false) { 2216 ApplicationErrorInfoTypeImpl error_code = 2217 new ApplicationErrorInfoTypeImpl(); 2218 2219 error_code.error = new UIDType( 2220 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 2221 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 2222 2223 error_code.details = new String ("object with name " + 2224 key + " does not exist."); 2225 2226 throw new ApplicationError(error_code); 2227 } 2228 2229 IpProtocolMonitorDataStructure data = 2230 (IpProtocolMonitorDataStructure) this.elements.get(key); 2231 2232 return data.packages; 2233 } 2234 2240 public intt.itu.itut_x780.SourceIndicatorType 2241 creationSourceGet(org.omg.CosNaming.NameComponent [] name) 2242 throws intt.itu.itut_x780.ApplicationError 2243 { 2244 String key = Utils.name2string(name); 2248 2249 if (this.elements.containsKey(key) == false) { 2250 ApplicationErrorInfoTypeImpl error_code = 2251 new ApplicationErrorInfoTypeImpl(); 2252 2253 error_code.error = new UIDType( 2254 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 2255 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 2256 2257 error_code.details = new String ("object with name " + 2258 key + " does not exist."); 2259 2260 throw new ApplicationError(error_code); 2261 } 2262 2263 IpProtocolMonitorDataStructure data = 2264 (IpProtocolMonitorDataStructure) this.elements.get(key); 2265 2266 return data.sourceIndicator; 2267 } 2268 2274 public short 2275 deletePolicyGet(org.omg.CosNaming.NameComponent [] name) 2276 throws intt.itu.itut_x780.ApplicationError 2277 { 2278 String key = Utils.name2string(name); 2282 2283 if (this.elements.containsKey(key) == false) { 2284 ApplicationErrorInfoTypeImpl error_code = 2285 new ApplicationErrorInfoTypeImpl(); 2286 2287 error_code.error = new UIDType( 2288 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 2289 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 2290 2291 error_code.details = new String ("object with name " + 2292 key + " does not exist."); 2293 2294 throw new ApplicationError(error_code); 2295 } 2296 2297 IpProtocolMonitorDataStructure data = 2298 (IpProtocolMonitorDataStructure) this.elements.get(key); 2299 2300 return data.deletePolicy; 2301 } 2302 2308 public void 2309 destroy(org.omg.CosNaming.NameComponent [] name) 2310 throws intt.itu.itut_x780.ApplicationError, intt.itu.itut_x780.DeleteError 2311 { 2312 2316 if (!this.elements.containsKey(Utils.name2string(name))) { 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 error_code.details = new String ("object with name " + 2326 Utils.name2string(name) + " does not exist."); 2327 2328 throw new ApplicationError(error_code); 2329 2330 } 2331 2332 IpProtocolMonitorDataStructure ipProtocolMonitorData = 2333 (IpProtocolMonitorDataStructure) this.elements.remove( 2334 Utils.name2string(name)); 2335 2336 org.omg.TimeBase.UtcT eventTime = new org.omg.TimeBase.UtcT(System.currentTimeMillis(), 2337 0, (short) 0, (short) 0); 2338 the_context_.push_objectDeletion(new ObjectDeletionImpl(eventTime, name, 2339 ipProtocolMonitorData.objectclass, 2340 getUniqueNotificationIdentifier(), 2341 ipProtocolMonitorData.sourceIndicator, 2343 new AttributeValueType[0])); 2344 2345 } 2346 2357 public void 2358 create(org.omg.CosNaming.NameComponent [] name, 2359 java.lang.String objectClass, 2360 java.lang.String [] packages, 2361 short deletePolicy, 2362 intt.itu.itut_x780.SourceIndicatorType sourceIndicator, 2363 org.omg.CosNaming.NameComponent [] superior, 2364 byte[] mgmtIpAddress, 2365 int snmpPort, 2366 int supportedSnmpVersions) 2367 throws intt.itu.itut_x780.ApplicationError, intt.itu.itut_x780.CreateError 2368 { 2369 2373 if (this.elements.containsKey(Utils.name2string(name))) { 2374 2375 CreateErrorInfoTypeImpl errorCode = 2376 new CreateErrorInfoTypeImpl(); 2377 2378 errorCode.error = new UIDType( 2379 intt.itu.itut_x780.CreateErrorConst.moduleName.value, 2380 intt.itu.itut_x780.CreateErrorConst.duplicateName.value); 2381 2382 errorCode.details = new String (Utils.name2string(name) + 2383 " object already exists."); 2384 throw new intt.itu.itut_x780.CreateError(errorCode); 2385 } 2386 2387 IpProtocolMonitorDataStructure ipProtocolData = 2388 new IpProtocolMonitorDataStructure( 2389 name, 2390 objectClass, 2391 packages, 2392 sourceIndicator, 2393 deletePolicy, 2394 new String (mgmtIpAddress), 2395 snmpPort, 2396 supportedSnmpVersions); 2397 2398 this.elements.put(Utils.name2string(name), ipProtocolData); 2399 2400 org.omg.TimeBase.UtcT eventTime = new org.omg.TimeBase.UtcT (System.currentTimeMillis(), 2401 0, (short) 0, (short) 0); 2402 the_context_.push_objectCreation(new ObjectCreationImpl(eventTime, 2403 name, 2404 objectClass, 2405 getUniqueNotificationIdentifier(), 2406 sourceIndicator, 2408 new AttributeValueType[0])); 2409 2410 } 2411 2417 public java.lang.String 2418 facade_name() 2419 { 2420 return _facade_name; 2424 } 2425 2426 public int getUniqueNotificationIdentifier() { 2427 2428 notifId++; 2429 return notifId; 2430 } 2431 2432 class IpProtocolMonitorDataStructure { 2433 2434 public NameComponent [] name; 2435 public String objectclass; 2436 public String [] packages; 2437 public SourceIndicatorType sourceIndicator; 2438 public short deletePolicy; 2439 2440 private int notificationIdentifier; 2441 private String mgmtIpAddress; 2442 private int snmpPort; 2443 private int supportedSnmpVersions; 2444 2445 2446 public IpProtocolMonitorDataStructure() {} 2447 2448 public IpProtocolMonitorDataStructure( 2449 NameComponent [] name, 2450 String objectclass, 2451 String [] packages, 2452 SourceIndicatorType sourceIndicator, 2453 short deletePolicy, 2454 String mgmtIpAddress, 2455 int snmpPort, 2456 int supportedSnmpVersions) { 2457 2458 this.name = name; 2459 this.objectclass = objectclass; 2460 this.packages = packages; 2461 this.sourceIndicator = sourceIndicator; 2462 this.deletePolicy = deletePolicy; 2463 this.notificationIdentifier = 0; 2464 this.mgmtIpAddress = mgmtIpAddress; 2465 this.snmpPort = snmpPort; 2466 this.supportedSnmpVersions = supportedSnmpVersions; 2467 } 2468 2469 public int getUniqueNotificationIdentifier() { 2470 2471 this.notificationIdentifier++; 2472 2473 return (this.notificationIdentifier); 2474 } 2475 2476 public String getMgmtIpAddress() { 2477 return mgmtIpAddress; 2478 } 2479 2480 public int getSnmpPort() { 2481 return snmpPort; 2482 } 2483 2484 public int getSupportedSnmpVersions() { 2485 return supportedSnmpVersions; 2486 } 2487 } 2488} 2489 | Popular Tags |