releaseFromQuarantine

abstract fun releaseFromQuarantine(propositionId: String): Proposition?

Let a quarantined proposition back out: restore the status it carried before quarantine and clear its quarantine metadata, in one write.

This is the whole reversibility story, and it is the only way out. A host that clears com.embabel.dice.common.DiceMetadataKeys.QUARANTINE_REASON by hand leaves the proposition QUARANTINED with nothing on it saying why, still held and now unexplained.

The prior status comes from DriftQuarantineKeys.PREVIOUS_STATUS, which the policy wrote at quarantine time. A proposition carrying no readable value there is restored to PropositionStatus.ACTIVE, which is the only sensible reading of "let it back into use" when the record of where it came from is gone. So is one whose recorded value reads QUARANTINED, since restoring that would leave the release doing nothing.

The status move is announced as a com.embabel.dice.common.PropositionStatusChanged, the same way applyQuarantine announces the move in.

Which propositions are held is decided by status alone, so releasing twice is safe: the second call finds a proposition that isn't quarantined and answers null.

Return

The released proposition, or null when no proposition has that id, or when the one that does is not quarantined.

Parameters

propositionId

The proposition to release.