org.gcube.common.clients.cache
Interface EndpointCache<A>

Type Parameters:
A - the type of service addresses
All Known Implementing Classes:
DefaultEndpointCache

public interface EndpointCache<A>

A cross-service cache of endpoint addresses used by DiscoveryDelegates.

Author:
Fabio Simeoni
See Also:
Key, DiscoveryDelegate

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
 

Method Detail

clear

void clear(Key key)
           throws IllegalArgumentException
Resets the cache for a given Key.

Parameters:
key - the key
Throws:
IllegalArgumentException - if the key is null

get

A get(Key key)
      throws IllegalArgumentException
Returns the address cached for a given Key

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

void put(Key Key,
         A address)
         throws IllegalArgumentException
Caches an endpoint address for a given Key

Parameters:
key - the key
address - the address
Throws:
IllegalArgumentException - if the key or the address are null


Copyright © 2012. All Rights Reserved.