org.gcube.common.clients.cache
Class DefaultEndpointCache<A>

java.lang.Object
  extended by 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 of EndpointCache.

Author:
Fabio Simeoni
See Also:
DiscoveryDelegate

Constructor Summary
DefaultEndpointCache()
           
 
Method Summary
 void clear(Key key)
          Resets the cache for a given Key.
 A get(Key key)
          Returns the address cached for a given Key
 void put(Key key, A address)
          Caches an endpoint address for a given Key
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultEndpointCache

public DefaultEndpointCache()
Method Detail

clear

public void clear(Key key)
           throws IllegalArgumentException
Description copied from interface: EndpointCache
Resets the cache for a given Key.

Specified by:
clear in interface EndpointCache<A>
Parameters:
key - the key
Throws:
IllegalArgumentException - if the key is null

get

public A get(Key key)
      throws IllegalArgumentException
Description copied from interface: EndpointCache
Returns the address cached for a given Key

Specified by:
get in interface EndpointCache<A>
Parameters:
key - the key
Returns:
the endpoint address, or null if there is no endpoint address cached for the service
Throws:
IllegalArgumentException - if the key is null

put

public void put(Key key,
                A address)
         throws IllegalArgumentException
Description copied from interface: EndpointCache
Caches an endpoint address for a given Key

Specified by:
put in interface EndpointCache<A>
address - the address
Throws:
IllegalArgumentException - if the key or the address are null


Copyright © 2013. All Rights Reserved.