Package org.snmp4j.mp
Class MPv3.Cache
java.lang.Object
org.snmp4j.mp.MPv3.Cache
- Enclosing class:
MPv3
The
Cache stores state reference information for the MPv3.- Version:
- 1.0
- Author:
- Frank Fock
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintaddEntry(StateReference<?> entry) Adds aStateReferenceto the cache.booleandeleteEntry(PduHandle pduHandle) Delete the cache entry with the suppliedPduHandle.Pop the cache entry with the supplied ID from the cache.
-
Constructor Details
-
Cache
protected Cache()
-
-
Method Details
-
addEntry
Adds aStateReferenceto the cache. ThePduHandleof the supplied entry will be set tonullwhen the new entry is already part of the cache, because the cache uses aWeakHashMapinternally which uses thePduHandleas key. If the new entry equals an existing entry except of the message ID then the new message ID will be added to the existing entry.- Parameters:
entry- the state reference to add.- Returns:
SnmpConstants.SNMP_MP_DOUBLED_MESSAGEif the entry already exists andSnmpConstants.SNMP_MP_OKon success.
-
deleteEntry
Delete the cache entry with the suppliedPduHandle.- Parameters:
pduHandle- a pduHandle.- Returns:
trueif an entry has been deleted,falseotherwise.
-
popEntry
Pop the cache entry with the supplied ID from the cache.- Parameters:
messageID- a message ID.- Returns:
- a
MPv3.CacheEntryinstance with the given message ID ornullif such an entry cannot be found. If a cache entry is returned, the same is removed from the cache.
-