org.snmp4j.mp
Class MPv3.Cache

java.lang.Object
  extended by org.snmp4j.mp.MPv3.Cache
Enclosing class:
MPv3

protected static class MPv3.Cache
extends java.lang.Object

The Cache stores state reference information for the MPv3.

Version:
1.0
Author:
Frank Fock

Constructor Summary
protected MPv3.Cache()
           
 
Method Summary
 int addEntry(StateReference entry)
          Adds a StateReference to the cache.
 boolean deleteEntry(PduHandle pduHandle)
          Delete the cache entry with the supplied PduHandle.
 StateReference popEntry(int msgID)
          Pop the cache entry with the supplied ID from the cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MPv3.Cache

protected MPv3.Cache()
Method Detail

addEntry

public int addEntry(StateReference entry)
Adds a StateReference to the cache. The PduHandle of the supplied entry will be set to null while the entry is part of the cache, because the cache uses a WeakHashMap internally which uses the PduHandle as key. When

Parameters:
entry - the state reference to add.
Returns:
SnmpConstants.SNMP_MP_DOUBLED_MESSAGE if the entry already exists and SnmpConstants.SNMP_MP_OK on success.

deleteEntry

public boolean deleteEntry(PduHandle pduHandle)
Delete the cache entry with the supplied PduHandle.

Parameters:
pduHandle - a pduHandle.
Returns:
true if an entry has been deleted, false otherwise.

popEntry

public StateReference popEntry(int msgID)
Pop the cache entry with the supplied ID from the cache.

Parameters:
msgID - a message ID.
Returns:
a CacheEntry instance with the given message ID or null if such an entry cannot be found. If a cache entry is returned, the same is removed from the cache.

Copyright 2005-2010 Frank Fock (SNMP4J.org)

Copyright © 2011 SNMP4J.org. All Rights Reserved.