Class OpenAireImportMetadataSourceServiceImpl
java.lang.Object
org.dspace.importer.external.service.components.AbstractRemoteMetadataSource
org.dspace.importer.external.service.AbstractImportMetadataSourceService<org.jdom2.Element>
org.dspace.importer.external.openaire.service.OpenAireImportMetadataSourceServiceImpl
- All Implemented Interfaces:
MetadataSource,QuerySource
public class OpenAireImportMetadataSourceServiceImpl
extends AbstractImportMetadataSourceService<org.jdom2.Element>
implements QuerySource
Implements a data source for querying OpenAIRE
- Author:
- Pasquale Cavallo (pasquale.cavallo at 4science dot it)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassclassclass -
Field Summary
FieldsFields inherited from class org.dspace.importer.external.service.components.AbstractRemoteMetadataSource
error, exceptionHandlersMap, interRequestTime, lastRequest, lock, maxRetry, operationId, retry, warning -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfindMatchingRecords(Item item) Finds records based on an item Delegates to one or more MetadataSource implementations based on the uri.findMatchingRecords(Query query) Finds records based on query object.Return the baseAddress set to this objectThe string that identifies this import implementation.Get the name of the query param for the rest callThe string that identifies this import implementation.The string that identifies this import implementation.getRecords(String query, int start, int count) Find the number of records matching a string query.getRecords(Query query) Find records based on a object query.intgetRecordsCount(String query) Find the number of records matching a query;intgetRecordsCount(Query query) Find the number of records matching a query;voidinit()Initialize the classvoidsetBaseAddress(String baseAddress) Set the baseAddress to this objectvoidsetQueryParam(String queryParam) Set the name of the query param, this correspond to the index used (title, author)Methods inherited from class org.dspace.importer.external.service.AbstractImportMetadataSourceService
getGenerateQueryForItem, getMetadataFieldMapping, setGenerateQueryForItem, setMetadataFieldMapping, transformSourceRecordsMethods inherited from class org.dspace.importer.external.service.components.AbstractRemoteMetadataSource
getError, getExceptionHandler, getMaxRetry, getOperationId, getRetry, getWarning, handleException, initExceptionHandlers, retry, setError, setInterRequestTime, setMaxRetry, setWarning, throwSourceException, throwSourceExceptionHook
-
Field Details
-
configurationService
-
-
Constructor Details
-
OpenAireImportMetadataSourceServiceImpl
public OpenAireImportMetadataSourceServiceImpl()
-
-
Method Details
-
getImportSource
Description copied from interface:MetadataSourceThe string that identifies this import implementation. Preferable a URI- Specified by:
getImportSourcein interfaceMetadataSource- Returns:
- the identifying uri
-
getRecord
The string that identifies this import implementation. Preferable a URI- Specified by:
getRecordin interfaceQuerySource- Parameters:
id- identifier for the record- Returns:
- the identifying uri
- Throws:
MetadataSourceException- if the underlying methods throw any exception.
-
getRecord
The string that identifies this import implementation. Preferable a URI- Specified by:
getRecordin interfaceQuerySource- Parameters:
query- a query matching a single record- Returns:
- the identifying uri
- Throws:
MetadataSourceException- if the underlying methods throw any exception.
-
getRecordsCount
Find the number of records matching a query;- Specified by:
getRecordsCountin interfaceQuerySource- Parameters:
query- a query string to base the search on.- Returns:
- the sum of the matching records over this import source
- Throws:
MetadataSourceException- if the underlying methods throw any exception.
-
getRecordsCount
Find the number of records matching a query;- Specified by:
getRecordsCountin interfaceQuerySource- Parameters:
query- a query object to base the search on.- Returns:
- the sum of the matching records over this import source
- Throws:
MetadataSourceException- if the underlying methods throw any exception.
-
getRecords
public Collection<ImportRecord> getRecords(String query, int start, int count) throws MetadataSourceException Find the number of records matching a string query. Supports pagination- Specified by:
getRecordsin interfaceQuerySource- Parameters:
query- a query string to base the search on.start- offset to start atcount- number of records to retrieve.- Returns:
- a set of records. Fully transformed.
- Throws:
MetadataSourceException- if the underlying methods throw any exception.
-
getRecords
Find records based on a object query.- Specified by:
getRecordsin interfaceQuerySource- 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.
-
findMatchingRecords
Description copied from interface:QuerySourceFinds records based on query object. Delegates to one or more MetadataSource implementations based on the uri. Results will be aggregated.- Specified by:
findMatchingRecordsin interfaceQuerySource- 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.
-
findMatchingRecords
Description copied from interface:QuerySourceFinds records based on an item Delegates to one or more MetadataSource implementations based on the uri. Results will be aggregated.- Specified by:
findMatchingRecordsin interfaceQuerySource- 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.
-
setBaseAddress
Set the baseAddress to this object- Parameters:
baseAddress- The String object that represents the baseAddress of this object
-
getBaseAddress
Return the baseAddress set to this object- Returns:
- The String object that represents the baseAddress of this object
-
setQueryParam
Set the name of the query param, this correspond to the index used (title, author)- Parameters:
queryParam- on which index make the query
-
getQueryParam
Get the name of the query param for the rest call- Returns:
- the name of the query param, i.e. the index (title, author) to use
-
init
Initialize the class- Specified by:
initin classAbstractRemoteMetadataSource- Throws:
Exception- on generic exception
-