Interface StorageContainer<T extends Serializable>
- Type Parameters:
T
- the types of data elements stored
- All Known Subinterfaces:
ReplayCheckerStorageContainer
- All Known Implementing Classes:
InMemoryReplayCheckerStorageContainer
,InMemoryStorageContainer
public interface StorageContainer<T extends Serializable>
An interface defining generic methods for storage.
-
Method Summary
Modifier and TypeMethodDescriptionGets a data element from the container.Gets the "lifetime" of elements held in the container.getName()
Gets the name of the storage container.void
Stores a data element in the container.void
Removes an element from the container.
-
Method Details
-
getName
Gets the name of the storage container.- Returns:
- the storage container name
-
put
Stores a data element in the container.- Parameters:
id
- the unique ID of the elementdata
- the element to store
-
get
Gets a data element from the container.Note that an expired element will never be returned.
- Parameters:
id
- the unique ID of the element- Returns:
- the element, or null if no matching element is available
-
remove
Removes an element from the container.- Parameters:
id
- the unique ID of the element
-
getElementLifetime
Gets the "lifetime" of elements held in the container. Anull
return value means "never expires".- Returns:
- the lifetime, or null for eternal lifetime
-