Interface MetadataSource
-
- All Known Implementing Classes:
AbstractImportMetadataSourceService,PubmedImportMetadataSourceServiceImpl
public interface MetadataSourceCommon interface for all import implementations.- Author:
- Roeland Dillen (roeland at atmire dot com)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Collection<ImportRecord>findMatchingRecords(Item item)Finds records based on an item Delegates to one or more MetadataSource implementations based on the uri.Collection<ImportRecord>findMatchingRecords(Query query)Finds records based on query object.StringgetImportSource()The string that identifies this import implementation.intgetNbRecords(String query)Gets the number of records matching a queryintgetNbRecords(Query query)Gets the number of records matching a queryImportRecordgetRecord(String id)Get a single record from the source.ImportRecordgetRecord(Query query)Get a single record from the source.Collection<ImportRecord>getRecords(String query, int start, int count)Gets a set of records matching a query.Collection<ImportRecord>getRecords(Query query)Find records based on a object query.
-
-
-
Method Detail
-
getNbRecords
int getNbRecords(String query) throws MetadataSourceException
Gets the number of records matching a query- Parameters:
query- the query in string format- Returns:
- the number of records matching the query
- Throws:
MetadataSourceException- if the underlying methods throw any exception.
-
getNbRecords
int getNbRecords(Query query) throws MetadataSourceException
Gets the number of records matching a query- Parameters:
query- the query object- Returns:
- the number of records matching the query
- Throws:
MetadataSourceException- if the underlying methods throw any exception.
-
getRecords
Collection<ImportRecord> getRecords(String query, int start, int count) throws MetadataSourceException
Gets a set of records matching a query. Supports pagination- Parameters:
query- the query. The query will generally be posted 'as is' to the sourcestart- offsetcount- page size- Returns:
- a collection of fully transformed id's
- Throws:
MetadataSourceException- if the underlying methods throw any exception.
-
getRecords
Collection<ImportRecord> getRecords(Query query) throws MetadataSourceException
Find records based on a object query.- Parameters:
query- a query object to base the search on.- Returns:
- a set of records. Fully transformed.
- Throws:
MetadataSourceException- if the underlying methods throw any exception.
-
getRecord
ImportRecord getRecord(String id) throws MetadataSourceException
Get a single record from the source. The first match will be returned- Parameters:
id- identifier for the record- Returns:
- a matching record
- Throws:
MetadataSourceException- if the underlying methods throw any exception.
-
getRecord
ImportRecord getRecord(Query query) throws MetadataSourceException
Get a single record from the source. The first match will be returned- Parameters:
query- a query matching a single record- Returns:
- a matching record
- Throws:
MetadataSourceException- if the underlying methods throw any exception.
-
getImportSource
String getImportSource()
The string that identifies this import implementation. Preferable a URI- Returns:
- the identifying uri
-
findMatchingRecords
Collection<ImportRecord> findMatchingRecords(Item item) throws MetadataSourceException
Finds records based on an item Delegates to one or more MetadataSource implementations based on the uri. Results will be aggregated.- Parameters:
item- an item to base the search on- Returns:
- a collection of import records. Only the identifier of the found records may be put in the record.
- Throws:
MetadataSourceException- if the underlying methods throw any exception.
-
findMatchingRecords
Collection<ImportRecord> findMatchingRecords(Query query) throws MetadataSourceException
Finds records based on query object. Delegates to one or more MetadataSource implementations based on the uri. Results will be aggregated.- Parameters:
query- a query object to base the search on.- Returns:
- a collection of import records. Only the identifier of the found records may be put in the record.
- Throws:
MetadataSourceException- passed through.
-
-