Package org.dspace.orcid.service
Interface OrcidHistoryService
- All Known Implementing Classes:
OrcidHistoryServiceImpl
public interface OrcidHistoryService
Interface of service to manage OrcidHistory.
- Author:
- Mykhaylo Boychuk (mykhaylo.boychuk at 4science.it), Luca Giamminonni (luca.giamminonni at 4science.it)
-
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 item) 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.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
-
Method Details
-
find
Get an OrcidHistory from the database.- 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
Find all the ORCID history records.- Parameters:
context- DSpace context object- Returns:
- the ORCID history records
- Throws:
SQLException- if an SQL error occurs
-
findByProfileItemOrEntity
Get the OrcidHistory records where the given item is the profile item OR the entity- Parameters:
context- DSpace context objectitem- the item to search for- Returns:
- the found OrcidHistory entities
- Throws:
SQLException- if database error
-
findByEntity
Find the OrcidHistory records related to the given entity item.- Parameters:
context- DSpace context objectentity- the entity item- Returns:
- the found put codes
- Throws:
SQLException- if database error
-
create
Create a new OrcidHistory records related to the given profileItem and entity items.- Parameters:
context- DSpace context objectprofileItem- the profileItem itementity- the entity item- Returns:
- the created orcid history record
- Throws:
SQLException- if database error
-
delete
Delete an OrcidHistory- Parameters:
context- contextorcidHistory- the OrcidHistory entity to delete- Throws:
SQLException- if database error
-
update
Update the OrcidHistory- Parameters:
context- contextorcidHistory- the OrcidHistory entity to update- Throws:
SQLException- if database error
-
findLastPutCode
Optional<String> findLastPutCode(Context context, Item profileItem, Item entity) throws SQLException Find the last put code related to the given profileItem and entity item.- Parameters:
context- DSpace context objectprofileItem- the profileItem itementity- the entity item- Returns:
- the found put code, if any
- Throws:
SQLException- if database error
-
findLastPutCodes
Find all the last put code related to the entity item each associated with the profileItem to which it refers.- Parameters:
context- DSpace context objectentity- the entity item- Returns:
- a map that relates the profileItems with the identified putCode
- Throws:
SQLException- if database error
-
findSuccessfullyRecordsByEntityAndType
List<OrcidHistory> findSuccessfullyRecordsByEntityAndType(Context context, Item entity, String recordType) throws SQLException Find 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.- Parameters:
context- DSpace context objectentity- the entity itemrecordType- the record type- Returns:
- the found orcid history records
- Throws:
SQLException- if database error
-
synchronizeWithOrcid
OrcidHistory synchronizeWithOrcid(Context context, OrcidQueue orcidQueue, boolean forceAddition) throws SQLException, OrcidValidationException Synchronize the entity related to the given orcidQueue record with ORCID.- 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 errorOrcidValidationException- if the data to synchronize with ORCID is not valid
-