@Component public class CriticalPath extends Object implements CriticalRepositoryInteraction
CriticalRepositoryInteraction, and boilerplate for interacting with, and
modifying the state of, repository resources.CriticalRepositoryInteraction.CriticalResult<R,T>| Constructor and Description |
|---|
CriticalPath(org.dataconservancy.pass.client.PassClient passClient,
ConflictHandler conflictHandler) |
| Modifier and Type | Method and Description |
|---|---|
<R,T extends org.dataconservancy.pass.model.PassEntity> |
performCritical(URI uri,
Class<T> clazz,
Predicate<T> precondition,
BiPredicate<T,R> postcondition,
Function<T,R> critical)
Execute a critical interaction with the repository, subject to
precondition. |
<R,T extends org.dataconservancy.pass.model.PassEntity> |
performCritical(URI uri,
Class<T> clazz,
Predicate<T> precondition,
Predicate<T> postcondition,
Function<T,R> critical)
Execute a critical interaction with the repository, subject to
precondition. |
public CriticalPath(org.dataconservancy.pass.client.PassClient passClient,
ConflictHandler conflictHandler)
public <R,T extends org.dataconservancy.pass.model.PassEntity> CriticalRepositoryInteraction.CriticalResult<R,T> performCritical(URI uri, Class<T> clazz, Predicate<T> precondition, Predicate<T> postcondition, Function<T,R> critical)
precondition. Success of the interaction
depends on the evaluation of postcondition.
See the other form of performCritical if the postcondition needs to evaluate both the PassEntity resource and the
return from the critical path.
uri, insuring no interference from other
threads executing in this JVMPassEntity identified by uri from the repository, short-circuiting the
interaction by returning a CriticalResult if an Exception is thrownPredicate, short-circuiting the interaction by returning a
CriticalResult if the condition failscritical interaction, short-circuiting the interaction by returning a
CriticalResult if an Exception is thrownConflictUpdateException is thrown,
it is supplied to the ConflictHandler for resolution. If any other Exception is thrown,
the interaction is short-circuited, and a CriticalResult returned.Predicate and returns CriticalResultperformCritical in interface CriticalRepositoryInteractionT - the type of PassEntityR - the type of Object returned by criticaluri - the uri of the PassEntity which is the subject of the critical pathvclazz - the concrete Class of the PassEntity represented by uriprecondition - precondition that must evaluate to true for the critical path to executepostcondition - postcondition that must evaluate to true for the CriticalResult to be
considered successfulcritical - the critical interaction with the repository, which may return a result of type RCriticalResult encapsulating the PassEntity, the return from the critical path,
any exception thrown, and the overall success as determined by the post-conditionpublic <R,T extends org.dataconservancy.pass.model.PassEntity> CriticalRepositoryInteraction.CriticalResult<R,T> performCritical(URI uri, Class<T> clazz, Predicate<T> precondition, BiPredicate<T,R> postcondition, Function<T,R> critical)
precondition. Success of the interaction
depends on the evaluation of postcondition.
See the other form of performCritical if the postcondition only needs to evaluate the PassEntity resource.
uri, insuring no interference from other
threads executing in this JVMPassEntity identified by uri from the repository, short-circuiting the
interaction by returning a CriticalResult if an Exception is thrownPredicate, short-circuiting the interaction by returning a
CriticalResult if the condition failscritical interaction, short-circuiting the interaction by returning a
CriticalResult if an Exception is thrownConflictUpdateException is thrown,
it is supplied to the ConflictHandler for resolution. If any other Exception is thrown,
the interaction is short-circuited, and a CriticalResult returned.BiPredicate and returns CriticalResultperformCritical in interface CriticalRepositoryInteractionT - the type of PassEntityR - the type of Object returned by criticaluri - the uri of the PassEntity which is the subject of the critical pathvclazz - the concrete Class of the PassEntity represented by uriprecondition - precondition that must evaluate to true for the critical path to executepostcondition - postcondition that must evaluate to true for the CriticalResult to be
considered successfulcritical - the critical interaction with the repository, which may return a result of type RCriticalResult encapsulating the PassEntity, the return from the critical path,
any exception thrown, and the overall success as determined by the post-conditionCopyright © 2018. All rights reserved.