Class AnnotationSetDispositionServiceImpl
- All Implemented Interfaces:
AnnotationSetDispositionService
AnnotationSetDispositionService.
Deliberately emits no audit event, for the reason
AnnotationSetTriageServiceImpl gives: any audit event sets
curationDetails.lastUpdated, which is the optimistic-concurrency
token the curation commit checks — so ruling on a finding would 409 every
draft in flight on that dataset. The row carries its own decidedBy /
decidedAt, so it is its own record.
-
Constructor Summary
ConstructorsConstructorDescriptionAnnotationSetDispositionServiceImpl(AnnotationSetDispositionDao annotationSetDispositionDao) -
Method Summary
Modifier and TypeMethodDescriptionintclearDispositions(AnnotationSet annotationSet) Erase every ruling on one set, so it can be dispositioned again from scratch.findBySet(AnnotationSet annotationSet) Every ruling on one set, most recent first — the full log, superseded rulings included.historyFor(AnnotationSet annotationSet, String targetId) Every ruling on one finding, most recent first.rule(AnnotationSet annotationSet, String targetId, String findingId, FindingDisposition disposition, String decidedBy, TriageJudgeKind judgeKind, String reason) Record a ruling on one finding.standingFor(AnnotationSet annotationSet) The standing ruling for each finding in one set — the most recent per finding id, or per target id for rows carrying no finding id.standingForIds(Collection<Long> annotationSetIds) BatchedAnnotationSetDispositionService.standingFor(AnnotationSet), keyed by annotation set id.
-
Constructor Details
-
AnnotationSetDispositionServiceImpl
@Autowired public AnnotationSetDispositionServiceImpl(AnnotationSetDispositionDao annotationSetDispositionDao)
-
-
Method Details
-
rule
@Transactional public AnnotationSetDisposition rule(AnnotationSet annotationSet, String targetId, @Nullable String findingId, FindingDisposition disposition, String decidedBy, TriageJudgeKind judgeKind, @Nullable String reason) Description copied from interface:AnnotationSetDispositionServiceRecord a ruling on one finding. Always a new row: a curator changing their mind adds to the history rather than overwriting it.- Specified by:
rulein interfaceAnnotationSetDispositionService- Parameters:
targetId- the target, in the producer's own numbering. Opaque — the payload is never parsed here, so an id naming no finding is accepted and only the producer can tell.findingId- which finding, when the producer supplies one. Opaque, liketargetId. A target does NOT name a finding — one target routinely carries several, and two of them can be actionable — so a ruling keyed on the target alone cannot say what it ruled on. Null keeps the row target-keyed, which is what pre-existing rows and producers not emitting ids get.decidedBy- the ruling identity — a username for a person, a run id for an agent. Never the transport's principal.judgeKind- stored rather than inferred fromdecidedBy, so "has a person ruled on this" does not depend on knowing every agent run id.reason- why; what the agent needs in order to stop emitting a finding it got wrong. Optional onFindingDisposition.ACCEPTEDandFindingDisposition.DISMISSED, REQUIRED onFindingDisposition.NEEDS_MORE_INFO— see below. Free text either way; there is no vocabulary.
-
findBySet
@Transactional(readOnly=true) public List<AnnotationSetDisposition> findBySet(AnnotationSet annotationSet) Description copied from interface:AnnotationSetDispositionServiceEvery ruling on one set, most recent first — the full log, superseded rulings included.- Specified by:
findBySetin interfaceAnnotationSetDispositionService
-
historyFor
@Transactional(readOnly=true) public List<AnnotationSetDisposition> historyFor(AnnotationSet annotationSet, String targetId) Description copied from interface:AnnotationSetDispositionServiceEvery ruling on one finding, most recent first. The head is the standing ruling.- Specified by:
historyForin interfaceAnnotationSetDispositionService
-
standingFor
@Transactional(readOnly=true) public List<AnnotationSetDisposition> standingFor(AnnotationSet annotationSet) Description copied from interface:AnnotationSetDispositionServiceThe standing ruling for each finding in one set — the most recent per finding id, or per target id for rows carrying no finding id. The two are separate buckets: a ruling on a finding never supersedes a ruling on a target, or the reverse.- Specified by:
standingForin interfaceAnnotationSetDispositionService
-
standingForIds
@Transactional(readOnly=true) public Map<Long, List<AnnotationSetDisposition>> standingForIds(Collection<Long> annotationSetIds) Description copied from interface:AnnotationSetDispositionServiceBatchedAnnotationSetDispositionService.standingFor(AnnotationSet), keyed by annotation set id. One round-trip for a whole page rather than one query per set.- Specified by:
standingForIdsin interfaceAnnotationSetDispositionService
-
clearDispositions
Description copied from interface:AnnotationSetDispositionServiceErase every ruling on one set, so it can be dispositioned again from scratch. Returns how many rows went.🛑 A do-over after a FAULT, not a curator changing their mind. The rulings on a rebuilt calibration package, or ones taken through a wire-schema bug, record a mistake rather than a decision; superseding them one by one would preserve exactly the noise the caller is trying to be rid of. A curator who has reconsidered calls
AnnotationSetDispositionService.rule(AnnotationSet, String, String, FindingDisposition, String, TriageJudgeKind, String)again and the append-only history keeps both.This does NOT undo design edits a curator made in response to those rulings. Those live in the draft, and discarding the draft is a separate act.
- Specified by:
clearDispositionsin interfaceAnnotationSetDispositionService- Returns:
- how many rulings were deleted; 0 when there were none
-