Package jenkins.scm.api.trait
Class SCMNavigatorRequest
java.lang.Object
jenkins.scm.api.trait.SCMNavigatorRequest
- All Implemented Interfaces:
Closeable
,AutoCloseable
Represents the context of an individual request for a call to
SCMNavigator.visitSources(SCMSourceObserver)
or an equivalent method.- Since:
- 2.2.0
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
A lambda that will create the map of attributes for a specific project name.static interface
A lambda that will create theSCMSource
instance for a specific project name.static interface
Callback lambda to track the results ofprocess(String, SourceLambda, AttributeLambda, Witness...)
orprocess(String, List, List, Witness...)
-
Constructor Summary
ModifierConstructorDescriptionprotected
SCMNavigatorRequest
(SCMNavigator source, SCMNavigatorContext<?, ?> context, SCMSourceObserver observer) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
final List<SCMSourceDecorator<?,
?>> Returns theSCMSourceDecorator
instances to apply toSCMSource
instances.final boolean
isExcluded
(String projectName) Tests if the project name is excluded from the request.void
Adds managing aCloseable
into the scope of theSCMNavigatorRequest
boolean
process
(String projectName, List<SCMNavigatorRequest.SourceLambda> sourceFactories, List<SCMNavigatorRequest.AttributeLambda> attributeFactories, SCMNavigatorRequest.Witness... witnesses) Processes a named project in the scope of the current request.boolean
process
(String projectName, SCMNavigatorRequest.SourceLambda sourceFactory, SCMNavigatorRequest.AttributeLambda attributeFactory, SCMNavigatorRequest.Witness... witnesses) Processes a named project in the scope of the current request.final List<SCMSourceTrait>
traits()
Returns theSCMSourceTrait
instances to apply to everySCMSource
.
-
Constructor Details
-
Method Details
-
traits
Returns theSCMSourceTrait
instances to apply to everySCMSource
.- Returns:
- the
SCMSourceTrait
instances to apply to everySCMSource
.
-
decorators
Returns theSCMSourceDecorator
instances to apply toSCMSource
instances.- Returns:
- the
SCMSourceDecorator
instances to apply toSCMSource
instances.
-
isExcluded
public final boolean isExcluded(@NonNull String projectName) throws IOException, InterruptedException Tests if the project name is excluded from the request.- Parameters:
projectName
- the project name.- Returns:
true
if theSCMHead
is excluded.- Throws:
IOException
- if there is an I/O error.InterruptedException
- if the operation was interrupted.
-
manage
Adds managing aCloseable
into the scope of theSCMNavigatorRequest
- Parameters:
closeable
- theCloseable
to manage.
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-