Class ArXivImportMetadataSourceServiceImpl
java.lang.Object
org.dspace.importer.external.service.components.AbstractRemoteMetadataSource
org.dspace.importer.external.service.AbstractImportMetadataSourceService<org.jdom2.Element>
org.dspace.importer.external.arxiv.service.ArXivImportMetadataSourceServiceImpl
- All Implemented Interfaces:
MetadataSource,QuerySource
public class ArXivImportMetadataSourceServiceImpl
extends AbstractImportMetadataSourceService<org.jdom2.Element>
implements QuerySource
Implements a data source for querying ArXiv
- Author:
- Pasquale Cavallo (pasquale.cavallo at 4Science dot it)
-
Field Summary
Fields 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) Expect this method will be not used and erased from the interface soonfindMatchingRecords(Query query) Finds records based on query object.Return the baseAddress set to this objectThe string that identifies this import implementation.Get a single record of metadata from the arxiv by ArXiv ID.Get a single record from the ArXiv matching the query.getRecords(String query, int start, int count) Find the number of records matching the query string in ArXiv.getRecords(Query query) Find records based on a object query and convert them to a list metadata mapped in ImportRecord.intgetRecordsCount(String query) Find the number of records matching the query string in ArXiv;intgetRecordsCount(Query query) Find the number of records matching a query; The entry with the key "query" of the Query's map will be used to get the query string.voidinit()Initialize the classvoidsetBaseAddress(String baseAddress) Set the baseAddress to this objectMethods 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
-
Constructor Details
-
ArXivImportMetadataSourceServiceImpl
public ArXivImportMetadataSourceServiceImpl()
-
-
Method Details
-
getRecords
public Collection<ImportRecord> getRecords(String query, int start, int count) throws MetadataSourceException Find the number of records matching the query string in ArXiv. 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 and convert them to a list metadata mapped in ImportRecord. The entry with the key "query" of the Query's map will be used as query string value.- 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.- See Also:
-
getRecordsCount
Find the number of records matching the query string in ArXiv;- 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.
-
getRecordsCount
Find the number of records matching a query; The entry with the key "query" of the Query's map will be used to get the query string.- 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.- See Also:
-
getRecord
Get a single record of metadata from the arxiv by ArXiv ID.- Specified by:
getRecordin interfaceQuerySource- Parameters:
id- id of the record in ArXiv- Returns:
- the first matching record
- Throws:
MetadataSourceException- if the underlying methods throw any exception.
-
getRecord
Get a single record from the ArXiv matching the query. Field "query" will be used to get data from.- Specified by:
getRecordin interfaceQuerySource- Parameters:
query- a query matching a single record- Returns:
- the first matching record
- Throws:
MetadataSourceException- if the underlying methods throw any exception.- See Also:
-
init
Initialize the class- Specified by:
initin classAbstractRemoteMetadataSource- Throws:
Exception- on generic exception
-
getImportSource
The string that identifies this import implementation. Preferable a URI- Specified by:
getImportSourcein interfaceMetadataSource- Returns:
- the identifying uri
-
findMatchingRecords
Expect this method will be not used and erased from the interface soon- 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.
-
findMatchingRecords
Finds records based on query object. Supports search by title and/or author- Specified by:
findMatchingRecordsin interfaceQuerySource- Parameters:
query- a query object to base the search on.- Returns:
- a collection of import records.
- Throws:
MetadataSourceException- if the underlying methods throw any exception.
-
getBaseAddress
Return the baseAddress set to this object- Returns:
- The String object that represents the baseAddress of this object
-
setBaseAddress
Set the baseAddress to this object- Parameters:
baseAddress- The String object that represents the baseAddress of this object
-