com.adventnet.snmp.ui
Class SnmpTableModel

java.lang.Object
  |
  +--com.adventnet.snmp.beans.SnmpServer
        |
        +--com.adventnet.snmp.beans.SnmpTarget
              |
              +--com.adventnet.snmp.beans.SnmpTable
                    |
                    +--com.adventnet.snmp.ui.SnmpTableModel

public class SnmpTableModel
extends SnmpTable
implements javax.swing.table.TableModel

The SnmpTableModel class handles processing for SNMP tables. It implements the table model to support the Model/View/Controller design of swing applications.

To use the table class, instantiate, and identify the SNMP table to be used. Then perform operations onthe table, or register for table change events.

This class implements the methods needed by the swing JTable.

See Also:
Serialized Form

Field Summary
(package private)  java.lang.Class[] columnClass
           
(package private)  boolean endoftable
           
(package private)  java.util.Vector tableModelListeners
           
 
Fields inherited from class com.adventnet.snmp.beans.SnmpTable
ADDandDELcol, augmentedTableoid, cnam, colOIDs, columnClass, columnNames, columns, columnsPolled, DATA_TYPE, editable, externalIndices, holes, holesCount, holesGot, isAugmentedTable, isEntryStatus, isNotInSubTree, noAccessIndex, nodes, num_col, performSets, pollInterval, RETRIEVAL_MODE, rootoid, rowtry, shifting, SNMP_VARIABLE_BINDING_DATA, SNMP_VARIABLE_DATA, STRING_DATA, syntax, tableData, tableListeners, tableOID, thisThread
 
Fields inherited from class com.adventnet.snmp.beans.SnmpTarget
ackFlag, debugListeners, genericTrap, genericTraps, informReqID, mibModules, serialize, SNMPGET, SNMPGETBULK, SNMPGETNEXT, SNMPINFORM, SNMPREPORT, SNMPRESPONSE, SNMPSET, SNMPTRAP, snmpTrapEnterprise, snmpTrapOid, SNMPV2TRAP, upTime, VERSION1, VERSION2C, VERSION3
 
Fields inherited from class com.adventnet.snmp.beans.SnmpServer
api, applet, ASN1_ERROR_ERR, ASN1_ERROR_OID, attemptCompleteData, attemptPartialData, AUTH_NO_PRIV, AUTH_PRIV, authKey, authPassword, authProtocol, broadCast, clientID, community, contextID, contextName, count, debugon, DECRYPT_ERROR_ERR, DECRYPT_ERROR_OID, discoveryTimeSyncListener, enc, engineID, engineTable, error, errorCode, errorcodes, errorIndex, exceptionCode, exceptionCodes, finalize_called, group, group_oidList, isName, isNotSet, isSendPDUByGroup, listeners, localAddrs, localPort, logFlag, loggerImpl, logLevel, logType, matchServ, matchtable, MAX_NUM_ROWS, maxRepetitions, MD5_AUTH, mibOps, NO_AUTH, NO_AUTH_NO_PRIV, nonRepeaters, NOT_TIME_WINDOWS_ERR, NOT_TIME_WINDOWS_OID, nullsession_targets, oidList, options, pduErrorIndex, pollertargets, pollInterval, port, port_targets, principal, printStr, privKey, privPassword, privProtocol, propertylisteners, protocol, reqHandler, reqid, retries, secModel, securityLevel, sendTimeoutEvents, sentreqid, session, session_port_targets, session_targets, sessionName, SHA_AUTH, SNMPGET, SNMPGETBULK, SNMPGETNEXT, SNMPINFORM, SNMPREPORT, SNMPRESPONSE, SNMPSET, snmpStore, SNMPTRAP, SNMPV2TRAP, targetHost, targets, timeout, UKN_ENGINEID_ERR, UKN_ENGINEID_OID, UKN_USERNAMES_ERR, UKN_USERNAMES_OID, UNSUPP_SEC_LEVEL_ERR, UNSUPP_SEC_LEVEL_OID, userError, userErrorCode, usmTable, v3ErrorTable, validateUser, varbinds_per_request, varList, version, VERSION1, VERSION2C, VERSION3, writeCommunity, WRONG_DIGEST_ERR, WRONG_DIGEST_OID
 
Constructor Summary
SnmpTableModel()
          Use this constructor for applications.
SnmpTableModel(java.applet.Applet applet)
          Use this constructor for applets.
 
Method Summary
 void addTableModelListener(javax.swing.event.TableModelListener l)
          Adds a listener to the list that is notified each time a change occurs in the Table Model.
protected  void genTableEvent(SnmpTableEvent evt)
          Generates the table events to the registered listeners
 java.lang.Class getColumnClass(int columnIndex)
          Returns the class to be used as renderer and editor for the column.
 boolean isEndOfTable()
          Checks whether the end of the table is reached or not.
 void removeTableModelListener(javax.swing.event.TableModelListener l)
          Removes a listener from the list that is notified each time a change occurs in the Table Model.
 void setObjectIDList(java.lang.String[] s)
          Sets the column names of the table that needs to be polled.
 void setTableOID(java.lang.String tableOID)
          Sets the tableOID to be used with this SnmpTableModel instance.
 void startPolling()
          Starts polling the Table data
 void stopPolling()
          Stops polling the Table data
 
Methods inherited from class com.adventnet.snmp.beans.SnmpTable
addRow, addSnmpTableListener, checkDifferences, compareRow, deleteRow, finalize, getCellValue, getColumn, getColumn, getColumnCount, getColumnMibNode, getColumnName, getDataType, getHoles, getIndices, getNotAccessibleIndex, getNotAccessibleIndexColumns, getPerformSets, getPerformSets, getPollInterval, getRetrievalMode, getRow, getRow, getRow, getRowCol, getRowCount, getRowFromArray, getTableOID, getValueAt, isCellEditable, refreshTable, removeSnmpTableListener, run, setCellValue, setColumnsPolled, setDataType, setObjectIDListWoStart, setParams, setPollInterval, setRetrievalMode, setSuperObjectIDList, setTableOIDWoStart, setValueAt, showErrorMessage, startPollingTable, stopPollingTable
 
Methods inherited from class com.adventnet.snmp.beans.SnmpTarget
addLogClient, addLogClient, addObjectID, addResultListener, addSnmpOID, addSnmpPropertyListener, addUserError, addV3HandShakeResultListener, enableDebugForPDU, genEvent, genTimeoutEvent, getAttemptComplete, getAttemptPartial, getAuthPassword, getAuthProtocol, getCommunity, getCompleteResponse, getContextID, getContextName, getDebug, getEngineID, getErrorCode, getErrorCodes, getErrorIndex, getErrorString, getExceptionCode, getExceptionCodes, getIgnoreSpecificControlCodes, getMaxNumRows, getMaxRepetitions, getMibModules, getMibOperations, getNonRepeaters, getObjectID, getObjectID, getObjectIDList, getPduErrorIndex, getPrincipal, getPrivPassword, getRetries, getSecurityLevel, getSecurityModel, getSendTimeoutEvents, getSnmpOID, getSnmpOIDList, getSnmpVariables, getSnmpVersion, getTargetHost, getTargetPort, getTimeout, getUserErrorCode, getUserErrorString, getV1TrapOids, getVarBindCount, getWriteCommunity, isInSubTree, isInSubTree, isSerialize, loadMibs, releaseResources, removeLogClient, removeResultListener, removeSnmpPropertyListener, removeV3HandShakeListener, setAttemptComplete, setAttemptPartial, setAuthPassword, setAuthProtocol, setClientID, setCommunity, setContextID, setContextName, setDebug, setEngineID, setIgnoreSpecificControlCodes, setMaxNumRows, setMaxRepetitions, setMibModules, setNonRepeaters, setObjectID, setObjectID, setParams, setParams, setPrincipal, setPrivPassword, setRetries, setSecurityLevel, setSecurityModel, setSendTimeoutEvents, setSnmpOID, setSnmpOIDList, setSnmpVersion, setTargetHost, setTargetPort, setTimeout, setVarBindCount, setWriteCommunity, snmpGet, snmpGet, snmpGetAllList, snmpGetAllVariableBindings, snmpGetAllVariables, snmpGetBulkList, snmpGetBulkVariableBindings, snmpGetBulkVariables, snmpGetList, snmpGetList, snmpGetNext, snmpGetNext, snmpGetNextList, snmpGetNextList, snmpGetNextVariable, snmpGetNextVariableBinding, snmpGetNextVariableBindings, snmpGetNextVariables, snmpGetVariable, snmpGetVariableBinding, snmpGetVariableBindings, snmpGetVariables, snmpSendInformAcknowledgement, snmpSendInformRequest, snmpSendInformRequest, snmpSendNotification, snmpSendNotification, snmpSendTrap, snmpSendTrap, snmpSet, snmpSet, snmpSetList, snmpSetVariable, snmpSetVariableList, snmpSetVariables, updateMibs, vetoableChange
 
Methods inherited from class com.adventnet.snmp.beans.SnmpServer
assignLogger, async_create_v3_tables, create_v3_tables, genEvent, getCharacterEncoding, getCompleteResponse, getGROUPSNMPResponse, getHostAddress, getLocalAddresses, getMibPath, getOverwriteCMI, getPacketBufferSize, getPdu, getSecLevelForTimeSync, getSecurityProvider, getSecurityTable, getSerializedMibFileName, getSimpleDateFormat, getSnmpEngineID, getSnmpEngineTable, getSNMPResponse, getSNMPResponse, getSNMPResponse, getTimeoutInMilliSec, getTimeToWait, getUSMTable, getV3ConfigTable, initJdbcParams, initSecurityProvider, initSnmpStore, isBroadcastFeatureEnable, isLoadFromCompiledMibs, isLoadFromSerializedMibs, isLoadMibsFromDatabase, isOverwriteCMI, isOverwriteMibsInDatabase, isReadDesc, isSendPDUByGroup, isSerializeMibs, isSetAutoInformResponse, isSupportedSecurityModel, isV3DatabaseFlag, isValidateUser, logErrorMessage, logInfoMessage, manage_v3_tables, managing_v3_tables, sendSNMPRequest, sendSNMPRequest, sendSNMPRequest, setAutoInformResponse, setBroadcastFeatureEnable, setCharacterEncoding, setErrorMessage, setLoadFromCompiledMibs, setLoadFromSerializedMibs, setLoadMibsFromDatabase, setMibOperations, setMibPath, setOverwriteCMI, setOverwriteMibsInDatabase, setPacketBufferSize, setPduParams, setReadDesc, setReceiveBufferSize, setSecLevelForTimeSync, setSendPDUByGroup, setSerializedMibFileName, setSerializeMibs, setSimpleDateFormat, setSnmpEngineID, setTimeoutInMilliSec, setTimeToWait, setV3ConfigTable, setV3DatabaseFlag, updateEntry, validateUser
 
Methods inherited from class java.lang.Object
, clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

endoftable

boolean endoftable

columnClass

java.lang.Class[] columnClass

tableModelListeners

java.util.Vector tableModelListeners
Constructor Detail

SnmpTableModel

public SnmpTableModel()
Use this constructor for applications.

SnmpTableModel

public SnmpTableModel(java.applet.Applet applet)
Use this constructor for applets.
Method Detail

genTableEvent

protected void genTableEvent(SnmpTableEvent evt)
Generates the table events to the registered listeners
Overrides:
genTableEvent in class SnmpTable
Tags copied from class: SnmpTable
Parameters:
evt - an instance of SnmpTableEvent.

addTableModelListener

public void addTableModelListener(javax.swing.event.TableModelListener l)
Adds a listener to the list that is notified each time a change occurs in the Table Model.
Specified by:
addTableModelListener in interface javax.swing.table.TableModel
Parameters:
l - an instance of TableModelListener.

removeTableModelListener

public void removeTableModelListener(javax.swing.event.TableModelListener l)
Removes a listener from the list that is notified each time a change occurs in the Table Model.
Specified by:
removeTableModelListener in interface javax.swing.table.TableModel
Parameters:
l - an instance of TableModelListener.

isEndOfTable

public boolean isEndOfTable()
Checks whether the end of the table is reached or not.
Returns:
true if the end of the table is reached and false otherwise.

setTableOID

public void setTableOID(java.lang.String tableOID)
                 throws DataException
Sets the tableOID to be used with this SnmpTableModel instance. MIB containing this table must be loaded in this VM.
Overrides:
setTableOID in class SnmpTable
Parameters:
tableOID - the Object ID of the table, e.g. ifTable
Throws:
DataException - is thrown on errors

setObjectIDList

public void setObjectIDList(java.lang.String[] s)
Sets the column names of the table that needs to be polled. The setTableOID() method will poll all the columns of the table. Setting the column names using this method will make the bean poll only the specified columns.
Overrides:
setObjectIDList in class SnmpTable
Tags copied from class: SnmpTable
Parameters:
s - a one dimensional array of column names

startPolling

public void startPolling()
Starts polling the Table data

stopPolling

public void stopPolling()
Stops polling the Table data

getColumnClass

public java.lang.Class getColumnClass(int columnIndex)
Returns the class to be used as renderer and editor for the column.
Specified by:
getColumnClass in interface javax.swing.table.TableModel
Overrides:
getColumnClass in class SnmpTable
Parameters:
columnIndex - position of the column in the table.
Returns:
the class to be used as renderer and editor.