Package org.dspace.orcid.service
Interface OrcidHistoryService
-
- All Known Implementing Classes:
OrcidHistoryServiceImpl
public interface OrcidHistoryServiceInterface of service to manage OrcidHistory.- Author:
- Mykhaylo Boychuk (mykhaylo.boychuk at 4science.it), Luca Giamminonni (luca.giamminonni at 4science.it)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description OrcidHistorycreate(Context context, Item profileItem, Item entity)Create a new OrcidHistory records related to the given profileItem and entity items.voiddelete(Context context, OrcidHistory orcidHistory)Delete an OrcidHistoryOrcidHistoryfind(Context context, int id)Get an OrcidHistory from the database.List<OrcidHistory>findAll(Context context)Find all the ORCID history records.List<OrcidHistory>findByEntity(Context context, Item entity)Find the OrcidHistory records related to the given entity item.List<OrcidHistory>findByProfileItemOrEntity(Context context, Item item)Get the OrcidHistory records where the given item is the profile item OR the entityOptional<String>findLastPutCode(Context context, Item profileItem, Item entity)Find the last put code related to the given profileItem and entity item.Map<Item,String>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.List<OrcidHistory>findSuccessfullyRecordsByEntityAndType(Context context, Item entity, String recordType)Find all the successfully Orcid history records with the given record type related to the given entity.OrcidHistorysynchronizeWithOrcid(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 Detail
-
find
OrcidHistory find(Context context, int id) throws SQLException
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
List<OrcidHistory> findAll(Context context) throws SQLException
Find all the ORCID history records.- Parameters:
context- DSpace context object- Returns:
- the ORCID history records
- Throws:
SQLException- if an SQL error occurs
-
findByProfileItemOrEntity
List<OrcidHistory> findByProfileItemOrEntity(Context context, Item item) throws SQLException
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
List<OrcidHistory> findByEntity(Context context, Item entity) throws SQLException
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
OrcidHistory create(Context context, Item profileItem, Item entity) throws SQLException
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
void delete(Context context, OrcidHistory orcidHistory) throws SQLException
Delete an OrcidHistory- Parameters:
context- contextorcidHistory- the OrcidHistory entity to delete- Throws:
SQLException- if database error
-
update
void update(Context context, OrcidHistory orcidHistory) throws SQLException
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
Map<Item,String> findLastPutCodes(Context context, Item entity) throws SQLException
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
-
-