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 Details

    • find

      OrcidHistory find(Context context, int id) throws SQLException
      Get an OrcidHistory from the database.
      Parameters:
      context - DSpace context object
      id - 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 object
      item - 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 object
      entity - 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 object
      profileItem - the profileItem item
      entity - 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 - context
      orcidHistory - the OrcidHistory entity to delete
      Throws:
      SQLException - if database error
    • update

      void update(Context context, OrcidHistory orcidHistory) throws SQLException
      Update the OrcidHistory
      Parameters:
      context - context
      orcidHistory - 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 object
      profileItem - the profileItem item
      entity - 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 object
      entity - 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 object
      entity - the entity item
      recordType - 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 object
      orcidQueue - the orcid queue record that has the references of the data to be synchronized
      forceAddition - to force the insert on the ORCID registry
      Returns:
      the created orcid history record with the synchronization result
      Throws:
      SQLException - if database error
      OrcidValidationException - if the data to synchronize with ORCID is not valid