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>
public class DefaultEndpointCache<A> extends Object implements EndpointCache<A>
Base implementation ofEndpointCache.- Author:
- Fabio Simeoni
- See Also:
DiscoveryDelegate
-
-
Constructor Summary
Constructors Constructor Description DefaultEndpointCache()
-
-
-
Method Detail
-
clear
public void clear(Key key) throws IllegalArgumentException
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
public A get(Key key) throws IllegalArgumentException
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
public void put(Key key, A address) throws IllegalArgumentException
Description copied from interface:EndpointCacheCaches an endpoint address for a givenKey- Specified by:
putin interfaceEndpointCache<A>address- the address- Throws:
IllegalArgumentException- if the key or the address arenull
-
-