Package org.snmp4j.model.snmp.spi
Interface SnmpProxyCommitter
- All Known Implementing Classes:
SnmpProxyAdapter
public interface SnmpProxyCommitter
Implementations of the
SnmpProxyCommitter
interface commit model changes to the
associated SNMP entity. Changes are committed atomically if they are put within the same change set.
Changes are queued until commitChanges(SnmpCommitListener)
is being called. Then all
queued changes are processed until no changes are left in the queue as it was at the time when
commitChanges(SnmpCommitListener)
has been called.- Author:
- Frank Fock
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addChange
(SnmpProxyObject proxyObject, SnmpValuesChangeSet change) Adds a change on the specified proxy object to the queue.commitChanges
(SnmpCommitListener commitListener) Commit the changes in the current queue asynchronously in the background.int
Gets the total number of changes in the queue (independently of a particular proxy object).removeAllChanges
(SnmpProxyObject proxyObject) Remove all changes for a given proxy object.removeLastChangeSet
(SnmpProxyObject proxyObject) Remove the last change from the queue for the specified proxy object.validateChange
(SnmpValuesChangeSet change) Validate the change set provided.
-
Method Details
-
validateChange
Validate the change set provided.- Parameters:
change
- a change set.- Returns:
true
if the change set is valid that is, if all model values in the change can be mapped (converted) to SNMP values.
-
addChange
Adds a change on the specified proxy object to the queue.- Parameters:
proxyObject
- the proxy object that changed.change
- the values change set that describes the changes that should be applied to the proxy and its remote object.
-
removeLastChangeSet
Remove the last change from the queue for the specified proxy object.- Parameters:
proxyObject
- the proxy object for which the change to remove was added withaddChange(SnmpProxyObject, SnmpValuesChangeSet)
.- Returns:
- the removed change set or
null
if there is no such change.
-
removeAllChanges
Remove all changes for a given proxy object.- Parameters:
proxyObject
- the proxy object for which all changes should be removed from the queue.- Returns:
- the removed changes (could be an empty list).
-
commitChanges
Commit the changes in the current queue asynchronously in the background. Note: changes that are queued after this call returns will not be committed.- Parameters:
commitListener
- a callback listener for commit status events.- Returns:
- the task ID for this commit operation.
-
getNumberOfPendingChanges
int getNumberOfPendingChanges()Gets the total number of changes in the queue (independently of a particular proxy object).- Returns:
- the number of changes in the queue.
-