Class DefaultImexCentralClient

    • Method Detail

      • fetchPublicationsByStatus

        public List<Publication> fetchPublicationsByStatus​(String status,
                                                           int first,
                                                           int max)
                                                    throws BridgeFailedException
        Collect a list of publications having a specific status. Selects first and last results
        Specified by:
        fetchPublicationsByStatus in interface ImexCentralClient
        Parameters:
        status - : the status of publication in IMEx central
        first - : first result
        max - : last result
        Returns:
        list of publications associated with this status, empty list if no results
        Throws:
        BridgeFailedException - if any.
      • updatePublicationStatus

        public Publication updatePublicationStatus​(String identifier,
                                                   String source,
                                                   PublicationStatus status)
                                            throws BridgeFailedException
        Update the status of a publication associated with a valid pubmed identifier already registered in IMEx central
        Specified by:
        updatePublicationStatus in interface ImexCentralClient
        Parameters:
        identifier - : a valid pubmed identifier
        source - : the source pubmed, doi or imex
        status - : new status
        Returns:
        the updated record in IMEx central
        Throws:
        BridgeFailedException - if no record found in IMEx central, no pubmed identifier or invalid status
      • updatePublicationAdminGroup

        public Publication updatePublicationAdminGroup​(String identifier,
                                                       String source,
                                                       Operation operation,
                                                       String group)
                                                throws BridgeFailedException
        Update the publication admin group given a valid pubmed identifier and a valid operator. The publication must be registered in IMEx central
        Specified by:
        updatePublicationAdminGroup in interface ImexCentralClient
        Parameters:
        identifier - : valid pubmed id
        source - : the source pubmed, doi or imex
        operation - : DROP or ADD
        group - : the name of the admin group
        Returns:
        the updated record in IMEx central
        Throws:
        BridgeFailedException - if no record found in IMEX central, no pubmed identifiier or unknown group
      • updatePublicationIdentifier

        public Publication updatePublicationIdentifier​(String oldIdentifier,
                                                       String oldSource,
                                                       String newIdentifier,
                                                       String source)
                                                throws BridgeFailedException
        Update publication pubmed identifier, DOI number or internal identifier of an existing record in IMEx central. The new publication identifier should not be already registered in IMEx central
        Specified by:
        updatePublicationIdentifier in interface ImexCentralClient
        Parameters:
        oldIdentifier - : can be pubmed, imex, doi or internal identifier
        oldSource - : the source of old identifier
        newIdentifier - : can be pubmed, doi or internal identifier
        source - : the source pubmed, doi or imex
        Returns:
        a Publication object.
        Throws:
        BridgeFailedException - if no record found in IMEX central, identifier not recognized or new identifier is associated with another publication in IMEx central
      • fetchPublicationImexAccession

        public Publication fetchPublicationImexAccession​(String identifier,
                                                         String source,
                                                         boolean aBoolean)
                                                  throws BridgeFailedException
        Create a new IMEx id if requested for a given pubmed id
        Specified by:
        fetchPublicationImexAccession in interface ImexCentralClient
        Parameters:
        identifier - : a valid pubmed identifier
        source - : a valid source (imex, pubmed or doi)
        aBoolean - : true if we want to assign a new IMEx id, false otherwise
        Returns:
        the updated record in IMEx central
        Throws:
        BridgeFailedException - if not a valid pubmed id, not existing record and cannot generate a new IMEx id
      • fetchByIdentifier

        public Publication fetchByIdentifier​(String identifier,
                                             String source)
                                      throws BridgeFailedException
        Uses the identifier to search for a publication and return a completed record.
        Specified by:
        fetchByIdentifier in interface PublicationFetcher
        Parameters:
        identifier - The identifier of the publication to search for.
        source - The database that the identifier is from (pubmed, doi, ...).
        Returns:
        A completed record for the publication or null if no publication could be found.
        Throws:
        BridgeFailedException - if any.