SnmpProxyCommitter, SnmpProxyReloader, SnmpTransactionStrategypublic class SnmpProxyAdapter extends Object implements SnmpProxyCommitter, SnmpProxyReloader, SnmpTransactionStrategy
SnmpProxyAdapter is the central implementation of the mapping between the
SnmpService and a SnmpProxyObject. The adapter is responsible to map changes
collection by the proxy objects to change sets queued on the SNMP service. In addition,
the adapter provides the mapping of the SNMP values and the corresponding model values.
For read operations, this mapping is actually handled by the proxy objects themselves using
the {}@link VariableBindingMapper} provided by this adapter.| Modifier and Type | Class | Description |
|---|---|---|
protected class |
SnmpProxyAdapter.CommitListenerProxy |
|
protected class |
SnmpProxyAdapter.CommitTask |
|
protected class |
SnmpProxyAdapter.ReloadTask |
| Constructor | Description |
|---|---|
SnmpProxyAdapter(SnmpService snmpService,
org.snmp4j.Target target,
VariableBindingMapper variableBindingMapper) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
addChange(SnmpProxyObject proxyObject,
SnmpValuesChangeSet change) |
Adds a change on the specified proxy object to the queue.
|
TaskId |
commitChanges(SnmpCommitListener commitListener) |
Commit the changes in the current queue asynchronously in the background.
|
SnmpIsolationLevel |
getIsolationLevel() |
Gets the isolation level for this transaction.
|
int |
getNumberOfPendingChanges() |
Gets the total number of changes in the queue (independently of a particular proxy object).
|
protected List<TaskId> |
processReloadQueue(SnmpProxyReloadListener reloadListener) |
|
void |
queueReload(SnmpProxyObject proxyObject) |
Queue a proxy object for reload.
|
List<TaskId> |
reloadQueued(SnmpProxyReloadListener reloadListener) |
Actually reload all queued proxy objects asynchronously in background.
|
List<SnmpValuesChangeSet> |
removeAllChanges(SnmpProxyObject proxyObject) |
Remove all changes for a given proxy object.
|
SnmpValuesChangeSet |
removeLastChangeSet(SnmpProxyObject proxyObject) |
Remove the last change from the queue for the specified proxy object.
|
SnmpValuesChangeSet |
validateChange(SnmpValuesChangeSet change) |
Validate the change set provided.
|
public SnmpProxyAdapter(SnmpService snmpService, org.snmp4j.Target target, VariableBindingMapper variableBindingMapper)
snmpService - the SNMP service to use for reloading and updating SNMP values.target - the target (i.e., address of the SNMP agent) that act as SNMP command responder.variableBindingMapper - the variable binding mapper that maps between model values and SNMP values and vice versa.public SnmpValuesChangeSet validateChange(SnmpValuesChangeSet change)
SnmpProxyCommittervalidateChange in interface SnmpProxyCommitterchange - a change set.true if the change set is valid that is, if all model values in the change can be mapped
(converted) to SNMP values.public void addChange(SnmpProxyObject proxyObject, SnmpValuesChangeSet change)
SnmpProxyCommitteraddChange in interface SnmpProxyCommitterproxyObject - 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.public SnmpValuesChangeSet removeLastChangeSet(SnmpProxyObject proxyObject)
SnmpProxyCommitterremoveLastChangeSet in interface SnmpProxyCommitterproxyObject - the proxy object for which the change to remove was added with
SnmpProxyCommitter.addChange(SnmpProxyObject, SnmpValuesChangeSet).null if there is no such change.public List<SnmpValuesChangeSet> removeAllChanges(SnmpProxyObject proxyObject)
SnmpProxyCommitterremoveAllChanges in interface SnmpProxyCommitterproxyObject - the proxy object for which all changes should be removed from the queue.public TaskId commitChanges(SnmpCommitListener commitListener)
SnmpProxyCommittercommitChanges in interface SnmpProxyCommittercommitListener - a callback listener for commit status events.public int getNumberOfPendingChanges()
SnmpProxyCommittergetNumberOfPendingChanges in interface SnmpProxyCommitterpublic void queueReload(SnmpProxyObject proxyObject)
SnmpProxyReloaderSnmpProxyReloader.reloadQueued(SnmpProxyReloadListener) is called.queueReload in interface SnmpProxyReloaderproxyObject - the proxy object to reload.public List<TaskId> reloadQueued(SnmpProxyReloadListener reloadListener)
SnmpProxyReloaderreloadQueued in interface SnmpProxyReloaderreloadListener - the callback listener which receives updates on the reload process.TaskId instances for the each affected proxy object. If a reload
for a proxy object failed to start (because of network issues or incorrect target definitions),
null is returned for that element.protected List<TaskId> processReloadQueue(SnmpProxyReloadListener reloadListener)
public SnmpIsolationLevel getIsolationLevel()
SnmpTransactionStrategygetIsolationLevel in interface SnmpTransactionStrategyCopyright © 2020 SNMP4J.org. All rights reserved.