Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
SnmpTableListenerImpl.java.txt
Package: AdventNetSNMPAPI_4.zip [view]
Upload User: aonuowh
Upload Date: 2021-05-23
Package Size: 35390k
Code Size: 2k
Category:
SNMP
Development Platform:
C/C++
- /* $Id: SnmpTableListenerImpl.java,v 1.3 2002/09/09 05:45:01 tonyjpaul Exp $ */
- /*
- * @(#)SnmpTableListenerImpl.java
- * Copyright (c) 1996-2003 AdventNet, Inc. All Rights Reserved.
- * Please read the COPYRIGHTS file for more
- */
- import java.util.*;
- import com.adventnet.snmp.snmp2.*;
- import com.adventnet.snmp.mibs.*;
- import com.adventnet.snmp.beans.*;
- public class SnmpTableListenerImpl extends
- com.adventnet.snmp.corba._SnmpTableListenerImplBase
- {
- public SnmpTableListenerImpl( com.adventnet.snmp.corba.SnmpTable tbl )
- {
- this.table = tbl;
- }
- // This method is called when trap is received by SnmpTrapReceiver
- public void tableChanged(com.adventnet.snmp.corba.TableEvent tblEvent) {
- try {
- StringBuffer sb = new StringBuffer();
- if ( tblEvent.startRow == 0) { // we're being notified of first row
- for (int i=0;i<table.getColumnCount();i++) // print column names
- sb.append(table.getColumnName(i)+" t");
- System.out.println(sb.toString());
- }
- if (table.getRowCount() == 0) { // no rows and we're being notified
- System.err.println("Request failed or timed out. n"+
- table.getErrorString());
- } else { // print the rows we're getting
- sb = new StringBuffer();
- for (int j= tblEvent.startRow;j<=tblEvent.endRow;j++) {
- for (int i=0;i<table.getColumnCount();i++)
- sb.append(table.getValueAt(j,i)+" t");
- }
- System.out.println(sb.toString());
- }
- } catch (Exception ex) {
- System.err.println("Failed: "+ ex);
- ex.printStackTrace();
- }
- }
- com.adventnet.snmp.corba.SnmpTable table;
- }
- //System.out.println("Got a trap" );
- //com.adventnet.snmp.beans.SnmpTableEvent event = ((SnmpTableEventImpl)tblEvent).tableEvent;
- //System.out.println( "Table Event: " );
- //System.out.println( "First Row: " + tblEvent.startRow );
- //System.out.println( "Last Row: " + tblEvent.endRow );
- //System.out.println( "Column : " + tblEvent.column );
- //System.out.println( "Type: " + tblEvent.Type );