Class MinimalPublicationEnricher
- java.lang.Object
-
- psidev.psi.mi.jami.enricher.impl.AbstractMIEnricher<Publication>
-
- psidev.psi.mi.jami.enricher.impl.minimal.MinimalPublicationEnricher
-
- All Implemented Interfaces:
MIEnricher<Publication>,PublicationEnricher
- Direct Known Subclasses:
FullPublicationEnricher,MinimalPublicationUpdater
public class MinimalPublicationEnricher extends AbstractMIEnricher<Publication> implements PublicationEnricher
Provides minimal enrichment of Publication. - enrich identifiers (pubmed, doi, etc.) of a publication. It will use DefaultXrefComparator to compare identifiers and add missing identifiers without removing any existing identifiers. - enrich authors of a publication. It will add all missing authors but will not remove any existing authors - enrich publication date. It will only enrich the publication date if it is not already set in the publication to enrich. It will not override any existing publication date It will ignore all other properties of a publication- Since:
- 31/07/13
- Author:
- Gabriel Aldam (galdam@ebi.ac.uk)
-
-
Constructor Summary
Constructors Constructor Description MinimalPublicationEnricher(PublicationFetcher fetcher)The only constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidenrich(Publication publicationToEnrich, Publication publicationFetched)enrich.Publicationfind(Publication publicationToEnrich)find.PublicationEnricherListenergetPublicationEnricherListener()Gets the current publication listenerPublicationFetchergetPublicationFetcher()Gets the publication fetcher which is currently being used to retrieve entriesintgetRetryCount()Getter for the fieldretryCount.protected voidonEnrichedVersionNotFound(Publication publicationToEnrich)onEnrichedVersionNotFound.protected voidprocessAuthors(Publication publicationToEnrich, Publication fetched)processAuthors.protected voidprocessIdentifiers(Publication publicationToEnrich, Publication fetched)processIdentifiers.protected voidprocessOtherProperties(Publication publicationToEnrich, Publication fetchedPublication)processOtherProperties.voidprocessPublication(Publication publicationToEnrich, Publication fetchedPublication)The strategy for the enrichment of the publication.protected voidprocessPublicationDate(Publication publicationToEnrich, Publication fetched)processPublicationDate.voidsetPublicationEnricherListener(PublicationEnricherListener listener)setPublicationEnricherListener.voidsetRetryCount(int retryCount)Setter for the fieldretryCount.-
Methods inherited from class psidev.psi.mi.jami.enricher.impl.AbstractMIEnricher
enrich, enrich
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface psidev.psi.mi.jami.enricher.MIEnricher
enrich, enrich
-
-
-
-
Constructor Detail
-
MinimalPublicationEnricher
public MinimalPublicationEnricher(PublicationFetcher fetcher)
The only constructor. It requires a publication fetcher. If the publication fetcher is null, an illegal state exception will be thrown at the next enrichment.- Parameters:
fetcher- The PublicationFetcher to use.
-
-
Method Detail
-
getPublicationFetcher
public PublicationFetcher getPublicationFetcher()
Gets the publication fetcher which is currently being used to retrieve entries- Specified by:
getPublicationFetcherin interfacePublicationEnricher- Returns:
- the current publication fetcher.
-
setPublicationEnricherListener
public void setPublicationEnricherListener(PublicationEnricherListener listener)
setPublicationEnricherListener.
Sets the listener to report publication changes to. Can be null.- Specified by:
setPublicationEnricherListenerin interfacePublicationEnricher- Parameters:
listener- aPublicationEnricherListenerobject.
-
getPublicationEnricherListener
public PublicationEnricherListener getPublicationEnricherListener()
Gets the current publication listener- Specified by:
getPublicationEnricherListenerin interfacePublicationEnricher- Returns:
- the current publication listener
-
getRetryCount
public int getRetryCount()
Getter for the field
retryCount.- Returns:
- a int.
-
setRetryCount
public void setRetryCount(int retryCount)
Setter for the field
retryCount.- Parameters:
retryCount- a int.
-
processPublication
public void processPublication(Publication publicationToEnrich, Publication fetchedPublication) throws EnricherException
The strategy for the enrichment of the publication. This methods can be overwritten to change the behaviour of the enrichment.- Parameters:
publicationToEnrich- The publication which is being enriched.fetchedPublication- aPublicationobject.- Throws:
EnricherException- if any.
-
processOtherProperties
protected void processOtherProperties(Publication publicationToEnrich, Publication fetchedPublication) throws EnricherException
processOtherProperties.
- Parameters:
publicationToEnrich- aPublicationobject.fetchedPublication- aPublicationobject.- Throws:
EnricherException- if any.
-
processPublicationDate
protected void processPublicationDate(Publication publicationToEnrich, Publication fetched) throws EnricherException
processPublicationDate.
- Parameters:
publicationToEnrich- aPublicationobject.fetched- aPublicationobject.- Throws:
EnricherException- if any.
-
processAuthors
protected void processAuthors(Publication publicationToEnrich, Publication fetched) throws EnricherException
processAuthors.
- Parameters:
publicationToEnrich- aPublicationobject.fetched- aPublicationobject.- Throws:
EnricherException- if any.
-
processIdentifiers
protected void processIdentifiers(Publication publicationToEnrich, Publication fetched) throws EnricherException
processIdentifiers.
- Parameters:
publicationToEnrich- aPublicationobject.fetched- aPublicationobject.- Throws:
EnricherException- if any.
-
find
public Publication find(Publication publicationToEnrich) throws EnricherException
find.
- Specified by:
findin classAbstractMIEnricher<Publication>- Parameters:
publicationToEnrich- a T object.- Returns:
- a T object.
- Throws:
EnricherException- if any.
-
onEnrichedVersionNotFound
protected void onEnrichedVersionNotFound(Publication publicationToEnrich) throws EnricherException
onEnrichedVersionNotFound.
- Specified by:
onEnrichedVersionNotFoundin classAbstractMIEnricher<Publication>- Parameters:
publicationToEnrich- a T object.- Throws:
EnricherException- if any.
-
enrich
public void enrich(Publication publicationToEnrich, Publication publicationFetched) throws EnricherException
enrich.
- Specified by:
enrichin interfaceMIEnricher<Publication>- Specified by:
enrichin classAbstractMIEnricher<Publication>- Parameters:
publicationToEnrich- a T object.publicationFetched- a T object.- Throws:
EnricherException- if any.
-
-