public class ImportService extends Object implements Destroyable
| Constructor and Description |
|---|
ImportService()
Constructs an empty ImportService class object
|
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Call destroy on all
Destroyable MetadataSource objects set in this ImportService |
Collection<ImportRecord> |
findMatchingRecords(String uri,
Item item)
Finds records based on an item
Delegates to one or more MetadataSource implementations based on the uri.
|
Collection<ImportRecord> |
findMatchingRecords(String uri,
Query query)
Finds records based on query object.
|
protected Map<String,MetadataSource> |
getImportSources()
Retrieve the importSources set to this class.
|
Collection<String> |
getImportUrls()
Retrieve the importUrls that are set on the importSources .
|
int |
getNbRecords(String uri,
Query query)
Find the number of records matching a query;
|
int |
getNbRecords(String uri,
String query)
Find the number of records matching a string query;
|
ImportRecord |
getRecord(String uri,
Query query)
Get a single record from the source.
|
ImportRecord |
getRecord(String uri,
String id)
Get a single record from a source.
|
Collection<ImportRecord> |
getRecords(String uri,
Query query)
Find the number of records matching a object query.
|
Collection<ImportRecord> |
getRecords(String uri,
String query,
int start,
int count)
Find the number of records matching a string query.
|
protected Collection<MetadataSource> |
matchingImports(String uri)
Utility method to find what import implementations match the imports uri.
|
void |
setImportSources(List<MetadataSource> importSources)
Sets the importsources that will be used to delegate the retrieving and matching of records to
|
protected static final String ANY
public ImportService()
@Autowired(required=false) public void setImportSources(List<MetadataSource> importSources) throws MetadataSourceException
importSources - A list of MetadataSource to set to this serviceMetadataSourceExceptionprotected Map<String,MetadataSource> getImportSources()
protected Collection<MetadataSource> matchingImports(String uri)
uri - the identifier of the import implementation or * for allpublic Collection<ImportRecord> findMatchingRecords(String uri, Item item) throws MetadataSourceException
uri - the identifier of the import implementation or * for allitem - an item to base the search onMetadataSourceException - if the underlying imports throw any exception.public Collection<ImportRecord> findMatchingRecords(String uri, Query query) throws MetadataSourceException
uri - the identifier of the import implementation or * for allquery - a query object to base the search on. The implementation decides how the query is interpreted.MetadataSourceExceptionpublic int getNbRecords(String uri, String query) throws MetadataSourceException
uri - the identifier of the import implementation or * for allquery - a query to base the search onMetadataSourceExceptionpublic int getNbRecords(String uri, Query query) throws MetadataSourceException
uri - the identifier of the import implementation or * for allquery - a query object to base the search on The implementation decides how the query is interpreted.MetadataSourceExceptionpublic Collection<ImportRecord> getRecords(String uri, String query, int start, int count) throws MetadataSourceException
uri - the identifier of the import implementation or * for allquery - a query object to base the search on. The implementation decides how the query is interpreted.start - offset to start atcount - number of records to retrieve.MetadataSourceExceptionpublic Collection<ImportRecord> getRecords(String uri, Query query) throws MetadataSourceException
uri - the identifier of the import implementation or * for allquery - a query object to base the search on. The implementation decides how the query is interpreted.MetadataSourceExceptionpublic ImportRecord getRecord(String uri, String id) throws MetadataSourceException
uri - uri the identifier of the import implementation or * for allid - identifier for the recordMetadataSourceExceptionpublic ImportRecord getRecord(String uri, Query query) throws MetadataSourceException
uri - uri the identifier of the import implementation or * for allquery - a query matching a single recordMetadataSourceExceptionpublic Collection<String> getImportUrls()
public void destroy()
throws Exception
Destroyable MetadataSource objects set in this ImportServicedestroy in interface DestroyableExceptionCopyright © 2022 LYRASIS. All rights reserved.