Class NihmsPassClientService
java.lang.Object
org.eclipse.pass.loader.nihms.client.NihmsPassClientService
NIHMS PASS client service deals with interactions with the data via the PASS client and controls local data caches
- Author:
- Karen Hanson
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe field name for the award numberstatic final StringThe field name for the status ref of a deposit.static final StringThe field name for the ISSNstatic final Stringstatic final StringThe field name for the publicationstatic final StringThe field name for the repositorystatic final StringThe field name for the submissionstatic final StringThe field name for the submitter -
Constructor Summary
ConstructorsConstructorDescriptionNihmsPassClientService(PassClient passClient) Constructor that allows a PassClient to be passed in -
Method Summary
Modifier and TypeMethodDescriptionvoidRemove all data from cachecreatePublication(Publication publication) createRepositoryCopy(RepositoryCopy repositoryCopy) Create a new RepositoryCopy in PASScreateSubmission(Submission submission) findJournalByIssn(String issn) Look up Journal ID using ISSNfindMostRecentGrantByAwardNumber(String awardNumber) Searches for Grant record using awardNumber.findNihmsDepositbyNihmsId(String nihmsId) Searches for a Deposit to NIHMS that matches a NihmsIDfindNihmsDepositForSubmission(String submissionId) Searches for a NIHMS Deposit that matches a SubmissionIDFind NIHMS RepositoryCopy record for a publicationIdfindNihmsSubmissionsByPublicationId(String publicationId) Find all Submissions with a publication that are associated with the NIHMS repositoryfindPublicationByDoi(String doi, String pmid) Looks up publication using DOI, call should include pmid so that it can check publication cache first, then checks index for DOIfindPublicationByPmid(String pmid) Looks up publication using PMID, since this is the most reliable field to match.findSubmissionsByPublicationAndUserId(String pubId, String userId) Searches for Submissions matching a specific publication and User Id (Submission.submitter)readDeposit(String depositId) Retrieve full deposit record from databaseRetrieve full grant record from databasereadPublication(String publicationId) Retrieve full publication record from databasereadRepository(String repositoryId) Retrieve repository record from databasereadSubmission(String submissionId) Retrieve full Submission recordbooleanupdateDeposit(Deposit deposit) Update Deposit in PASSbooleanupdatePublication(Publication publication) Update Publication in PASSbooleanupdateRepositoryCopy(RepositoryCopy repositoryCopy) Update RepositoryCopy in PASSbooleanupdateSubmission(Submission submission) Update Submission in PASS
-
Field Details
-
NIHMS_DEP_STATUS_REF_PREFIX
- See Also:
-
ISSNS_FLD
The field name for the ISSN- See Also:
-
SUBMISSION_FLD
The field name for the submission- See Also:
-
DEPOSIT_STATUS_REF_FLD
The field name for the status ref of a deposit.- See Also:
-
REPOSITORY_FLD
The field name for the repository- See Also:
-
AWARD_NUMBER_FLD
The field name for the award number- See Also:
-
PUBLICATION_FLD
The field name for the publication- See Also:
-
SUBMITTER_FLD
The field name for the submitter- See Also:
-
-
Constructor Details
-
NihmsPassClientService
Constructor that allows a PassClient to be passed in- Parameters:
passClient- the PassClient used to persist data
-
-
Method Details
-
clearCache
public void clearCache()Remove all data from cache -
findMostRecentGrantByAwardNumber
Searches for Grant record using awardNumber. Tries this first using the awardNumber as passed in, then again without spaces.- Parameters:
awardNumber- the award number- Returns:
- the grant, or
nullif not found - Throws:
IOException- if there is an error reading the grant from the PassClient
-
findPublicationByPmid
Looks up publication using PMID, since this is the most reliable field to match. Checks publication cache first, then checks index- Parameters:
pmid- the pub med id- Returns:
- the publication, or
nullif it can't be found - Throws:
IOException- if there is an error reading the publication from the PassClient
-
findPublicationByDoi
Looks up publication using DOI, call should include pmid so that it can check publication cache first, then checks index for DOI- Parameters:
doi- the digital object identifierpmid- the pub med id- Returns:
- the publication, or
nullif it can't be found - Throws:
IOException- if there is an error reading the publication from the PassClient
-
findNihmsRepositoryCopyForPubId
Find NIHMS RepositoryCopy record for a publicationId- Parameters:
pubId- the publication id- Returns:
- the repository copy, or
nullif it can't be found - Throws:
IOException- if there is an error reading the repository copy
-
findSubmissionsByPublicationAndUserId
public List<Submission> findSubmissionsByPublicationAndUserId(String pubId, String userId) throws IOException Searches for Submissions matching a specific publication and User Id (Submission.submitter)- Parameters:
pubId- the publication iduserId- the user id- Returns:
- the submissions, may be empty but never
null - Throws:
IOException- if there is an error reading the submissions
-
findJournalByIssn
Look up Journal ID using ISSN- Parameters:
issn- the issn- Returns:
- the journal ID for the ISSN, may be
nullif not found - Throws:
IOException- if there is an error reading the journal
-
findNihmsDepositForSubmission
Searches for a NIHMS Deposit that matches a SubmissionID- Parameters:
submissionId- the submission id- Returns:
- the deposit associated with the submission, may be
nullif not found - Throws:
IOException- if there is an error reading the deposit
-
findNihmsDepositbyNihmsId
Searches for a Deposit to NIHMS that matches a NihmsID- Parameters:
nihmsId- the NihmsId- Returns:
- the deposit associated with the submission with the submission and submission publication
properties inflated, may be
nullif not found - Throws:
IOException- if there is an error reading the deposit
-
findNihmsSubmissionsByPublicationId
public List<Submission> findNihmsSubmissionsByPublicationId(String publicationId) throws IOException Find all Submissions with a publication that are associated with the NIHMS repository- Throws:
IOException
-
readGrant
Retrieve full grant record from database- Parameters:
grantId- the grant id- Returns:
- Grant if found, or null if not found
- Throws:
IOException- if there is an error reading the grant
-
readPublication
Retrieve full publication record from database- Parameters:
publicationId- the publication id- Returns:
- Publication if found, or null if not found
- Throws:
IOException- if there is an error reading the publication
-
readSubmission
Retrieve full Submission record- Parameters:
submissionId- the submission id- Returns:
- matching submission or null if none found
- Throws:
IOException- if there is an error reading the submission
-
readDeposit
Retrieve full deposit record from database- Parameters:
depositId- the deposit id- Returns:
- the deposit, or null if not found
- Throws:
IOException- if there is an error reading the deposit
-
readRepository
Retrieve repository record from database- Parameters:
repositoryId- the repository id- Returns:
- the deposit, or null if not found
- Throws:
IOException- if there is an error reading the Repository
-
createPublication
- Parameters:
publication- the publication- Returns:
- the uri of the created publication
- Throws:
IOException- if there is an error creating the publication
-
createSubmission
- Parameters:
submission- the submission- Returns:
- the entity ID of the created submission
- Throws:
IOException- if there is an error creating the submission
-
createRepositoryCopy
Create a new RepositoryCopy in PASS- Parameters:
repositoryCopy- the repository copy- Returns:
- the entity ID of the created repository copy
- Throws:
IOException- if unable to create repository copy
-
updatePublication
Update Publication in PASS- Parameters:
publication- the publication- Returns:
- true if record needed to be updated, false if no update
- Throws:
IOException- if unable to update publication
-
updateSubmission
Update Submission in PASS- Parameters:
submission- the submission- Returns:
- true if record needed to be updated, false if no update
- Throws:
IOException- if unable to update submission
-
updateRepositoryCopy
Update RepositoryCopy in PASS- Parameters:
repositoryCopy- the repository copy- Returns:
- true if record needed to be updated, false if no update
- Throws:
IOException- if unable to update repository copy
-
updateDeposit
Update Deposit in PASS- Parameters:
deposit- the deposit- Returns:
- true if record needed to be updated, false if no update
- Throws:
IOException- if unable to update deposit
-