Interface PreboardedExperimentService
- All Known Implementing Classes:
PreboardedExperimentServiceImpl
PreboardedExperiment CRUD + accession resolution
+ promotion. See HANDOFF_PROPOSED_EXPERIMENT_WORKFLOW.md §"Required
endpoints".-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classThrown bycreatePreboarded(String, String, String)when an existing entity carries the same accession.static classThrown bypromote(ExpressionExperiment, PreboardedExperiment)when the preboarded has already been promoted.static classReturn value ofpromote(ExpressionExperiment, PreboardedExperiment). -
Method Summary
Modifier and TypeMethodDescriptioncreatePreboarded(String accession, String source, String identifyingMetadata) Create a new preboarded for the given accession.findAllByAccession(String accession) findByAccession(String accession) findExpressionExperimentByAccession(String accession) Look up an existingExpressionExperimentcarrying the given accession.loadAccessions(Collection<Long> ids) Accessions for a set of preboarded ids, in ONE query.promote(ExpressionExperiment ee, PreboardedExperiment preboarded) Promote the preboarded to a loadedExpressionExperiment.
-
Method Details
-
createPreboarded
PreboardedExperiment createPreboarded(String accession, @Nullable String source, @Nullable String identifyingMetadata) throws PreboardedExperimentService.AccessionAlreadyExistsException Create a new preboarded for the given accession.Throws
PreboardedExperimentService.AccessionAlreadyExistsExceptionif an existingPreboardedExperimentORExpressionExperimentalready carries the same accession. The exception carries the existing entity's id and type so the REST layer can mint a 409 response per spec.Emits a
PreboardedCreatedEventaudit row against the new preboarded's own audit trail. -
load
- Returns:
- the preboarded with the given id, or
null.
-
loadAccessions
Accessions for a set of preboarded ids, in ONE query.Batched on purpose: the ticket navigator resolves the labels for a whole page of tickets at once, and a batch triage ticket carries every candidate from its scrape. Resolving one id at a time would put an N+1 on the server, which is the thing
TicketsWebService.resolveTargetLabelsexists to avoid.- Returns:
- accession by id; ids that do not exist are simply absent
-
findByAccession
- Returns:
- the preboarded with the given accession, or
null.
-
findAllByAccession
- Returns:
- list of preboarded with the given accession (defensive — only one is expected; the create path enforces uniqueness).
-
findExpressionExperimentByAccession
Look up an existingExpressionExperimentcarrying the given accession. Used by thePOST /preboarded409 path: if the data is already loaded as an EE, the caller should write against the EE directly rather than create a preboarded.- Returns:
- the existing EE with this accession, or
null.
-
promote
PreboardedExperimentService.PromotionResult promote(ExpressionExperiment ee, PreboardedExperiment preboarded) throws PreboardedExperimentService.PreboardedAlreadyPromotedException Promote the preboarded to a loadedExpressionExperiment.The implementation rebinds every
AnnotationSetattached to the preboarded so it points at the EE row instead (new-row + FK rebind approach; seeSTATUS_PROPOSED_EXPERIMENT_WORKFLOW.mdfor the trade-off discussion). The preboarded's workflow state is advanced toLoaded(terminal marker — the row is retained for history; it carries no curatable artifacts) and the EE's workflow state is advanced toLoadedtoo.Emits a
PreboardedPromotedEventon the EE's audit trail (post-promotion the EE is the authoritative parent of the trail). Theeeargument is first so the@Auditedaspect picks the EE as the audit target rather than the preboarded.Throws
PreboardedExperimentService.PreboardedAlreadyPromotedExceptionif the preboarded's workflow state is alreadyLoaded(or beyond).- Returns:
- the promoted-from / promoted-to pair + counts the REST layer needs for the 200 response.
- Throws:
PreboardedExperimentService.PreboardedAlreadyPromotedException
-