Package com.amazonaws.util
Class ResponseMetadataCache
java.lang.Object
com.amazonaws.util.ResponseMetadataCache
Cache of response metadata for recently executed requests for diagnostic
purposes. This cache has a max size and as entries are added, the oldest
entry is aged out once the max size has been reached.
-
Constructor Summary
ConstructorsConstructorDescriptionResponseMetadataCache
(int maxEntries) Creates a new cache that will contain, at most the specified number of entries. -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(Object obj, ResponseMetadata metadata) Adds a new entry to this cache, possibly evicting the oldest entry if the cache is at its size limit.Returns the response metadata associated with the specified object, or null if no metadata is associated with that object.
-
Constructor Details
-
ResponseMetadataCache
public ResponseMetadataCache(int maxEntries) Creates a new cache that will contain, at most the specified number of entries.- Parameters:
maxEntries
- The maximum size of this cache.
-
-
Method Details
-
add
Adds a new entry to this cache, possibly evicting the oldest entry if the cache is at its size limit.- Parameters:
obj
- The key by which to store the metadata.metadata
- The metadata for this entry.
-
get
Returns the response metadata associated with the specified object, or null if no metadata is associated with that object.- Parameters:
obj
- The key by which the desired metadata is stored.- Returns:
- The response metadata associated with the given object key, otherwise null if no metadata is associated with that object.
-