Package psidev.psi.mi.jami.bridges.imex
Interface ImexCentralClient
-
- All Superinterfaces:
PublicationFetcher
- All Known Implementing Classes:
DefaultImexCentralClient,MockImexCentralClient
public interface ImexCentralClient extends PublicationFetcher
IMEx Central publication fetcher.
-
-
Field Summary
Fields Modifier and Type Field Description static StringIC_BETAConstantIC_BETA="https://imexcentral.org/icentralbeta/ws"{trunked}static StringIC_PRODConstantIC_PROD="https://imexcentral.org/icentral/ws-v20"static StringIC_TESTConstantIC_TEST="https://imexcentral.org/icentraltest/ws"{trunked}static intIDENTIFIER_MISSINGConstantIDENTIFIER_MISSING=4static intIDENTIFIER_UNKNOWNConstantIDENTIFIER_UNKNOWN=5static intINTERNAL_SERVER_ERRORConstantINTERNAL_SERVER_ERROR=99static intNO_IMEX_IDConstantNO_IMEX_ID=9static intNO_RECORDConstantNO_RECORD=6static intNO_RECORD_CREATEDConstantNO_RECORD_CREATED=7static intOPERATION_NOT_SUPPORTEDConstantOPERATION_NOT_SUPPORTED=98static intOPERATION_NOT_VALIDConstantOPERATION_NOT_VALID=3static Patternpubmed_regexpConstantpubmed_regexpstatic intSTATUS_UNKNOWNConstantSTATUS_UNKNOWN=8static intUNKNOWN_GROUPConstantUNKNOWN_GROUP=11static intUNKNOWN_USERConstantUNKNOWN_USER=10static intUSER_NOT_AUTHORIZEDConstantUSER_NOT_AUTHORIZED=2
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcreatePublication(Publication publication)Create a new publication record in IMEx central (not implemented yet in production but can be used in test with the MockImexCentralClient)PublicationcreatePublicationById(String identifier, String source)Creates a publication given a valid pubmed id.PublicationfetchPublicationImexAccession(String identifier, String source, boolean assign)Create a new IMEx id if requested for a given pubmed idCollection<Publication>fetchPublicationsByOwner(String owner, int first, int max)Collect a list of publications associated with a specific owner.Collection<Publication>fetchPublicationsByStatus(String status, int first, int max)Collect a list of publications having a specific status.StringgetEndpoint()getEndpoint.PublicationupdatePublicationAdminGroup(String identifier, String source, Operation operation, String group)Update the publication admin group given a valid pubmed identifier and a valid operator.PublicationupdatePublicationAdminUser(String identifier, String source, Operation operation, String user)Update the publication admin user given a valid pubmed identifier and a valid operator.PublicationupdatePublicationIdentifier(String oldIdentifier, String oldSource, String newIdentifier, String source)Update publication pubmed identifier, DOI number or internal identifier of an existing record in IMEx central.PublicationupdatePublicationStatus(String identifier, String source, PublicationStatus status)Update the status of a publication associated with a valid pubmed identifier already registered in IMEx central-
Methods inherited from interface psidev.psi.mi.jami.bridges.fetcher.PublicationFetcher
fetchByIdentifier, fetchByIdentifiers
-
-
-
-
Field Detail
-
IC_TEST
static final String IC_TEST
ConstantIC_TEST="https://imexcentral.org/icentraltest/ws"{trunked}- See Also:
- Constant Field Values
-
IC_BETA
static final String IC_BETA
ConstantIC_BETA="https://imexcentral.org/icentralbeta/ws"{trunked}- See Also:
- Constant Field Values
-
IC_PROD
static final String IC_PROD
ConstantIC_PROD="https://imexcentral.org/icentral/ws-v20"- See Also:
- Constant Field Values
-
pubmed_regexp
static final Pattern pubmed_regexp
Constantpubmed_regexp
-
USER_NOT_AUTHORIZED
static final int USER_NOT_AUTHORIZED
ConstantUSER_NOT_AUTHORIZED=2- See Also:
- Constant Field Values
-
OPERATION_NOT_VALID
static final int OPERATION_NOT_VALID
ConstantOPERATION_NOT_VALID=3- See Also:
- Constant Field Values
-
IDENTIFIER_MISSING
static final int IDENTIFIER_MISSING
ConstantIDENTIFIER_MISSING=4- See Also:
- Constant Field Values
-
IDENTIFIER_UNKNOWN
static final int IDENTIFIER_UNKNOWN
ConstantIDENTIFIER_UNKNOWN=5- See Also:
- Constant Field Values
-
NO_RECORD
static final int NO_RECORD
ConstantNO_RECORD=6- See Also:
- Constant Field Values
-
NO_RECORD_CREATED
static final int NO_RECORD_CREATED
ConstantNO_RECORD_CREATED=7- See Also:
- Constant Field Values
-
STATUS_UNKNOWN
static final int STATUS_UNKNOWN
ConstantSTATUS_UNKNOWN=8- See Also:
- Constant Field Values
-
NO_IMEX_ID
static final int NO_IMEX_ID
ConstantNO_IMEX_ID=9- See Also:
- Constant Field Values
-
UNKNOWN_USER
static final int UNKNOWN_USER
ConstantUNKNOWN_USER=10- See Also:
- Constant Field Values
-
UNKNOWN_GROUP
static final int UNKNOWN_GROUP
ConstantUNKNOWN_GROUP=11- See Also:
- Constant Field Values
-
OPERATION_NOT_SUPPORTED
static final int OPERATION_NOT_SUPPORTED
ConstantOPERATION_NOT_SUPPORTED=98- See Also:
- Constant Field Values
-
INTERNAL_SERVER_ERROR
static final int INTERNAL_SERVER_ERROR
ConstantINTERNAL_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 ownerfirst- : first resultmax- : 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 centralfirst- : first resultmax- : 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 identifiersource- : the source pubmed, doi or imexstatus- : 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 idsource- : the source pubmed, doi or imexoperation- : DROP or ADDgroup- : 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- aStringobject.source- pubmed, doi or imexoperation- aOperationobject.user- aStringobject.- 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 identifieroldSource- : the source of old identifiernewIdentifier- : can be pubmed, doi or internal identifiersource- : the source pubmed, doi or imex- Returns:
- a
Publicationobject. - 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 idsource- aStringobject.- 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 identifiersource- : 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
-
-