java.lang.Object
org.snmp4j.agent.util.TemporaryList<T>
The
TemporaryList
implements a list whose items are automatically removed after a predefined timeout.
When an item is removed by timeout, listener can be called to handle the remove operation.- Author:
- Frank Fock
-
Field Summary
-
Constructor Summary
ConstructorDescriptionTemporaryList
(int timeout) Creates a temporary list with the given timeout in milliseconds. -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
clear()
boolean
int
Get the timeout for requests in this list in milliseconds.iterator()
boolean
void
setTimeout
(int timeout) Set the timeout for requests in this request list in milliseconds.int
size()
-
Field Details
-
DEFAULT_ITEM_TIMEOUT
public static final int DEFAULT_ITEM_TIMEOUT- See Also:
-
-
Constructor Details
-
TemporaryList
public TemporaryList() -
TemporaryList
public TemporaryList(int timeout) Creates a temporary list with the given timeout in milliseconds.- Parameters:
timeout
- the milliseconds to wait before an entry may get removed from this list.
-
-
Method Details
-
add
-
contains
-
remove
-
setTimeout
public void setTimeout(int timeout) Set the timeout for requests in this request list in milliseconds.- Parameters:
timeout
- a timeout value in milliseconds greater than zero.
-
getTimeout
public int getTimeout()Get the timeout for requests in this list in milliseconds.- Returns:
- a timeout greater than zero in milliseconds.
-
iterator
-
size
public int size() -
clear
public void clear()
-