Class EpoImportMetadataSourceServiceImpl
java.lang.Object
org.dspace.importer.external.service.components.AbstractRemoteMetadataSource
org.dspace.importer.external.service.AbstractImportMetadataSourceService<org.jdom2.Element>
org.dspace.importer.external.epo.service.EpoImportMetadataSourceServiceImpl
- All Implemented Interfaces:
MetadataSource,QuerySource
public class EpoImportMetadataSourceServiceImpl
extends AbstractImportMetadataSourceService<org.jdom2.Element>
implements QuerySource
Implements a data source for querying EPO
- Author:
- Pasquale Cavallo (pasquale.cavallo at 4Science dot it)
-
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.The string that identifies this import implementation.Get a single record from the source.Get a single record from the source.getRecords(String query, int start, int count) Gets a set of records matching a query.getRecords(Query query) Find records based on a object query.intgetRecordsCount(String query) Gets the number of records matching a queryintgetRecordsCount(Query query) Gets the number of records matching a queryvoidinit()Attempts to init a sessionprotected Stringlogin()Log to EPO, bearer is valid for 20 minutesvoidsetApplicationNumber(MetadataFieldConfig applicationNumber) voidsetAuthUrl(String authUrl) voidsetConsumerKey(String consumerKey) Set the customer epo keyvoidsetConsumerSecret(String consumerSecret) Set the customer epo secretvoidsetDateFiled(MetadataFieldConfig dateFiled) voidsetSearchUrl(String searchUrl) voidMethods 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
-
APP_NO_DATE_SEPARATOR
- See Also:
-
-
Constructor Details
-
EpoImportMetadataSourceServiceImpl
public EpoImportMetadataSourceServiceImpl()
-
-
Method Details
-
init
Description copied from class:AbstractRemoteMetadataSourceAttempts to init a session- 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
-
setConsumerKey
Set the customer epo key- Parameters:
consumerKey- the customer consumer key
-
getConsumerKey
-
setConsumerSecret
Set the customer epo secret- Parameters:
consumerSecret- the customer epo secret
-
getConsumerSecret
-
setDateFiled
-
getDateFiled
-
setApplicationNumber
-
getApplicationNumber
-
login
Log to EPO, bearer is valid for 20 minutes- Parameters:
consumerKey- The consumer KeyconsumerSecretKey- The consumer secret key- Returns:
- Throws:
IOExceptionorg.apache.http.HttpException
-
getRecordsCount
Description copied from interface:QuerySourceGets the number of records matching a query- Specified by:
getRecordsCountin interfaceQuerySource- Parameters:
query- the query in string format- Returns:
- the number of records matching the query
- Throws:
MetadataSourceException- if the underlying methods throw any exception.
-
getRecordsCount
Description copied from interface:QuerySourceGets the number of records matching a query- Specified by:
getRecordsCountin interfaceQuerySource- Parameters:
query- the query object- Returns:
- the number of records matching the query
- Throws:
MetadataSourceException- if the underlying methods throw any exception.
-
getRecords
public Collection<ImportRecord> getRecords(String query, int start, int count) throws MetadataSourceException Description copied from interface:QuerySourceGets a set of records matching a query. Supports pagination- Specified by:
getRecordsin interfaceQuerySource- 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
Description copied from interface:QuerySourceFind 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.
-
getRecord
Description copied from interface:QuerySourceGet a single record from the source. The first match will be returned- Specified by:
getRecordin interfaceQuerySource- Parameters:
id- identifier for the record- Returns:
- a matching record
- Throws:
MetadataSourceException- if the underlying methods throw any exception.
-
getRecord
Description copied from interface:QuerySourceGet a single record from the source. The first match will be returned- Specified by:
getRecordin interfaceQuerySource- Parameters:
query- a query matching a single record- Returns:
- a matching record
- Throws:
MetadataSourceException- if the underlying methods throw any exception.
-
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.
-
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.
-
setUrl
-
setAuthUrl
-
setSearchUrl
-