Class DefaultMOMutableRow2PC

    • Constructor Detail

      • DefaultMOMutableRow2PC

        public DefaultMOMutableRow2PC​(org.snmp4j.smi.OID index,
                                      org.snmp4j.smi.Variable[] values)
    • Method Detail

      • cleanup

        public void cleanup​(SubRequest subRequest,
                            int column)
        Description copied from interface: MOMutableRow2PC
        Cleanups resources holds for changes to a single column.
        Specified by:
        cleanup in interface MOMutableRow2PC
        Parameters:
        subRequest - the sub-request that corresponds to the column change.
        column - the column index of the changed column.
      • commit

        public void commit​(SubRequest subRequest,
                           MOTableRow changeSet,
                           int column)
        Description copied from interface: MOMutableRow2PC
        Commits changes to single column.
        Specified by:
        commit in interface MOMutableRow2PC
        Parameters:
        subRequest - the sub-request that corresponds to the column change. This object can be used to deny the commit phase and triggering the undo phase by setting its error status.
        changeSet - a MOTableRow instance that represents the state of the row if all changes have been applied successfully.
        column - the column index of the column to be changed.
      • getIndex

        public org.snmp4j.smi.OID getIndex()
        Description copied from interface: MOTableRow
        Gets the row's index OID, for example the row index of the first row of an ifTable would return OID("1").
        Specified by:
        getIndex in interface MOTableRow
        Overrides:
        getIndex in class DefaultMOTableRow
        Returns:
        the row index of this row.
      • getUserObject

        public java.lang.Object getUserObject()
      • getValue

        public org.snmp4j.smi.Variable getValue​(int column)
        Description copied from interface: MOTableRow
        Gets the value at the specified column index.
        Specified by:
        getValue in interface MOTableRow
        Overrides:
        getValue in class DefaultMOTableRow
        Parameters:
        column - the zero-based column index.
        Returns:
        the value at the specified index.
      • setUserObject

        public void setUserObject​(java.lang.Object userObject)
      • setValue

        public void setValue​(int column,
                             org.snmp4j.smi.Variable value)
        Description copied from interface: MOMutableTableRow
        Sets the value of a column of this row.
        Specified by:
        setValue in interface MOMutableTableRow
        Parameters:
        column - the (zero-based) column index.
        value - the new value for the specified column. Implementations of this method may not check the value's type to match the columns type for performance reasons. Thus, the caller have to make sure that the type's match to avoid runtime exceptions later.
      • size

        public int size()
        Description copied from interface: MOTableRow
        Returns the number of columns in this row.
        Specified by:
        size in interface MOTableRow
        Overrides:
        size in class DefaultMOTableRow
        Returns:
        the column count.
      • undo

        public void undo​(SubRequest subRequest,
                         int column)
        Description copied from interface: MOMutableRow2PC
        Undos the changes to a single column.
        Specified by:
        undo in interface MOMutableRow2PC
        Parameters:
        subRequest - the sub-request that corresponds to the column change.
        column - the column index of the changed column.
      • getResultingValue

        public org.snmp4j.smi.Variable getResultingValue​(int column,
                                                         MOTableRow changes)
        Returns the value of the specified column that would result if the specified changes would have been applied to the row.
        Parameters:
        column - the column to return
        changes - a MOTableRow instance representing the changes to apply to this row. Values that are not changed must be returned as null values.
        Returns:
        the resulting Variable.
      • commitRow

        public void commitRow​(SubRequest subRequest,
                              MOTableRow changeSet)
        Description copied from interface: MOMutableRow2PC
        Commits a row as described by the supplied change set. If the modification cannot be successfully committed, the error status of the supplied subRequest should be set to commitFailed. Setting this error should be avoided under any circumstances.

        This method is called only once per modified row.

        Specified by:
        commitRow in interface MOMutableRow2PC
        Parameters:
        subRequest - the sub-request that triggered the row change and that can be used to trigger the undo phase by setting its error status.
        changeSet - a MOTableRow instance that represents the state of the row if all changes have been applied successfully.
      • prepare

        public void prepare​(SubRequest subRequest,
                            MOTableRow changeSet,
                            int column)
        Description copied from interface: MOMutableRow2PC
        Prepares changing a single column.
        Specified by:
        prepare in interface MOMutableRow2PC
        Parameters:
        subRequest - the sub-request that corresponds to the column change. This object can be used to deny the commit phase by setting its error status.
        changeSet - a MOTableRow instance that represents the state of the row if all changes have been applied successfully.
        column - the column index of the column to be changed.
      • cleanupRow

        public void cleanupRow​(SubRequest request,
                               DefaultMOTable.ChangeSet changeSet)
        Description copied from interface: MOMutableRow2PC
        Cleans up resources for a row.

        This method is called only once per modified row.

        Specified by:
        cleanupRow in interface MOMutableRow2PC
        Parameters:
        request - the sub-request that triggered the row change.
        changeSet - a MOTableRow instance that represents the state of the row if all changes have been applied successfully.
      • undoRow

        public void undoRow​(SubRequest request,
                            DefaultMOTable.ChangeSet changeSet)
        Description copied from interface: MOMutableRow2PC
        Undoes changes to a row.

        This method is called only once per modified row.

        Specified by:
        undoRow in interface MOMutableRow2PC
        Parameters:
        request - the sub-request that triggered the row change.
        changeSet - a MOTableRow instance that represents the state of the row if all changes have been applied successfully.
      • prepareRow

        public void prepareRow​(SubRequest subRequest,
                               MOTableRow changeSet)
        Description copied from interface: MOMutableRow2PC
        Prepares a row for changes described by the supplied change set. If the modification cannot be successfully prepared, the error status of the supplied subRequest should be set to the appropriate error status value.

        This method is called only once per modified row.

        Specified by:
        prepareRow in interface MOMutableRow2PC
        Parameters:
        subRequest - the sub-request that triggered the row change and that can be used to deny the commit phase by setting its error status.
        changeSet - a MOTableRow instance that represents the state of the row if all changes have been applied successfully.