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

    • Constructor Detail

      • MOMutableColumn

        public MOMutableColumn​(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.
      • MOMutableColumn

        public MOMutableColumn​(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.
      • MOMutableColumn

        public MOMutableColumn​(int columnID,
                               int syntax,
                               MOAccess access,
                               V defaultValue)
        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-indentifer 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.
        defaultValue - the default value for new rows.
      • MOMutableColumn

        public MOMutableColumn​(int columnID,
                               int syntax,
                               MOAccess access,
                               V defaultValue,
                               boolean mutableInService)
        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-indentifer 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.
        defaultValue - the default value for new rows.
        mutableInService - if true this column accepts value changes through SNMP (via prepare(org.snmp4j.agent.request.SubRequest, MOTableRow, MOTableRow, int) and commit(org.snmp4j.agent.request.SubRequest, MOTableRow, MOTableRow, int) while the rows RowStatus object is in state RowStatus.active. Otherwise, such an operation will result in a PDU.inconsistentValue error.
    • Method Detail

      • validate

        public int validate​(V newValue,
                            V oldValue)
      • validateSetRequest

        protected boolean validateSetRequest​(SubRequest<?> subRequest,
                                             MOTableRow row,
                                             int column)
      • setDefaultValue

        public void setDefaultValue​(V defaultValue)
      • setMutableInService

        public void setMutableInService​(boolean mutableInService)
      • getDefaultValue

        public V getDefaultValue()
      • isMutableInService

        public boolean isMutableInService()
      • isMandatory

        public boolean isMandatory()
        Returns true if this column must be specified in a SET request which creates a row.
        Returns:
        true if this row has a maximum access of READ-CREATE and has a null default value, false otherwise.
      • setMandatory

        public void setMandatory​(boolean mandatory)
        Sets a flag that determines if this column must be specified in a SET request which creates a row. The default is true.
        Parameters:
        mandatory - if true and a row has a maximum access of READ-CREATE and has a null default value, then it must be provided in order to activate the row.
        Since:
        1.3.2