Package org.dspace.orcid.service
Interface OrcidQueueService
-
- All Known Implementing Classes:
OrcidQueueServiceImpl
public interface OrcidQueueServiceService that handles ORCID queue records.- Author:
- Luca Giamminonni (luca.giamminonni at 4science.it)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description longcountByProfileItemId(Context context, UUID profileItemId)Returns the number of records on the OrcidQueue associated with the given profileItemId.OrcidQueuecreate(Context context, Item profileItem, Item entity)Create an OrcidQueue record with the given profileItem and entity.OrcidQueuecreateEntityDeletionRecord(Context context, Item profileItem, String description, String type, String putCode)Create an OrcidQueue record with the given profileItem to delete a record on ORCID related to the given entity type with the given putCode.OrcidQueuecreateEntityInsertionRecord(Context context, Item profileItem, Item entity)Create an OrcidQueue record with the given profileItem and entity to push new data to ORCID.OrcidQueuecreateEntityUpdateRecord(Context context, Item profileItem, Item entity, String putCode)Create an OrcidQueue record with the given profileItem to update a record on ORCID with the given putCode.OrcidQueuecreateProfileDeletionRecord(Context context, Item profile, String description, String recordType, String metadata, String putCode)Create an OrcidQueue record with the profile to remove data from ORCID.OrcidQueuecreateProfileInsertionRecord(Context context, Item profile, String description, String recordType, String metadata)Create an OrcidQueue record with the profile to add data to ORCID.voiddelete(Context context, OrcidQueue orcidQueue)Delete an OrcidQueuevoiddeleteByEntityAndRecordType(Context context, Item entity, String recordType)Delete all the OrcidQueue records with the given entity and record type.voiddeleteById(Context context, Integer id)Delete the OrcidQueue record with the given id.voiddeleteByProfileItemAndRecordType(Context context, Item profileItem, String recordType)Delete all the OrcidQueue records with the given profileItem and record type.OrcidQueuefind(Context context, int id)Get an OrcidQueue from the database.List<OrcidQueue>findAll(Context context)Find all the ORCID queue records.List<OrcidQueue>findByAttemptsLessThan(Context context, int attempts)Get all the OrcidQueue records with attempts less than the given attempts.List<OrcidQueue>findByProfileItemAndEntity(Context context, Item profileItem, Item entity)Get the orcid queue records by the profileItem and entity.List<OrcidQueue>findByProfileItemId(Context context, UUID profileItemId)Get the orcid queue records by the profileItem id.List<OrcidQueue>findByProfileItemId(Context context, UUID profileItemId, Integer limit, Integer offset)Get the orcid queue records by the profileItem id.List<OrcidQueue>findByProfileItemOrEntity(Context context, Item item)Get the OrcidQueue records where the given item is the profileItem OR the entityvoidrecalculateOrcidQueue(Context context, Item profileItem, OrcidEntityType entityType, OrcidEntitySyncPreference preference)Recalculates the ORCID queue records linked to the given profileItem as regards the entities of the given type.voidupdate(Context context, OrcidQueue orcidQueue)Update the OrcidQueue
-
-
-
Method Detail
-
create
OrcidQueue create(Context context, Item profileItem, Item entity) throws SQLException
Create an OrcidQueue record with the given profileItem and entity. The type of operation is calculated based on whether or not the given entity was already pushed to the ORCID registry.- Parameters:
context- DSpace context objectprofileItem- the profileItem itementity- the entity item- Returns:
- the stored record
- Throws:
SQLException- if an SQL error occurs
-
createEntityInsertionRecord
OrcidQueue createEntityInsertionRecord(Context context, Item profileItem, Item entity) throws SQLException
Create an OrcidQueue record with the given profileItem and entity to push new data to ORCID.- Parameters:
context- DSpace context objectprofileItem- the profileItem itementity- the entity item- Returns:
- the stored record
- Throws:
SQLException- if an SQL error occurs
-
createEntityUpdateRecord
OrcidQueue createEntityUpdateRecord(Context context, Item profileItem, Item entity, String putCode) throws SQLException
Create an OrcidQueue record with the given profileItem to update a record on ORCID with the given putCode.- Parameters:
context- DSpace context objectprofileItem- the profileItem itementity- the entity itemputCode- the putCode related to the given entity item- Returns:
- the stored record
- Throws:
SQLException- if an SQL error occurs
-
createEntityDeletionRecord
OrcidQueue createEntityDeletionRecord(Context context, Item profileItem, String description, String type, String putCode) throws SQLException
Create an OrcidQueue record with the given profileItem to delete a record on ORCID related to the given entity type with the given putCode.- Parameters:
context- DSpace context objectprofileItem- the profileItem itemdescription- the orcid queue record descriptiontype- the type of the entity itemputCode- the putCode related to the given entity item- Returns:
- the stored record
- Throws:
SQLException- if an SQL error occurs
-
createProfileInsertionRecord
OrcidQueue createProfileInsertionRecord(Context context, Item profile, String description, String recordType, String metadata) throws SQLException
Create an OrcidQueue record with the profile to add data to ORCID.- Parameters:
context- DSpace context objectprofile- the profile itemdescription- the record descriptionrecordType- the record typemetadata- the metadata signature- Returns:
- the stored record
- Throws:
SQLException- if an SQL error occurs
-
createProfileDeletionRecord
OrcidQueue createProfileDeletionRecord(Context context, Item profile, String description, String recordType, String metadata, String putCode) throws SQLException
Create an OrcidQueue record with the profile to remove data from ORCID.- Parameters:
context- DSpace context objectprofile- the profile itemdescription- the record descriptionrecordType- the record typeputCode- the putCode- Returns:
- the stored record
- Throws:
SQLException- if an SQL error occurs
-
findAll
List<OrcidQueue> findAll(Context context) throws SQLException
Find all the ORCID queue records.- Parameters:
context- DSpace context object- Returns:
- the ORCID queue records
- Throws:
SQLException- if an SQL error occurs
-
findByProfileItemId
List<OrcidQueue> findByProfileItemId(Context context, UUID profileItemId) throws SQLException
Get the orcid queue records by the profileItem id.- Parameters:
context- DSpace context objectprofileItemId- the profileItem item id- Returns:
- the orcid queue records
- Throws:
SQLException- if an SQL error occurs
-
findByProfileItemId
List<OrcidQueue> findByProfileItemId(Context context, UUID profileItemId, Integer limit, Integer offset) throws SQLException
Get the orcid queue records by the profileItem id.- Parameters:
context- DSpace context objectprofileItemId- the profileItem item idlimit- limitoffset- offset- Returns:
- the orcid queue records
- Throws:
SQLException- if an SQL error occurs
-
findByProfileItemAndEntity
List<OrcidQueue> findByProfileItemAndEntity(Context context, Item profileItem, Item entity) throws SQLException
Get the orcid queue records by the profileItem and entity.- Parameters:
context- DSpace context objectprofileItem- the profileItem itementity- the entity item- Returns:
- the found OrcidQueue records
- Throws:
SQLException- if an SQL error occurs
-
findByProfileItemOrEntity
List<OrcidQueue> findByProfileItemOrEntity(Context context, Item item) throws SQLException
Get the OrcidQueue records where the given item is the profileItem OR the entity- Parameters:
context- DSpace context objectitem- the item to search for- Returns:
- the found OrcidQueue records
- Throws:
SQLException- if database error
-
findByAttemptsLessThan
List<OrcidQueue> findByAttemptsLessThan(Context context, int attempts) throws SQLException
Get all the OrcidQueue records with attempts less than the given attempts.- Parameters:
context- DSpace context objectattempts- the maximum value of attempts- Returns:
- the found OrcidQueue records
- Throws:
SQLException- if database error
-
countByProfileItemId
long countByProfileItemId(Context context, UUID profileItemId) throws SQLException
Returns the number of records on the OrcidQueue associated with the given profileItemId.- Parameters:
context- DSpace context objectprofileItemId- the profileItem item id- Returns:
- the record's count
- Throws:
SQLException- if an SQL error occurs
-
deleteById
void deleteById(Context context, Integer id) throws SQLException
Delete the OrcidQueue record with the given id.- Parameters:
context- DSpace context objectid- the id of the record to be deleted- Throws:
SQLException- if an SQL error occurs
-
delete
void delete(Context context, OrcidQueue orcidQueue) throws SQLException
Delete an OrcidQueue- Parameters:
context- DSpace context objectorcidQueue- the orcidQueue record to delete- Throws:
SQLException- if database errorAuthorizeException- if authorization error
-
deleteByEntityAndRecordType
void deleteByEntityAndRecordType(Context context, Item entity, String recordType) throws SQLException
Delete all the OrcidQueue records with the given entity and record type.- Parameters:
context- DSpace context objectentity- the entity itemrecordType- the record type- Throws:
SQLException- if database error occurs
-
deleteByProfileItemAndRecordType
void deleteByProfileItemAndRecordType(Context context, Item profileItem, String recordType) throws SQLException
Delete all the OrcidQueue records with the given profileItem and record type.- Parameters:
context- DSpace context objectprofileItem- the profileItem itemrecordType- the record type- Throws:
SQLException- if database error occurs
-
find
OrcidQueue find(Context context, int id) throws SQLException
Get an OrcidQueue from the database.- Parameters:
context- DSpace context objectid- ID of the OrcidQueue- Returns:
- the OrcidQueue format, or null if the ID is invalid.
- Throws:
SQLException- if database error
-
update
void update(Context context, OrcidQueue orcidQueue) throws SQLException
Update the OrcidQueue- Parameters:
context- contextorcidQueue- the OrcidQueue to update- Throws:
SQLException- if database error
-
recalculateOrcidQueue
void recalculateOrcidQueue(Context context, Item profileItem, OrcidEntityType entityType, OrcidEntitySyncPreference preference) throws SQLException
Recalculates the ORCID queue records linked to the given profileItem as regards the entities of the given type. The recalculation is done based on the preference indicated.- Parameters:
context- contextprofileItem- the profileItementityType- the entity type related to the records to recalculatepreference- the preference value on which to base the recalculation- Throws:
SQLException- if database error
-
-