Module org.snmp4j.agent
Package org.snmp4j.agent.mo
Class MOColumn<V extends org.snmp4j.smi.Variable>
- java.lang.Object
-
- org.snmp4j.agent.mo.MOColumn<V>
-
- All Implemented Interfaces:
Comparable<MOColumn<V>>
- Direct Known Subclasses:
MOMutableColumn,TimeStamp
public class MOColumn<V extends org.snmp4j.smi.Variable> extends Object implements Comparable<MOColumn<V>>
TheMOColumnclass represents columnar SMI objects. It represents all instances of a table's column not only a single instance (cell).Objects represented by
MOColumncannot be modified via SNMP, thusMOColumnsupports read-only maximum access only.- Version:
- 2.6
- Author:
- Frank Fock
- See Also:
MOMutableColumn
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(MOColumn<V> column)Compares this managed object column by its ID with another column.voidget(SubRequest<?> subRequest, MOTableRow row, int column)Process a get sub-request for the specified table row and column.MOAccessgetAccess()intgetColumnID()org.snmp4j.smi.VariablegetRestoreValue(org.snmp4j.smi.Variable[] rowValues, int column)Return the restore value for this column and the given row.org.snmp4j.smi.VariablegetStoreValue(MOTableRow row, int column)Return the content of this column's value of the given row for persistent storage.intgetSyntax()MOTablegetTable()VgetValue(MOTableRow row, int column, SubRequest<?> subRequest)Gets the value of the specified column from the provided row.booleanisVolatile(MOTableRow row, int column)Tests if the supplied row is volatile or persistent.voidsetAccess(MOAccess access)voidsetColumnID(int columnID)voidsetSyntax(int syntax)<R extends MOTableRow>
voidsetTable(MOTable<R,? extends MOColumn,? extends MOTableModel<R>> table)Sets the table instance this columnar object is contained in.StringtoString()
-
-
-
Constructor Detail
-
MOColumn
public MOColumn(int columnID, int syntax)Creates a read-only column object with the given column and syntax.- Parameters:
columnID- the column ID which is ID the last sub-identifier of the corresponding OBJECT-TYPE definition.syntax- the syntax of the objects in this column. SeeSMIConstantsfor possible values.
-
MOColumn
public MOColumn(int columnID, int syntax, MOAccess access)Creates a column object with the given column, syntax, and maximum access. SinceMOColumnonly supports read-only columns the only reasonable values foraccessare 'not-accessible' and 'read-only'. Generally this constructor should not be called directly.- Parameters:
columnID- the column ID which is ID the last sub-identifier of the corresponding OBJECT-TYPE definition.syntax- the syntax of the objects in this column. SeeSMIConstantsfor possible values.access- the maximum access of the column.
-
-
Method Detail
-
setColumnID
public void setColumnID(int columnID)
-
setSyntax
public void setSyntax(int syntax)
-
setAccess
public void setAccess(MOAccess access)
-
setTable
public <R extends MOTableRow> void setTable(MOTable<R,? extends MOColumn,? extends MOTableModel<R>> table)
Sets the table instance this columnar object is contained in. This method should be called byMOTableinstance to register the table with the column.- Type Parameters:
R- theMOTableRowtype supported by the table.- Parameters:
table- theMOTableinstance where this column is contained in.
-
getColumnID
public int getColumnID()
-
getSyntax
public int getSyntax()
-
getAccess
public MOAccess getAccess()
-
getTable
public MOTable getTable()
-
getValue
public V getValue(MOTableRow row, int column, SubRequest<?> subRequest)
Gets the value of the specified column from the provided row. The optionalsubRequestparameter provides information on the currently processed SNMP request if the value retrieval is trigger by a SNMP command.- Parameters:
row- the row with the value to be returned.column- the column index pointing to the column to return in the above row.subRequest- an optional sub-request on which behalf this value retrieval is executed.- Returns:
- the value as a pointer to the cell value or
nullif such a value does not exist. - Since:
- 2.6
-
isVolatile
public boolean isVolatile(MOTableRow row, int column)
Tests if the supplied row is volatile or persistent. If volatile then the row will not be saved when the table is saved to persistent storage.- Parameters:
row- a row of the table where this column is part of.column- the column index of this column inrow.- Returns:
trueifrowshould not be
-
getRestoreValue
public org.snmp4j.smi.Variable getRestoreValue(org.snmp4j.smi.Variable[] rowValues, int column)Return the restore value for this column and the given row.- Parameters:
rowValues- a row of the table where this column is part of.column- the column index of this column inrow.- Returns:
- the restored value. By default this is
rowValues[column]. - Since:
- 2.4
-
getStoreValue
public org.snmp4j.smi.Variable getStoreValue(MOTableRow row, int column)
Return the content of this column's value of the given row for persistent storage.- Parameters:
row- a row of the table where this column is part of.column- the column index of this column inrow.- Returns:
- the value to be stored persistently for this
rowandcolumn. - Since:
- 2.4
-
compareTo
public int compareTo(MOColumn<V> column)
Compares this managed object column by its ID with another column.- Specified by:
compareToin interfaceComparable<V extends org.snmp4j.smi.Variable>- Parameters:
column- anotherMOColumn.- Returns:
- int a negative integer, zero, or a positive integer as this column ID is less than, equal to, or greater than the specified object's column ID.
-
get
public void get(SubRequest<?> subRequest, MOTableRow row, int column)
Process a get sub-request for the specified table row and column.- Parameters:
subRequest- the GET sub-request to execute.row- the row that contains the value to return in the GET response PDU.column- the column index of the value to return insubRequest
-
-