org.gcube.data.oai.tmplugin.repository
Class BaseRepository

java.lang.Object
  extended by org.gcube.data.oai.tmplugin.repository.BaseRepository
All Implemented Interfaces:
Serializable, Repository

public class BaseRepository
extends Object
implements Repository

Default Repository implementation

See Also:
Serialized Form

Constructor Summary
BaseRepository(Request request)
           
 
Method Summary
 String description()
          Returns the description of the repository.
 org.gcube.data.trees.data.Tree get(String id, List<Set> sets)
          Retrieves a Tree with a given identifier from one of a number of sets in the repository.
 org.gcube.data.streams.Stream<org.gcube.data.trees.data.Tree> getAllIn(List<Set> sets)
          Retrieves all trees in a number of sets of the repository.
 List<Set> getSetsWith(List<String> setIds)
          Retrieve sets of the repository with given identifiers
 String metadataFormat()
          
 String name()
          Returns the name of the repository.
 Summary summary(List<Set> sets)
          Returns a Summary of a number of sets of the repository.
 String url()
          Returns the URL of the repository.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseRepository

public BaseRepository(Request request)
               throws Exception
Throws:
Exception
Method Detail

url

public String url()
Returns the URL of the repository.

Specified by:
url in interface Repository
Returns:
the URL

metadataFormat

public String metadataFormat()


name

public String name()
Returns the name of the repository.

Specified by:
name in interface Repository
Returns:
the name

description

public String description()
Returns the description of the repository.

Specified by:
description in interface Repository
Returns:
the description

get

public org.gcube.data.trees.data.Tree get(String id,
                                          List<Set> sets)
                                   throws org.gcube.data.tmf.api.exceptions.UnknownTreeException,
                                          Exception
Retrieves a Tree with a given identifier from one of a number of sets in the repository.

Specified by:
get in interface Repository
Parameters:
id - the identifier
sets - the sets
Returns:
the tree
Throws:
org.gcube.data.tmf.api.exceptions.UnknownTreeException - if there is no tree in the sets with the given identifier
Exception - if the operation fails for any other error

getAllIn

public org.gcube.data.streams.Stream<org.gcube.data.trees.data.Tree> getAllIn(List<Set> sets)
Retrieves all trees in a number of sets of the repository.

Specified by:
getAllIn in interface Repository
Parameters:
sets - the sets
Returns:
the trees

summary

public Summary summary(List<Set> sets)
                throws Exception
Returns a Summary of a number of sets of the repository.

Specified by:
summary in interface Repository
Parameters:
sets - the sets
Returns:
the summary
Throws:
Exception - if the summary cannot be returned

getSetsWith

public List<Set> getSetsWith(List<String> setIds)
Retrieve sets of the repository with given identifiers

Specified by:
getSetsWith in interface Repository
Parameters:
setIds - the identifiers
Returns:
the sets


Copyright © 2013. All Rights Reserved.