- java.lang.Object
-
- org.snmp4j.agent.mo.DefaultMOTableRow
-
- org.snmp4j.agent.mo.DefaultMOMutableRow2PC
-
- All Implemented Interfaces:
Comparable<MOTableRow>,MOMutableRow2PC<SubRequest<?>>,MOMutableTableRow,MOTableRow
- Direct Known Subclasses:
NotificationLogMib.NlmConfigLogEntryRow,NotificationLogMib.NlmLogEntryRow,NotificationLogMib.NlmLogVariableEntryRow,NotificationLogMib.NlmStatsLogEntryRow,Snmp4jConfigMib.Snmp4jCfgStorageEntryRow,Snmp4jLogMib.Snmp4jLogConsoleHandlerEntryRow,Snmp4jLogMib.Snmp4jLogFileHandlerEntryRow,Snmp4jLogMib.Snmp4jLogHandlerEntryRow,Snmp4jLogMib.Snmp4jLogLoggerEntryRow,Snmp4jLogMib.Snmp4jLogLoggerToHandlerEntryRow,Snmp4jProxyMib.Snmp4jProxyEntryRow,SnmpCommunityMIB.SnmpCommunityEntryRow,SnmpProxyMIB.SnmpProxyRow,SnmpTargetMIB.SnmpTargetAddrEntryRow,SnmpTlsTmMib.SnmpTlstmAddrEntryRow,SnmpTlsTmMib.SnmpTlstmCertToTSNEntryRow,SnmpTlsTmMib.SnmpTlstmParamsEntryRow,SnmpUsmDhObjectsMib.UsmDHKickstartEntryRow,SnmpUsmDhObjectsMib.UsmDHUserKeyEntryRow,UsmMIB.UsmTableRow
public class DefaultMOMutableRow2PC extends DefaultMOTableRow implements MOMutableRow2PC<SubRequest<?>>
-
-
Field Summary
-
Fields inherited from class org.snmp4j.agent.mo.DefaultMOTableRow
index, values
-
-
Constructor Summary
Constructors Constructor Description DefaultMOMutableRow2PC(org.snmp4j.smi.OID index, org.snmp4j.smi.Variable[] values)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcleanup(SubRequest<?> subRequest, int column)Cleanups resources holds for changes to a single column.voidcleanupRow(SubRequest<?> request, DefaultMOTable.ChangeSet changeSet)Cleans up resources for a row.voidcommit(SubRequest<?> subRequest, MOTableRow changeSet, int column)Commits changes to single column.voidcommitRow(SubRequest<?> subRequest, MOTableRow changeSet)Commits a row as described by the supplied change set.MOTableRowgetBaseRow()Gets the associated base row for this row (if this row is a dependent row).org.snmp4j.smi.OIDgetIndex()Gets the row's index OID, for example the row index of the first row of an ifTable would returnOID("1").org.snmp4j.smi.VariablegetResultingValue(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.ObjectgetUserObject()org.snmp4j.smi.VariablegetValue(int column)Gets the value at the specified column index.voidprepare(SubRequest<?> subRequest, MOTableRow changeSet, int column)Prepares changing a single column.voidprepareRow(SubRequest<?> subRequest, MOTableRow changeSet)Prepares a row for changes described by the supplied change set.voidsetBaseRow(MOTableRow baseRow)Sets the associated base row.voidsetUserObject(Object userObject)voidsetValue(int column, org.snmp4j.smi.Variable value)Sets the value of a column of this row.intsize()Returns the number of columns in this row.StringtoString()voidundo(SubRequest<?> subRequest, int column)Undos the changes to a single column.voidundoRow(SubRequest<?> request, DefaultMOTable.ChangeSet changeSet)Undoes changes to a row.-
Methods inherited from class org.snmp4j.agent.mo.DefaultMOTableRow
compareTo, equals, getColumnValue, hashCode, toStringMembers
-
-
-
-
Method Detail
-
cleanup
public void cleanup(SubRequest<?> subRequest, int column)
Description copied from interface:MOMutableRow2PCCleanups resources holds for changes to a single column.- Specified by:
cleanupin interfaceMOMutableRow2PC<SubRequest<?>>- 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:MOMutableRow2PCCommits changes to single column.- Specified by:
commitin interfaceMOMutableRow2PC<SubRequest<?>>- 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.
-
getBaseRow
public MOTableRow getBaseRow()
Description copied from interface:MOTableRowGets the associated base row for this row (if this row is a dependent row).- Specified by:
getBaseRowin interfaceMOTableRow- Overrides:
getBaseRowin classDefaultMOTableRow- Returns:
- the base row or
nullif this row is a base row itself.
-
getIndex
public org.snmp4j.smi.OID getIndex()
Description copied from interface:MOTableRowGets the row's index OID, for example the row index of the first row of an ifTable would returnOID("1").- Specified by:
getIndexin interfaceMOTableRow- Overrides:
getIndexin classDefaultMOTableRow- Returns:
- the row index of this row.
-
getUserObject
public Object getUserObject()
-
getValue
public org.snmp4j.smi.Variable getValue(int column)
Description copied from interface:MOTableRowGets the value at the specified column index.- Specified by:
getValuein interfaceMOTableRow- Overrides:
getValuein classDefaultMOTableRow- Parameters:
column- the zero-based column index.- Returns:
- the value at the specified index.
-
setBaseRow
public void setBaseRow(MOTableRow baseRow)
Description copied from interface:MOTableRowSets the associated base row.- Specified by:
setBaseRowin interfaceMOMutableTableRow- Specified by:
setBaseRowin interfaceMOTableRow- Overrides:
setBaseRowin classDefaultMOTableRow- Parameters:
baseRow- the base row.
-
setUserObject
public void setUserObject(Object userObject)
-
setValue
public void setValue(int column, org.snmp4j.smi.Variable value)Description copied from interface:MOMutableTableRowSets the value of a column of this row.- Specified by:
setValuein interfaceMOMutableTableRow- 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:MOTableRowReturns the number of columns in this row.- Specified by:
sizein interfaceMOTableRow- Overrides:
sizein classDefaultMOTableRow- Returns:
- the column count.
-
undo
public void undo(SubRequest<?> subRequest, int column)
Description copied from interface:MOMutableRow2PCUndos the changes to a single column.- Specified by:
undoin interfaceMOMutableRow2PC<SubRequest<?>>- 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 returnchanges- aMOTableRowinstance representing the changes to apply to this row. Values that are not changed must be returned asnullvalues.- Returns:
- the resulting
Variable.
-
commitRow
public void commitRow(SubRequest<?> subRequest, MOTableRow changeSet)
Description copied from interface:MOMutableRow2PCCommits a row as described by the supplied change set. If the modification cannot be successfully committed, the error status of the suppliedsubRequestshould be set tocommitFailed. Setting this error should be avoided under any circumstances.This method is called only once per modified row.
- Specified by:
commitRowin interfaceMOMutableRow2PC<SubRequest<?>>- 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:MOMutableRow2PCPrepares changing a single column.- Specified by:
preparein interfaceMOMutableRow2PC<SubRequest<?>>- 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:MOMutableRow2PCCleans up resources for a row.This method is called only once per modified row.
- Specified by:
cleanupRowin interfaceMOMutableRow2PC<SubRequest<?>>- 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:MOMutableRow2PCUndoes changes to a row.This method is called only once per modified row.
- Specified by:
undoRowin interfaceMOMutableRow2PC<SubRequest<?>>- 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:MOMutableRow2PCPrepares a row for changes described by the supplied change set. If the modification cannot be successfully prepared, the error status of the suppliedsubRequestshould be set to the appropriate error status value.This method is called only once per modified row.
- Specified by:
prepareRowin interfaceMOMutableRow2PC<SubRequest<?>>- 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.
-
toString
public String toString()
- Overrides:
toStringin classDefaultMOTableRow
-
-