public abstract class SCMSourceRequest extends Object implements Closeable
SCMSource.retrieve(SCMSourceCriteria, SCMHeadObserver, SCMHeadEvent, TaskListener) or an equivalent method.| Modifier and Type | Class and Description |
|---|---|
static interface |
SCMSourceRequest.IntermediateLambda<I>
A lambda that produces an intermediate summary used to drive creation of the
SCMSourceCriteria.Probe
and SCMRevision instances. |
static interface |
SCMSourceRequest.LazyRevisionLambda<H extends SCMHead,R extends SCMRevision,I>
A lambda that will create the
SCMRevision instance for a specific SCMHead using the intermediate
value produced by a SCMSourceRequest.IntermediateLambda. |
static interface |
SCMSourceRequest.ProbeLambda<H extends SCMHead,I>
A lambda that will create a
SCMSourceCriteria.Probe (ideally a SCMProbe but for legacy code
migration we use SCMSourceCriteria.Probe) for a specified SCMHead and either a
SCMRevision or some other type created by a SCMSourceRequest.IntermediateLambda. |
static interface |
SCMSourceRequest.RevisionLambda<H extends SCMHead,R extends SCMRevision>
A lambda that will create the
SCMRevision instance for a specific SCMHead. |
static interface |
SCMSourceRequest.Witness<H extends SCMHead,R extends SCMRevision>
Callback lambda to track the results of
process(SCMHead, IntermediateLambda, ProbeLambda, LazyRevisionLambda, Witness[]) |
| Modifier | Constructor and Description |
|---|---|
protected |
SCMSourceRequest(SCMSource source,
SCMSourceContext<?,?> context,
TaskListener listener)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
List<SCMSourceCriteria> |
getCriteria()
Returns the
SCMSourceCriteria being used for this request. |
boolean |
isComplete()
Checks if this request has been completed, that is if its
SCMHeadObserver has stopped
SCMHeadObserver.isObserving(). |
boolean |
isExcluded(SCMHead head)
Tests if the
SCMHead is excluded from the request. |
boolean |
isTrusted(SCMHead head)
Tests if the
SCMHead is trusted. |
TaskListener |
listener()
Returns the
TaskListener to use for this request. |
void |
manage(Closeable closeable)
Adds managing a
Closeable into the scope of the SCMSourceRequest |
<H extends SCMHead,R extends SCMRevision> |
process(H head,
R revision,
SCMSourceRequest.ProbeLambda<H,R> probeFactory,
SCMSourceRequest.Witness... witnesses)
Processes a head in the context of the current request.
|
<H extends SCMHead,I,R extends SCMRevision> |
process(H head,
SCMSourceRequest.IntermediateLambda<I> intermediateFactory,
SCMSourceRequest.ProbeLambda<H,I> probeFactory,
SCMSourceRequest.LazyRevisionLambda<H,R,I> revisionFactory,
SCMSourceRequest.Witness... witnesses)
Processes a head in the context of the current request where an intermediary operation is required before
the
SCMRevision can be instantiated. |
<H extends SCMHead,R extends SCMRevision> |
process(H head,
SCMSourceRequest.RevisionLambda<H,R> revisionFactory,
SCMSourceRequest.ProbeLambda<H,R> probeFactory,
SCMSourceRequest.Witness... witnesses)
Processes a head in the context of the current request.
|
protected SCMSourceRequest(@NonNull
SCMSource source,
@NonNull
SCMSourceContext<?,?> context,
@CheckForNull
TaskListener listener)
source - the source.context - the context.listener - the (optional) TaskListener.public final boolean isExcluded(@NonNull
SCMHead head)
throws IOException,
InterruptedException
SCMHead is excluded from the request.head - the SCMHead.true if the SCMHead is excluded.IOException - if there is an I/O error.InterruptedException - if the operation was interrupted.public final boolean isTrusted(@NonNull
SCMHead head)
throws IOException,
InterruptedException
SCMHead is trusted.head - the SCMHead.true if the SCMHead is trusted.IOException - if there is an I/O error.InterruptedException - if the operation was interrupted.@NonNull public final List<SCMSourceCriteria> getCriteria()
SCMSourceCriteria being used for this request.SCMSourceCriteria being used for this request.public final <H extends SCMHead,R extends SCMRevision> boolean process(@NonNull H head, @NonNull R revision, @NonNull SCMSourceRequest.ProbeLambda<H,R> probeFactory, @NonNull SCMSourceRequest.Witness... witnesses) throws IOException, InterruptedException
H - the type of SCMHead.R - the type of SCMRevision.head - the SCMHead to process.revision - the SCMRevision (assuming revision creation is very cheap).probeFactory - factory method that creates the SCMProbe.witnesses - any SCMSourceRequest.Witness instances to be informed of the observation result.true if the SCMHeadObserver for this request has completed observing, false to
continue processing.IOException - if there was an I/O error.InterruptedException - if the processing was interrupted.public final <H extends SCMHead,R extends SCMRevision> boolean process(@NonNull H head, @NonNull SCMSourceRequest.RevisionLambda<H,R> revisionFactory, @NonNull SCMSourceRequest.ProbeLambda<H,R> probeFactory, @NonNull SCMSourceRequest.Witness... witnesses) throws IOException, InterruptedException
H - the type of SCMHead.R - the type of SCMRevision.head - the SCMHead to process.revisionFactory - factory method that creates the SCMRevision (assuming creation is cheap).probeFactory - factory method that creates the SCMProbe.witnesses - any SCMSourceRequest.Witness instances to be informed of the observation result.true if the SCMHeadObserver for this request has completed observing, false to
continue processing.IOException - if there was an I/O error.InterruptedException - if the processing was interrupted.public final <H extends SCMHead,I,R extends SCMRevision> boolean process(@NonNull H head, @CheckForNull SCMSourceRequest.IntermediateLambda<I> intermediateFactory, @NonNull SCMSourceRequest.ProbeLambda<H,I> probeFactory, @NonNull SCMSourceRequest.LazyRevisionLambda<H,R,I> revisionFactory, @NonNull SCMSourceRequest.Witness... witnesses) throws IOException, InterruptedException
SCMRevision can be instantiated.H - the type of SCMHead.I - the type of the intermediary operation result.R - the type of SCMRevision.head - the SCMHead to process.intermediateFactory - factory method that provides the seed information for both the SCMSourceRequest.ProbeLambda
and the SCMSourceRequest.LazyRevisionLambda.probeFactory - factory method that creates the SCMProbe.revisionFactory - factory method that creates the SCMRevision.witnesses - any SCMSourceRequest.Witness instances to be informed of the observation result.true if the SCMHeadObserver for this request has completed observing, false to
continue processing.IOException - if there was an I/O error.InterruptedException - if the processing was interrupted.public boolean isComplete()
SCMHeadObserver has stopped
SCMHeadObserver.isObserving().true if and only if the request is completed.@NonNull public TaskListener listener()
TaskListener to use for this request.TaskListener to use for this request.public void manage(@CheckForNull
Closeable closeable)
Closeable into the scope of the SCMSourceRequestcloseable - the Closeable to manage.public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2016–2019. All rights reserved.