org.gcube.common.clients
Interface EndpointCache<E>

All Known Implementing Classes:
BaseEndpointCache

public interface EndpointCache<E>

A cache of service endpoints.

Note that the cache is scope-unaware,i.e. it will maintain endpoints irrespective of the scope in which services may be. Clients that target scoped services should use different caches for different scopes.

Author:
Fabio Simeoni

Method Summary
 void clear()
          Reset the cache.
 void clear(String name)
          Reset the cache for a given service.
 E get(String name)
          Returns the endpoint cached for a given service
 void put(String name, E endpoint)
          Caches the endpoint of a given service
 

Method Detail

clear

void clear()
Reset the cache.


clear

void clear(String name)
           throws IllegalArgumentException
Reset the cache for a given service.

Parameters:
name - the service name
Throws:
IllegalArgumentException - if the name is null

get

E get(String name)
      throws IllegalArgumentException
Returns the endpoint cached for a given service

Parameters:
name - the name of the service
Returns:
the endpoint, or null if there is no endpoint cached for the service
Throws:
IllegalArgumentException - if the name is null

put

void put(String name,
         E endpoint)
         throws IllegalArgumentException
Caches the endpoint of a given service

Parameters:
name - the service name
endpoint - the endpoint
Throws:
IllegalArgumentException - if the name or the endpoint are null


Copyright © 2012. All Rights Reserved.