com.googlecode.sarasvati.load
Interface GraphRepository<T extends Graph>

All Known Implementing Classes:
HibGraphRepository, MemGraphRepository

public interface GraphRepository<T extends Graph>

The graph repository is an engine specific way of accessing instances of Graph which have been loaded. A database backed engine would provide a repository which queried the database, while a memory backed engine would use some memory cache. Other implementation are possible, such as a file backed repository.

Author:
Paul Lorenz

Method Summary
 void addGraph(T graph)
          Adds a graph to the repository.
 List<T> getGraphs()
          Returns all graphs accessible via this repository.
 List<T> getGraphs(String name)
          Returns all graphs with the given name.
 T getLatestGraph(String name)
          Returns The newest Graph with the given name, or null if none is found.
 

Method Detail

getLatestGraph

T getLatestGraph(String name)
Returns The newest Graph with the given name, or null if none is found.

Parameters:
name - The graph name
Returns:
The newest Graph with the given name, or null if none is found.

getGraphs

List<T> getGraphs(String name)
Returns all graphs with the given name.

Parameters:
name - The name to match
Returns:
All graphs with the given name

getGraphs

List<T> getGraphs()
Returns all graphs accessible via this repository.

Returns:
All graphs accessible via this repository.

addGraph

void addGraph(T graph)
Adds a graph to the repository. Used by the GraphLoader.

Parameters:
graph - The graph to add to the repository.