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
- All Implemented Interfaces:
- CustomizerTemplate, java.util.EventListener, java.lang.Runnable, java.io.Serializable, javax.swing.table.TableModel, java.beans.VetoableChangeListener
- 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
Fields inherited from class com.adventnet.snmp.beans.SnmpTarget |
serialize, SNMPGET, SNMPGETBULK, SNMPGETNEXT, SNMPINFORM, SNMPREPORT, SNMPRESPONSE, SNMPSET, SNMPTRAP, SNMPV2TRAP, VERSION1, VERSION2C, VERSION3 |
Fields inherited from class com.adventnet.snmp.beans.SnmpServer |
AUTH_NO_PRIV, AUTH_PRIV, CBC_3DES, CBC_DES, CFB_AES_128, CFB_AES_192, CFB_AES_256, MD5_AUTH, NO_AUTH, NO_AUTH_NO_PRIV, NO_PRIV, oidList, SHA_AUTH |
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, deleteTableRow, finalize, getCellValue, getColumn, getColumn, getColumnCount, getColumnMibNode, getColumnName, getDataType, getHoles, getIndices, getNotAccessibleIndex, getNotAccessibleIndexColumns, getPerformSets, getPerformSets, getPollInterval, getRetrievalMode, getRow, getRow, getRowCount, getTableOID, getValueAt, isCellEditable, refreshTable, removeSnmpTableListener, run, setCellValue, setColumnsPolled, setDataType, setParams, setPollInterval, setRetrievalMode, 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, getPrivProtocol, getRetries, getSecurityLevel, getSecurityModel, getSendTimeoutEvents, getSnmpOID, getSnmpOIDList, getSnmpVersion, getTargetHost, getTargetPort, getTimeout, getUserErrorCode, getUserErrorString, getVarBindCount, getWriteCommunity, 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, setPrivProtocol, 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, vetoableChange |
Methods inherited from class com.adventnet.snmp.beans.SnmpServer |
async_create_v3_tables, create_v3_tables, genEvent, getCharacterEncoding, getHostAddress, getLocalAddresses, getMibPath, getOverwriteCMI, getPacketBufferSize, getSecLevelForTimeSync, getSecurityProvider, getSecurityTable, getSerializedMibFileName, getSimpleDateFormat, getSnmpEngineID, getSnmpEngineTable, getTimeoutInMilliSec, getTimeToWait, getUSMTable, getV3ConfigTable, getV3MsgMaxSize, initJdbcParams, initSecurityProvider, isBroadcastFeatureEnable, isLoadFromCompiledMibs, isLoadFromSerializedMibs, isLoadMibsFromDatabase, isOverwriteCMI, isOverwriteMibsInDatabase, isReadDesc, isSendPDUByGroup, isSerializeMibs, isSetAutoInformResponse, isSupportedSecurityModel, isV3DatabaseFlag, isValidateUser, manage_v3_tables, managing_v3_tables, reestablish, restoreDefaultTimeoutPolicy, setAutoInformResponse, setBroadcastFeatureEnable, setCharacterEncoding, setErrorFlagEnable, setLoadFromCompiledMibs, setLoadFromSerializedMibs, setLoadMibsFromDatabase, setMibOperations, setMibPath, setOverwriteCMI, setOverwriteMibsInDatabase, setPacketBufferSize, setReadDesc, setReceiveBufferSize, setSecLevelForTimeSync, setSendPDUByGroup, setSerializedMibFileName, setSerializeMibs, setSimpleDateFormat, setSnmpEngineBoots, setSnmpEngineID, setTimeoutInMilliSec, setTimeoutPolicy, setTimeToWait, setV3ConfigTable, setV3DatabaseFlag, setV3MsgMaxSize, setWaitTimeToRetry, validateUser |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.swing.table.TableModel |
getColumnCount, getColumnName, getRowCount, getValueAt, isCellEditable, setValueAt |
SnmpTableModel
public SnmpTableModel()
- Use this constructor for applications.
SnmpTableModel
public SnmpTableModel(java.applet.Applet applet)
- Use this constructor for applets.
genTableEvent
protected void genTableEvent(SnmpTableEvent evt)
- Generates the table events to the registered listeners
- Overrides:
genTableEvent
in 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- See Also:
ErrorMessages
,
SnmpTarget.getErrorString()
,
SnmpTarget.getErrorCode()
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
- 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.
Copyright (c)ZOHO Corp. 1996-2012