Package org.dspace.orcid.service.impl
Class OrcidHistoryServiceImpl
java.lang.Object
org.dspace.orcid.service.impl.OrcidHistoryServiceImpl
- All Implemented Interfaces:
OrcidHistoryService
Implementation of
OrcidHistoryService.- Author:
- Mykhaylo Boychuk (mykhaylo.boychuk at 4science.it), Luca Giamminonni (luca.giamminonni at 4science.it)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreate a new OrcidHistory records related to the given profileItem and entity items.voiddelete(Context context, OrcidHistory orcidHistory) Delete an OrcidHistoryGet an OrcidHistory from the database.Find all the ORCID history records.findByEntity(Context context, Item entity) Find the OrcidHistory records related to the given entity item.findByProfileItemOrEntity(Context context, Item profileItem) Get the OrcidHistory records where the given item is the profile item OR the entityfindLastPutCode(Context context, Item profileItem, Item entity) Find the last put code related to the given profileItem and entity item.findLastPutCodes(Context context, Item entity) Find all the last put code related to the entity item each associated with the profileItem to which it refers.findSuccessfullyRecordsByEntityAndType(Context context, Item entity, String recordType) Find all the successfully Orcid history records with the given record type related to the given entity.voidsetOrcidClient(OrcidClient orcidClient) synchronizeWithOrcid(Context context, OrcidQueue orcidQueue, boolean forceAddition) Synchronize the entity related to the given orcidQueue record with ORCID.voidupdate(Context context, OrcidHistory orcidHistory) Update the OrcidHistory
-
Constructor Details
-
OrcidHistoryServiceImpl
public OrcidHistoryServiceImpl()
-
-
Method Details
-
find
Description copied from interface:OrcidHistoryServiceGet an OrcidHistory from the database.- Specified by:
findin interfaceOrcidHistoryService- Parameters:
context- DSpace context objectid- ID of the OrcidHistory- Returns:
- the OrcidHistory format, or null if the ID is invalid.
- Throws:
SQLException- if database error
-
findAll
Description copied from interface:OrcidHistoryServiceFind all the ORCID history records.- Specified by:
findAllin interfaceOrcidHistoryService- Parameters:
context- DSpace context object- Returns:
- the ORCID history records
- Throws:
SQLException- if an SQL error occurs
-
findByProfileItemOrEntity
public List<OrcidHistory> findByProfileItemOrEntity(Context context, Item profileItem) throws SQLException Description copied from interface:OrcidHistoryServiceGet the OrcidHistory records where the given item is the profile item OR the entity- Specified by:
findByProfileItemOrEntityin interfaceOrcidHistoryService- Parameters:
context- DSpace context objectprofileItem- the item to search for- Returns:
- the found OrcidHistory entities
- Throws:
SQLException- if database error
-
create
Description copied from interface:OrcidHistoryServiceCreate a new OrcidHistory records related to the given profileItem and entity items.- Specified by:
createin interfaceOrcidHistoryService- Parameters:
context- DSpace context objectprofileItem- the profileItem itementity- the entity item- Returns:
- the created orcid history record
- Throws:
SQLException- if database error
-
delete
Description copied from interface:OrcidHistoryServiceDelete an OrcidHistory- Specified by:
deletein interfaceOrcidHistoryService- Parameters:
context- contextorcidHistory- the OrcidHistory entity to delete- Throws:
SQLException- if database error
-
update
Description copied from interface:OrcidHistoryServiceUpdate the OrcidHistory- Specified by:
updatein interfaceOrcidHistoryService- Parameters:
context- contextorcidHistory- the OrcidHistory entity to update- Throws:
SQLException- if database error
-
findLastPutCode
public Optional<String> findLastPutCode(Context context, Item profileItem, Item entity) throws SQLException Description copied from interface:OrcidHistoryServiceFind the last put code related to the given profileItem and entity item.- Specified by:
findLastPutCodein interfaceOrcidHistoryService- Parameters:
context- DSpace context objectprofileItem- the profileItem itementity- the entity item- Returns:
- the found put code, if any
- Throws:
SQLException- if database error
-
findLastPutCodes
Description copied from interface:OrcidHistoryServiceFind all the last put code related to the entity item each associated with the profileItem to which it refers.- Specified by:
findLastPutCodesin interfaceOrcidHistoryService- Parameters:
context- DSpace context objectentity- the entity item- Returns:
- a map that relates the profileItems with the identified putCode
- Throws:
SQLException- if database error
-
findByEntity
Description copied from interface:OrcidHistoryServiceFind the OrcidHistory records related to the given entity item.- Specified by:
findByEntityin interfaceOrcidHistoryService- Parameters:
context- DSpace context objectentity- the entity item- Returns:
- the found put codes
- Throws:
SQLException- if database error
-
findSuccessfullyRecordsByEntityAndType
public List<OrcidHistory> findSuccessfullyRecordsByEntityAndType(Context context, Item entity, String recordType) throws SQLException Description copied from interface:OrcidHistoryServiceFind all the successfully Orcid history records with the given record type related to the given entity. An history record is considered successful if the status is between 200 and 300.- Specified by:
findSuccessfullyRecordsByEntityAndTypein interfaceOrcidHistoryService- Parameters:
context- DSpace context objectentity- the entity itemrecordType- the record type- Returns:
- the found orcid history records
- Throws:
SQLException- if database error
-
synchronizeWithOrcid
public OrcidHistory synchronizeWithOrcid(Context context, OrcidQueue orcidQueue, boolean forceAddition) throws SQLException Description copied from interface:OrcidHistoryServiceSynchronize the entity related to the given orcidQueue record with ORCID.- Specified by:
synchronizeWithOrcidin interfaceOrcidHistoryService- Parameters:
context- DSpace context objectorcidQueue- the orcid queue record that has the references of the data to be synchronizedforceAddition- to force the insert on the ORCID registry- Returns:
- the created orcid history record with the synchronization result
- Throws:
SQLException- if database error
-
getOrcidClient
-
setOrcidClient
-