Interface OrcidQueueService

  • All Known Implementing Classes:
    OrcidQueueServiceImpl

    public interface OrcidQueueService
    Service that handles ORCID queue records.
    Author:
    Luca Giamminonni (luca.giamminonni at 4science.it)
    • 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 object
        profileItem - the profileItem item
        entity - 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 object
        profileItem - the profileItem item
        entity - 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 object
        profileItem - the profileItem item
        entity - the entity item
        putCode - 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 object
        profileItem - the profileItem item
        description - the orcid queue record description
        type - the type of the entity item
        putCode - 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 object
        profile - the profile item
        description - the record description
        recordType - the record type
        metadata - 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 object
        profile - the profile item
        description - the record description
        recordType - the record type
        putCode - 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 object
        profileItemId - 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 object
        profileItemId - the profileItem item id
        limit - limit
        offset - 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 object
        profileItem - the profileItem item
        entity - 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 object
        item - 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 object
        attempts - 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 object
        profileItemId - 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 object
        id - the id of the record to be deleted
        Throws:
        SQLException - if an SQL error occurs
      • 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 object
        entity - the entity item
        recordType - 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 object
        profileItem - the profileItem item
        recordType - 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 object
        id - 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 - context
        orcidQueue - 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 - context
        profileItem - the profileItem
        entityType - the entity type related to the records to recalculate
        preference - the preference value on which to base the recalculation
        Throws:
        SQLException - if database error