Interface ImexCentralClient

    • Field Detail

      • IC_TEST

        static final String IC_TEST
        Constant IC_TEST="https://imexcentral.org/icentraltest/ws"{trunked}
        See Also:
        Constant Field Values
      • IC_BETA

        static final String IC_BETA
        Constant IC_BETA="https://imexcentral.org/icentralbeta/ws"{trunked}
        See Also:
        Constant Field Values
      • pubmed_regexp

        static final Pattern pubmed_regexp
        Constant pubmed_regexp
      • USER_NOT_AUTHORIZED

        static final int USER_NOT_AUTHORIZED
        Constant USER_NOT_AUTHORIZED=2
        See Also:
        Constant Field Values
      • OPERATION_NOT_VALID

        static final int OPERATION_NOT_VALID
        Constant OPERATION_NOT_VALID=3
        See Also:
        Constant Field Values
      • IDENTIFIER_MISSING

        static final int IDENTIFIER_MISSING
        Constant IDENTIFIER_MISSING=4
        See Also:
        Constant Field Values
      • IDENTIFIER_UNKNOWN

        static final int IDENTIFIER_UNKNOWN
        Constant IDENTIFIER_UNKNOWN=5
        See Also:
        Constant Field Values
      • NO_RECORD_CREATED

        static final int NO_RECORD_CREATED
        Constant NO_RECORD_CREATED=7
        See Also:
        Constant Field Values
      • STATUS_UNKNOWN

        static final int STATUS_UNKNOWN
        Constant STATUS_UNKNOWN=8
        See Also:
        Constant Field Values
      • UNKNOWN_GROUP

        static final int UNKNOWN_GROUP
        Constant UNKNOWN_GROUP=11
        See Also:
        Constant Field Values
      • OPERATION_NOT_SUPPORTED

        static final int OPERATION_NOT_SUPPORTED
        Constant OPERATION_NOT_SUPPORTED=98
        See Also:
        Constant Field Values
      • INTERNAL_SERVER_ERROR

        static final int INTERNAL_SERVER_ERROR
        Constant INTERNAL_SERVER_ERROR=99
        See Also:
        Constant Field Values
    • Method Detail

      • getEndpoint

        String getEndpoint()

        getEndpoint.

        Returns:
        the endpoint of the IMEx central webservice
      • fetchPublicationsByOwner

        Collection<Publication> fetchPublicationsByOwner​(String owner,
                                                         int first,
                                                         int max)
                                                  throws BridgeFailedException
        Collect a list of publications associated with a specific owner. Selects first and last results
        Parameters:
        owner - : login of owner
        first - : first result
        max - : last result
        Returns:
        list of publications associated with this owner, empty list if no results
        Throws:
        BridgeFailedException - if any.
      • fetchPublicationsByStatus

        Collection<Publication> fetchPublicationsByStatus​(String status,
                                                          int first,
                                                          int max)
                                                   throws BridgeFailedException
        Collect a list of publications having a specific status. Selects first and last results
        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

        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
        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

        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
        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
      • updatePublicationAdminUser

        Publication updatePublicationAdminUser​(String identifier,
                                               String source,
                                               Operation operation,
                                               String user)
                                        throws BridgeFailedException
        Update the publication admin user given a valid pubmed identifier and a valid operator. The publication must be registered in IMEx central
        Parameters:
        identifier - a String object.
        source - pubmed, doi or imex
        operation - a Operation object.
        user - a String object.
        Returns:
        the updated record in IMEx central
        Throws:
        BridgeFailedException - if no record found in IMEX central, no pubmed identifiier or unknown user
      • updatePublicationIdentifier

        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
        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
      • createPublication

        void createPublication​(Publication publication)
                        throws BridgeFailedException
        Create a new publication record in IMEx central (not implemented yet in production but can be used in test with the MockImexCentralClient)
        Parameters:
        publication - : the publication to create in IMEx central
        Throws:
        BridgeFailedException - if any.
      • createPublicationById

        Publication createPublicationById​(String identifier,
                                          String source)
                                   throws BridgeFailedException
        Creates a publication given a valid pubmed id.
        Parameters:
        identifier - : valid pubmed id
        source - a String object.
        Returns:
        the newly created record
        Throws:
        BridgeFailedException - if identifier is not valid pubmed or if the pubmed id is already registered in IMEx central
      • fetchPublicationImexAccession

        Publication fetchPublicationImexAccession​(String identifier,
                                                  String source,
                                                  boolean assign)
                                           throws BridgeFailedException
        Create a new IMEx id if requested for a given pubmed id
        Parameters:
        identifier - : a valid pubmed identifier
        source - : a valid source (imex, pubmed or doi)
        assign - : 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