Class MOColumn<V extends org.snmp4j.smi.Variable>

  • 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>>
    The MOColumn class represents columnar SMI objects. It represents all instances of a table's column not only a single instance (cell).

    Objects represented by MOColumn cannot be modified via SNMP, thus MOColumn supports read-only maximum access only.

    Version:
    2.6
    Author:
    Frank Fock
    See Also:
    MOMutableColumn
    • 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. See SMIConstants for possible values.
      • MOColumn

        public MOColumn​(int columnID,
                        int syntax,
                        MOAccess access)
        Creates a column object with the given column, syntax, and maximum access. Since MOColumn only supports read-only columns the only reasonable values for access are '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. See SMIConstants for 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 by MOTable instance to register the table with the column.
        Type Parameters:
        R - the MOTableRow type supported by the table.
        Parameters:
        table - the MOTable instance 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 optional subRequest parameter 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 null if 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 in row.
        Returns:
        true if row should 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 in row.
        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 in row.
        Returns:
        the value to be stored persistently for this row and column.
        Since:
        2.4
      • compareTo

        public int compareTo​(MOColumn<V> column)
        Compares this managed object column by its ID with another column.
        Specified by:
        compareTo in interface Comparable<V extends org.snmp4j.smi.Variable>
        Parameters:
        column - another MOColumn.
        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 in subRequest