Package org.gcube.common.clients.cache
Class DefaultEndpointCache<A>
java.lang.Object
org.gcube.common.clients.cache.DefaultEndpointCache<A>
- Type Parameters:
A- the type of the service addresses
- All Implemented Interfaces:
EndpointCache<A>
Base implementation of
EndpointCache.- Author:
- Fabio Simeoni
- See Also:
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
DefaultEndpointCache
public DefaultEndpointCache()
-
-
Method Details
-
clear
Description copied from interface:EndpointCacheResets the cache for a givenKey.- Specified by:
clearin interfaceEndpointCache<A>- Parameters:
key- the key- Throws:
IllegalArgumentException- if the key isnull
-
get
Description copied from interface:EndpointCacheReturns the address cached for a givenKey- Specified by:
getin interfaceEndpointCache<A>- Parameters:
key- the key- Returns:
- the endpoint address, or
nullif there is no endpoint address cached for the service - Throws:
IllegalArgumentException- if the key isnull
-
put
Description copied from interface:EndpointCacheCaches an endpoint address for a givenKey- Specified by:
putin interfaceEndpointCache<A>- Parameters:
key- the keyaddress- the address- Throws:
IllegalArgumentException- if the key or the address arenull
-