com.adventnet.snmp.rmi
Interface SnmpTable

All Superinterfaces:
java.rmi.Remote, SnmpTarget
All Known Implementing Classes:
SnmpTableImpl_Stub

public interface SnmpTable
extends SnmpTarget

The SnmpTable RMI interface handles polling for SNMP tables for RMI clients.

See the rmitable.java application example in the rmiclient directory for an example. You will find it very useful to get familiar with the com.adventnet.snmp.beans package before using the RMI APIs, since the RMI APIs mirror and are derived from the beans equivalents.


Field Summary
static int SNMP_VARIABLE_BINDING_DATA
          Constant to specify format of returned table SNMP data values
static int SNMP_VARIABLE_DATA
          Constant to specify format of returned table SNMP data values
static int STRING_DATA
          Constant to specify format of returned table SNMP data values.
 
Fields inherited from interface com.adventnet.snmp.rmi.SnmpTarget
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, SHA_AUTH, SNMPGET, SNMPGETBULK, SNMPGETNEXT, SNMPINFORM, SNMPREPORT, SNMPRESPONSE, SNMPSET, SNMPTRAP, SNMPV2TRAP, VERSION1, VERSION2C, VERSION3
 
Method Summary
 void addRow(boolean Status, java.lang.String[] oidlist, java.lang.String[] s)
          add a row to the table .
 void addSnmpTableListener(SnmpTableListener l)
          Add a listener to the list that's notified each time a change to the SNMP Table occurs.
 void deleteRow(java.lang.String oid)
          Delete the row from the table
 java.lang.Object getCellValue(java.lang.String tableOID, int rowIndex, int columnIndex)
          To get the value at the cell specified by the row and column index.
 java.lang.String[] getColumn(int columnIndex)
          To get a column of the Table,corresponding to the specified index
 java.lang.String[] getColumn(java.lang.String columnName)
          To get a specified column of the Table
 java.lang.Class getColumnClass(int columnIndex)
          Returns the class to be used as renderer and editor for the column.
 int getColumnCount()
          Returns the number of columns of data available in the SnmpTable
 MibNode getColumnMibNode(int columnIndex)
          Get MibNode corresponding to a table column
 java.lang.String getColumnName(int index)
          Returns the name of the column index.
 int getDataType()
          Get the data type to be returned by the getValue methods.
 java.lang.String[][] getIndices()
          To get the indices of the Table.
 java.lang.String[][] getNotAccessibleIndex()
          To get the values for the not-accessible indices.
 java.lang.String[] getNotAccessibleIndexColumns()
          To get the names of the not-accessible index columns.
 boolean getPerformSets()
          Are sets being done when a user changes an editable field.
 void getPerformSets(boolean allowSets)
          Activate/Deactivate sets when a user changes an editable field.
 int getPollInterval()
          Get the current polling interval in seconds
 boolean getRetrievalMode()
          returns the mode of retrieval.For getting the values of the table, the bean will use successive getnext by default.
 java.lang.String[] getRow(java.lang.String tableOID, java.lang.String index)
          To get the row of the Table,corresponding to the specified index of the row in the table.
 int getRowCount()
          Returns the number of rows of data available in the SnmpTable.
 java.lang.String getTableOID()
          Get table oid used with this SnmpTable instance.
 java.lang.Object getValueAt(int rowIndex, int columnIndex)
          Returns value for the cell at specified index.
 boolean isCellEditable(int rowIndex, int columnIndex)
          Returns true if the cell at specified index is editable.
 void refreshTable()
          To refresh the table datas
 void removeSnmpTableListener(SnmpTableListener l)
          Remove a listener from the list that's notified each time a change to the SNMP Table occurs.
 void setCellValue(java.lang.String tableOID, java.lang.Object aValue, int rowIndex, int columnIndex)
          Sets the value at specified index.
 void setColumnsPolled(java.util.Vector index)
          To set the columns that needs to be polled.
 void setDataType(int type)
          Set the data type to be returned by the getValue methods.
 void setObjectIDList(java.lang.String[] s)
          Method to set the column names of the table that needs to be polled.
 void setParams(java.lang.String host, java.lang.String mib, java.lang.String tableOID)
          To set TargetHost,MibModule and TableOID
 void setPollInterval(int i)
          Set the polling interval in seconds
 void setRetrievalMode(boolean mode)
          To set the mode of retrieval.
 void setTableOID(java.lang.String tableOID)
          Specify table to be used with this SnmpTable instance.
 void setTableOIDWoStart(java.lang.String tableOID)
          To set the table OID without starting polling
 void setValueAt(java.lang.Object aValue, int rowIndex, int columnIndex)
          Sets the value at specified index.
 void startPollingTable()
          Method to start the polling of Table.This can be used after setting the table column oids using setObjectIDList.If the method setTableOID is used to set the oid of the table,this method need not be called explicitly as the setTableOID() method calls this method internally.
 
Methods inherited from interface com.adventnet.snmp.rmi.SnmpTarget
addLogClient, addObjectID, addResultListener, addSnmpOID, create_v3_tables, getAttemptComplete, getAttemptPartial, getAuthPassword, getAuthProtocol, getCommunity, getContextID, getContextName, getErrorCode, getErrorString, getExceptionCode, getMaxNumRows, getMaxRepetitions, getMibModules, getMibOperations, getNonRepeaters, getObjectID, getObjectID, getObjectIDList, getPrincipal, getPrivPassword, getPrivProtocol, getRetries, getSecurityLevel, getSecurityModel, getSendTimeoutEvents, getSnmpOID, getSnmpOIDList, getSnmpVersion, getTargetHost, getTargetPort, getTimeout, getTimeoutInMilliSec, getVarBindCount, getWriteCommunity, initSecurityProvider, isInSubTree, isSerialize, isSupportedSecurityModel, loadMibs, manage_v3_tables, releaseResources, removeLogClient, removeResultListener, setAttemptComplete, setAttemptPartial, setAuthPassword, setAuthProtocol, setCommunity, setContextID, setContextName, setDebug, setMaxNumRows, setMaxRepetitions, setMibModules, setNonRepeaters, setObjectID, setObjectID, setParams, setParams, setPrincipal, setPrivPassword, setPrivProtocol, setRetries, setSecurityLevel, setSecurityModel, setSendTimeoutEvents, setSnmpOID, setSnmpOIDList, setSnmpVersion, setTargetHost, setTargetPort, setTimeout, setTimeoutInMilliSec, setVarBindCount, setWriteCommunity, snmpGet, snmpGet, snmpGetAllList, snmpGetAllVariableBindings, snmpGetAllVariables, snmpGetBulkList, snmpGetBulkVariableBindings, snmpGetBulkVariables, snmpGetList, snmpGetList, snmpGetNext, snmpGetNext, snmpGetNextList, snmpGetNextList, snmpGetNextVariable, snmpGetNextVariableBinding, snmpGetNextVariableBindings, snmpGetNextVariables, snmpGetVariable, snmpGetVariableBinding, snmpGetVariableBindings, snmpGetVariables, snmpSendInformRequest, snmpSendInformRequest, snmpSendNotification, snmpSendTrap, snmpSendTrap, snmpSet, snmpSet, snmpSetList, snmpSetVariable, snmpSetVariables
 

Field Detail

STRING_DATA

public static final int STRING_DATA
Constant to specify format of returned table SNMP data values. String is the default.

See Also:
Constant Field Values

SNMP_VARIABLE_DATA

public static final int SNMP_VARIABLE_DATA
Constant to specify format of returned table SNMP data values

See Also:
Constant Field Values

SNMP_VARIABLE_BINDING_DATA

public static final int SNMP_VARIABLE_BINDING_DATA
Constant to specify format of returned table SNMP data values

See Also:
Constant Field Values
Method Detail

getNotAccessibleIndex

public java.lang.String[][] getNotAccessibleIndex()
                                           throws java.rmi.RemoteException
To get the values for the not-accessible indices.

Returns:
two dimensional array of Not Accessible Indices in the table.
java.rmi.RemoteException

getNotAccessibleIndexColumns

public java.lang.String[] getNotAccessibleIndexColumns()
                                                throws java.rmi.RemoteException
To get the names of the not-accessible index columns.

Returns:
the names of the not-accessible columns as a one dimensional String array.
java.rmi.RemoteException

getRowCount

public int getRowCount()
                throws java.rmi.RemoteException
Returns the number of rows of data available in the SnmpTable.

java.rmi.RemoteException

setCellValue

public void setCellValue(java.lang.String tableOID,
                         java.lang.Object aValue,
                         int rowIndex,
                         int columnIndex)
                  throws java.rmi.RemoteException
Sets the value at specified index. Table OID need not be set explicitly. The value can be a variable binding, or an SNMP variable, either as String or SnmpVar. The following errorCodes can be set SNMP_NOT_INIT, INVALID_VERSION, OID_NOT_SPECIFIED, REQ_TIMEDOUT, EMPTY_VAR_BIND, IP_ADDR_NOT_SPECIFIED, SESSION_REMOTE_HOST_UNKNOWN, SECURITYEXP_CONNECTING_REMOTE_HOST, UNKNOWN_ERR, SNMPERROR'S defined in ErrorMessages. INVALID_CONTEXT_NAME ,INVALID_CONTEXT_ID.

Parameters:
tableOID - OID of the table to which the cell belongs.
aValue - the value that needs to be set.
rowIndex - index of the row
columnIndex - index of the column
java.rmi.RemoteException
See Also:
ErrorMessages, SnmpTarget.getErrorCode(), SnmpTarget.getErrorString()

getCellValue

public java.lang.Object getCellValue(java.lang.String tableOID,
                                     int rowIndex,
                                     int columnIndex)
                              throws java.rmi.RemoteException
To get the value at the cell specified by the row and column index.

Parameters:
tableOID - OID of the table to which the cell belongs.
rowIndex - row to which the cell belongs.
columnIndex - column to which the cell belongs.
Returns:
the value at the specified cell
java.rmi.RemoteException

getRow

public java.lang.String[] getRow(java.lang.String tableOID,
                                 java.lang.String index)
                          throws java.rmi.RemoteException
To get the row of the Table,corresponding to the specified index of the row in the table. TableOID need not be set seperately.

Parameters:
index - index of the row in the table.
Returns:
the row values as an array of String.Null if that row does not exist.
java.rmi.RemoteException

getColumn

public java.lang.String[] getColumn(int columnIndex)
                             throws java.rmi.RemoteException
To get a column of the Table,corresponding to the specified index

Parameters:
columnIndex - index of the column
Returns:
the column values as an array of String.
java.rmi.RemoteException

getColumn

public java.lang.String[] getColumn(java.lang.String columnName)
                             throws java.rmi.RemoteException
To get a specified column of the Table

Parameters:
columnName - name of the column
Returns:
the column values as an array of String.
java.rmi.RemoteException

setParams

public void setParams(java.lang.String host,
                      java.lang.String mib,
                      java.lang.String tableOID)
               throws java.rmi.RemoteException
To set TargetHost,MibModule and TableOID

Parameters:
host - target host
mib - mib file
tableOID - OID of the table
java.rmi.RemoteException

setTableOIDWoStart

public void setTableOIDWoStart(java.lang.String tableOID)
                        throws java.rmi.RemoteException,
                               DataException
To set the table OID without starting polling

Parameters:
tableOID - OID of the table as a String
Throws:
DataException
java.rmi.RemoteException

startPollingTable

public void startPollingTable()
                       throws java.rmi.RemoteException,
                              DataException
Method to start the polling of Table.This can be used after setting the table column oids using setObjectIDList.If the method setTableOID is used to set the oid of the table,this method need not be called explicitly as the setTableOID() method calls this method internally.

java.rmi.RemoteException
DataException

getIndices

public java.lang.String[][] getIndices()
                                throws java.rmi.RemoteException
To get the indices of the Table. Before calling this method,call setTableOIDWoStart(tableOID).

Returns:
indices of Table as a two dimensional String array.
java.rmi.RemoteException

addRow

public void addRow(boolean Status,
                   java.lang.String[] oidlist,
                   java.lang.String[] s)
            throws java.rmi.RemoteException,
                   DataException
add a row to the table .

Parameters:
Status - if boolean is true then EntryStatus otherwise RowStatus
oidlist - list of Object ids of the table columns.
s - values to be set in the row.
Throws:
DataException - is thrown on errors
java.rmi.RemoteException

deleteRow

public void deleteRow(java.lang.String oid)
               throws java.rmi.RemoteException
Delete the row from the table

Parameters:
oid - rowStatus.index
java.rmi.RemoteException

getColumnCount

public int getColumnCount()
                   throws java.rmi.RemoteException
Returns the number of columns of data available in the SnmpTable

java.rmi.RemoteException

getColumnName

public java.lang.String getColumnName(int index)
                               throws java.rmi.RemoteException
Returns the name of the column index.

java.rmi.RemoteException

getColumnClass

public java.lang.Class getColumnClass(int columnIndex)
                               throws java.rmi.RemoteException
Returns the class to be used as renderer and editor for the column.

java.rmi.RemoteException

isCellEditable

public boolean isCellEditable(int rowIndex,
                              int columnIndex)
                       throws java.rmi.RemoteException
Returns true if the cell at specified index is editable.

java.rmi.RemoteException

getValueAt

public java.lang.Object getValueAt(int rowIndex,
                                   int columnIndex)
                            throws java.rmi.RemoteException
Returns value for the cell at specified index.

java.rmi.RemoteException

setValueAt

public void setValueAt(java.lang.Object aValue,
                       int rowIndex,
                       int columnIndex)
                throws java.rmi.RemoteException
Sets the value at specified index. The value can be a variable binding, or an SNMP variable, either as String or SnmpVar.

java.rmi.RemoteException

addSnmpTableListener

public void addSnmpTableListener(SnmpTableListener l)
                          throws java.rmi.RemoteException
Add a listener to the list that's notified each time a change to the SNMP Table occurs.

Parameters:
l - the SnmpTableListener
java.rmi.RemoteException

removeSnmpTableListener

public void removeSnmpTableListener(SnmpTableListener l)
                             throws java.rmi.RemoteException
Remove a listener from the list that's notified each time a change to the SNMP Table occurs.

Parameters:
l - the SnmpTableListener
java.rmi.RemoteException

getTableOID

public java.lang.String getTableOID()
                             throws java.rmi.RemoteException
Get table oid used with this SnmpTable instance. MIB containing this table must be loaded in this VM.

java.rmi.RemoteException

setTableOID

public void setTableOID(java.lang.String tableOID)
                 throws java.rmi.RemoteException
Specify table to be used with this SnmpTable instance. MIB containing this table must be loaded in this VM.

Parameters:
tableOID - the Object ID of the table, e.g. ifTable
java.rmi.RemoteException

getDataType

public int getDataType()
                throws java.rmi.RemoteException
Get the data type to be returned by the getValue methods.

java.rmi.RemoteException

setDataType

public void setDataType(int type)
                 throws java.rmi.RemoteException
Set the data type to be returned by the getValue methods. One of STRING_DATA, SNMP_VARIABLE_DATA or SNMP_VARIABLE_BINDING_DATA

Parameters:
type - data type to be returned
java.rmi.RemoteException

setColumnsPolled

public void setColumnsPolled(java.util.Vector index)
                      throws java.rmi.RemoteException
To set the columns that needs to be polled. The vector contains the index of the columns that needs to be polled.

java.rmi.RemoteException

getRetrievalMode

public boolean getRetrievalMode()
                         throws java.rmi.RemoteException
returns the mode of retrieval.For getting the values of the table, the bean will use successive getnext by default. returns true in this case. If getbulk is used for retrieval this method returns false.

java.rmi.RemoteException

setRetrievalMode

public void setRetrievalMode(boolean mode)
                      throws java.rmi.RemoteException
To set the mode of retrieval. This should be set to true if you want to retrieve the table using successive getnext. By default this is set to true. To use getbulk this should be set to false.

java.rmi.RemoteException

getPollInterval

public int getPollInterval()
                    throws java.rmi.RemoteException
Get the current polling interval in seconds

java.rmi.RemoteException

setPollInterval

public void setPollInterval(int i)
                     throws java.rmi.RemoteException
Set the polling interval in seconds

java.rmi.RemoteException

refreshTable

public void refreshTable()
                  throws java.rmi.RemoteException
To refresh the table datas

java.rmi.RemoteException

setObjectIDList

public void setObjectIDList(java.lang.String[] s)
                     throws java.rmi.RemoteException
Method to set the column names of the table that needs to be polled. The setTableOID will poll all the columns of the table. Setting the column names using this method will make the bean poll only the specified columns.

Specified by:
setObjectIDList in interface SnmpTarget
Parameters:
s - a one dimensional array of column names
java.rmi.RemoteException

getColumnMibNode

public MibNode getColumnMibNode(int columnIndex)
                         throws java.rmi.RemoteException
Get MibNode corresponding to a table column

java.rmi.RemoteException

getPerformSets

public boolean getPerformSets()
                       throws java.rmi.RemoteException
Are sets being done when a user changes an editable field.

java.rmi.RemoteException

getPerformSets

public void getPerformSets(boolean allowSets)
                    throws java.rmi.RemoteException
Activate/Deactivate sets when a user changes an editable field.

java.rmi.RemoteException


Copyright (c)ZOHO Corp. 1996-2012