org.apache.stanbol.entityhub.servicesapi.yard
Interface YardManager


public interface YardManager

Manages the different active Yards and provides the possibility to lookup/ create Cache instances based on already available Yards.

Author:
Rupert Westenthaler

Method Summary
 Cache getCache(String id)
          Getter for the Cache based on the yard id used to cache the data.
 Collection<String> getCacheIDs()
          Getter for the IDs of Caches currently managed by this Manager
 Yard getYard(String id)
          Getter for the Yard based on the parsed Id
 Collection<String> getYardIDs()
          Getter for the IDs of Yards currently managed by this Manager
 boolean isCache(String id)
          Returns if a Cache with the requested ID is registered.
 boolean isYard(String id)
          Returns if there is a Yard for the parsed ID
 

Method Detail

getYardIDs

Collection<String> getYardIDs()
Getter for the IDs of Yards currently managed by this Manager

Returns:
the Ids of the currently active Yards

isYard

boolean isYard(String id)
Returns if there is a Yard for the parsed ID

Parameters:
id - the id
Returns:
true if a Yard with the parsed ID is managed by this YardManager.

getYard

Yard getYard(String id)
Getter for the Yard based on the parsed Id

Parameters:
id - the ID
Returns:
The Yard or null if no Yard with the parsed ID is active.

getCache

Cache getCache(String id)
Getter for the Cache based on the yard id used to cache the data.

If no cache is present for the parsed yard, than a new instance is created by using the ComponentFactory.

Parameters:
id - the ID of the Yard used to store the data of the cache
Returns:
the cache or null if no Yard with the parsed ID is active.
Throws:
YardException - on any Error while creating a new Cache for the Yard with the parsed id. TODO: replace YardException by a better one. However I do not like to use the ComponentException because it is a runtime exception and would introduce a dependency to OSGI in the ServicesApi bundle

isCache

boolean isCache(String id)
Returns if a Cache with the requested ID is registered. NOTE that a Cache always shares the same ID with the Yard used to store the cached data.

Parameters:
id - the id of the cache (or the Yard used by the Cache)
Returns:
true if a Cache with the parsed ID is managed by this YardManager.

getCacheIDs

Collection<String> getCacheIDs()
Getter for the IDs of Caches currently managed by this Manager

Returns:
the Ids of the currently active Caches


Copyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.