Class MonitoringPipelineMavenPluginDaoDecorator
java.lang.Object
org.jenkinsci.plugins.pipeline.maven.dao.AbstractPipelineMavenPluginDaoDecorator
org.jenkinsci.plugins.pipeline.maven.dao.MonitoringPipelineMavenPluginDaoDecorator
- All Implemented Interfaces:
Closeable
,AutoCloseable
,PipelineMavenPluginDao
public class MonitoringPipelineMavenPluginDaoDecorator
extends AbstractPipelineMavenPluginDaoDecorator
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jenkinsci.plugins.pipeline.maven.dao.PipelineMavenPluginDao
PipelineMavenPluginDao.Builder
-
Field Summary
Fields inherited from class org.jenkinsci.plugins.pipeline.maven.dao.AbstractPipelineMavenPluginDaoDecorator
delegate
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
cleanup()
Routine task to cleanup the database and reclaim disk space (if possible in the underlying database).void
deleteBuild
(String jobFullName, int buildNumber) Sync database when a build is deleted (seeRunListener.onDeleted(Run)
)void
Sync database when a job is deleted (seeItemListener.onDeleted(Item)
)getGeneratedArtifacts
(String jobFullName, int buildNumber) Return the artifacts generated by the given build.listDependencies
(String jobFullName, int buildNumber) Return the dependencies registered by the given build.listDownstreamJobs
(String jobFullName, int buildNumber) Deprecated.listDownstreamJobs
(String groupId, String artifactId, String version, String baseVersion, String type, String classifier) List the downstream jobs who have a dependency on the given artifact.listDownstreamJobsByArtifact
(String jobFullName, int buildNumber) List the downstream jobs who have a dependency on an artifact that has been generated by the given build (build identified by the givenjobFullName
,buildNumber
).listTransitiveUpstreamJobs
(String jobFullName, int buildNumber) List the upstream jobs who generate an artifact that the given build depends on, including transitive dependencies (build identified by the givenjobFullName
,buildNumber
)listUpstreamJobs
(String jobFullName, int buildNumber) List the upstream jobs who generate an artifact that the given build depends on (build identified by the givenjobFullName
,buildNumber
) Doesn't return the passed job in case where a pipeline consumes an artifact it also producesvoid
recordBuildUpstreamCause
(String upstreamJobName, int upstreamBuildNumber, String downstreamJobName, int downstreamBuildNumber) TODO addMavenArtifact
as org.jenkinsci.plugins.pipeline.maven.cause.MavenDependencyUpstreamCause gives these detailsvoid
recordDependency
(String jobFullName, int buildNumber, String groupId, String artifactId, String version, String type, String scope, boolean ignoreUpstreamTriggers, String classifier) Record a Maven dependency of a build.void
recordGeneratedArtifact
(String jobFullName, int buildNumber, String groupId, String artifactId, String version, String type, String baseVersion, String repositoryUrl, boolean skipDownstreamTriggers, String extension, String classifier) Record a Maven artifact generated in a build.void
recordParentProject
(String jobFullName, int buildNumber, String parentGroupId, String parentArtifactId, String parentVersion, boolean ignoreUpstreamTriggers) Record a Maven parent project of a pom processed by this build of a build.static void
registerCacheStatsSupplier
(Supplier<CacheStats> supplier) void
Sync database when a job is renamed (seeItemListener.onRenamed(Item, String, String)
)Human readable toStringvoid
updateBuildOnCompletion
(String jobFullName, int buildNumber, int buildResultOrdinal, long startTimeInMillis, long durationInMillis) Update the database with build result details.Methods inherited from class org.jenkinsci.plugins.pipeline.maven.dao.AbstractPipelineMavenPluginDaoDecorator
close, getBuilder, getDescription, isEnoughProductionGradeForTheWorkload, listTransitiveUpstreamJobs
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.jenkinsci.plugins.pipeline.maven.dao.PipelineMavenPluginDao
getDefaultJdbcUrl, listDownstreamJobs
-
Constructor Details
-
MonitoringPipelineMavenPluginDaoDecorator
-
-
Method Details
-
registerCacheStatsSupplier
-
recordDependency
public void recordDependency(@NonNull String jobFullName, int buildNumber, @NonNull String groupId, @NonNull String artifactId, @NonNull String version, @NonNull String type, @NonNull String scope, boolean ignoreUpstreamTriggers, String classifier) Description copied from interface:PipelineMavenPluginDao
Record a Maven dependency of a build.- Specified by:
recordDependency
in interfacePipelineMavenPluginDao
- Overrides:
recordDependency
in classAbstractPipelineMavenPluginDaoDecorator
- Parameters:
jobFullName
- seeItem.getFullName()
buildNumber
- seeRun.getNumber()
groupId
- Maven dependency groupIdartifactId
- Maven dependency artifactIdversion
- Maven dependency versiontype
- Maven dependency type (e.g. "jar", "war", "pom", hpi"...)scope
- Maven dependency scope ("compile", "test", "provided"...)ignoreUpstreamTriggers
- see PipelineGraphPublisher#isIgnoreUpstreamTriggers()classifier
- Maven dependency classifier
-
recordParentProject
public void recordParentProject(@NonNull String jobFullName, int buildNumber, @NonNull String parentGroupId, @NonNull String parentArtifactId, @NonNull String parentVersion, boolean ignoreUpstreamTriggers) Description copied from interface:PipelineMavenPluginDao
Record a Maven parent project of a pom processed by this build of a build.- Specified by:
recordParentProject
in interfacePipelineMavenPluginDao
- Overrides:
recordParentProject
in classAbstractPipelineMavenPluginDaoDecorator
- Parameters:
jobFullName
- seeItem.getFullName()
buildNumber
- seeRun.getNumber()
parentGroupId
- Maven dependency groupIdparentArtifactId
- Maven dependency artifactIdparentVersion
- Maven dependency versionignoreUpstreamTriggers
- see PipelineGraphPublisher#isIgnoreUpstreamTriggers()
-
recordGeneratedArtifact
public void recordGeneratedArtifact(@NonNull String jobFullName, int buildNumber, @NonNull String groupId, @NonNull String artifactId, @NonNull String version, @NonNull String type, @NonNull String baseVersion, @Nullable String repositoryUrl, boolean skipDownstreamTriggers, String extension, String classifier) Description copied from interface:PipelineMavenPluginDao
Record a Maven artifact generated in a build.- Specified by:
recordGeneratedArtifact
in interfacePipelineMavenPluginDao
- Overrides:
recordGeneratedArtifact
in classAbstractPipelineMavenPluginDaoDecorator
- Parameters:
jobFullName
- seeItem.getFullName()
buildNumber
- seeRun.getNumber()
groupId
- Maven artifact groupIdartifactId
- Maven artifact artifactIdversion
- Maven artifact version, the "expanded version" for snapshots who have been "mvn deploy" or equivalent (e.g. "1.1-20170808.155524-66" for "1.1-SNAPSHOT" deployed to a repo)type
- Maven artifact type (e.g. "jar", "war", "pom", hpi"...)baseVersion
- Maven artifact version, the NOT "expanded version" for snapshots who have been "mvn deploy" or equivalent (e.g. baseVersion is "1.1-SNAPSHOT" for a "1.1-SNAPSHOT" artifact that has been deployed to a repo and expanded to "1.1-20170808.155524-66")repositoryUrl
- URL of the Maven repository on which the artifact is deployed ("mvn deploy").null
if the artifact was not deployedskipDownstreamTriggers
- see PipelineGraphPublisher#isSkipDownstreamTriggers()
-
recordBuildUpstreamCause
public void recordBuildUpstreamCause(String upstreamJobName, int upstreamBuildNumber, String downstreamJobName, int downstreamBuildNumber) Description copied from interface:PipelineMavenPluginDao
TODO addMavenArtifact
as org.jenkinsci.plugins.pipeline.maven.cause.MavenDependencyUpstreamCause gives these details- Specified by:
recordBuildUpstreamCause
in interfacePipelineMavenPluginDao
- Overrides:
recordBuildUpstreamCause
in classAbstractPipelineMavenPluginDaoDecorator
- Parameters:
upstreamJobName
- Job that triggered the build. SeeItem.getFullName()
.upstreamBuildNumber
- Job that triggered the build. SeeRun.getNumber()
.downstreamJobName
- Job that is triggered. SeeItem.getFullName()
.downstreamBuildNumber
- Job that is triggered. SeeRun.getNumber()
.
-
listDependencies
@NonNull public List<MavenDependency> listDependencies(@NonNull String jobFullName, int buildNumber) Description copied from interface:PipelineMavenPluginDao
Return the dependencies registered by the given build.- Specified by:
listDependencies
in interfacePipelineMavenPluginDao
- Overrides:
listDependencies
in classAbstractPipelineMavenPluginDaoDecorator
- Parameters:
jobFullName
- seeItem.getFullName()
buildNumber
- seeRun.getNumber()
- Returns:
- sorted list of maven artifacts.
- See Also:
-
getGeneratedArtifacts
@NonNull public List<MavenArtifact> getGeneratedArtifacts(@NonNull String jobFullName, int buildNumber) Description copied from interface:PipelineMavenPluginDao
Return the artifacts generated by the given build.- Specified by:
getGeneratedArtifacts
in interfacePipelineMavenPluginDao
- Overrides:
getGeneratedArtifacts
in classAbstractPipelineMavenPluginDaoDecorator
- Parameters:
jobFullName
- seeItem.getFullName()
buildNumber
- seeRun.getNumber()
- Returns:
- sorted list of generated maven artifacts.
-
renameJob
Description copied from interface:PipelineMavenPluginDao
Sync database when a job is renamed (seeItemListener.onRenamed(Item, String, String)
)- Specified by:
renameJob
in interfacePipelineMavenPluginDao
- Overrides:
renameJob
in classAbstractPipelineMavenPluginDaoDecorator
- Parameters:
oldFullName
- seeItem.getFullName()
newFullName
- seeItem.getFullName()
- See Also:
-
deleteJob
Description copied from interface:PipelineMavenPluginDao
Sync database when a job is deleted (seeItemListener.onDeleted(Item)
)- Specified by:
deleteJob
in interfacePipelineMavenPluginDao
- Overrides:
deleteJob
in classAbstractPipelineMavenPluginDaoDecorator
- Parameters:
jobFullName
- seeItem.getFullName()
- See Also:
-
deleteBuild
Description copied from interface:PipelineMavenPluginDao
Sync database when a build is deleted (seeRunListener.onDeleted(Run)
)- Specified by:
deleteBuild
in interfacePipelineMavenPluginDao
- Overrides:
deleteBuild
in classAbstractPipelineMavenPluginDaoDecorator
- Parameters:
jobFullName
- seeItem.getFullName()
- See Also:
-
listDownstreamJobs
@NonNull @Deprecated public List<String> listDownstreamJobs(@NonNull String jobFullName, int buildNumber) Deprecated.Description copied from interface:PipelineMavenPluginDao
List the downstream jobs who have a dependency on an artifact that has been generated by the given build (build identified by the givenjobFullName
,buildNumber
). Doesn't return the passed job in case where a pipeline consumes an artifact it also produces- Specified by:
listDownstreamJobs
in interfacePipelineMavenPluginDao
- Overrides:
listDownstreamJobs
in classAbstractPipelineMavenPluginDaoDecorator
- Parameters:
jobFullName
- seeItem.getFullName()
buildNumber
- seeRun.getNumber()
- Returns:
- list of job full names (see
Item.getFullName()
) - See Also:
-
listDownstreamJobsByArtifact
@NonNull public Map<MavenArtifact,SortedSet<String>> listDownstreamJobsByArtifact(@NonNull String jobFullName, int buildNumber) Description copied from interface:PipelineMavenPluginDao
List the downstream jobs who have a dependency on an artifact that has been generated by the given build (build identified by the givenjobFullName
,buildNumber
). Doesn't return the passed job in case where a pipeline consumes an artifact it also produces- Specified by:
listDownstreamJobsByArtifact
in interfacePipelineMavenPluginDao
- Overrides:
listDownstreamJobsByArtifact
in classAbstractPipelineMavenPluginDaoDecorator
- Parameters:
jobFullName
- seeItem.getFullName()
buildNumber
- seeRun.getNumber()
- Returns:
- list of job full names (see
Item.getFullName()
) byMavenArtifact
- See Also:
-
listDownstreamJobs
@NonNull public SortedSet<String> listDownstreamJobs(String groupId, String artifactId, String version, String baseVersion, String type, String classifier) Description copied from interface:PipelineMavenPluginDao
List the downstream jobs who have a dependency on the given artifact.- Specified by:
listDownstreamJobs
in interfacePipelineMavenPluginDao
- Overrides:
listDownstreamJobs
in classAbstractPipelineMavenPluginDaoDecorator
- Parameters:
groupId
- Maven artifact group ID (see Artifact#getArtifactId())artifactId
- Maven artifact id (see Artifact#getArtifactId())version
- Maven artifact version (see Artifact#getVersion())baseVersion
- Maven artifact (see Artifact#getBaseVersion())type
- Maven artifact type (see Artifact#getType())classifier
- Maven artifact classifier (see Artifact#getClassifier())- Returns:
- list of job full names (see
Item.getFullName()
) byMavenArtifact
- See Also:
-
listUpstreamJobs
Description copied from interface:PipelineMavenPluginDao
List the upstream jobs who generate an artifact that the given build depends on (build identified by the givenjobFullName
,buildNumber
) Doesn't return the passed job in case where a pipeline consumes an artifact it also produces- Specified by:
listUpstreamJobs
in interfacePipelineMavenPluginDao
- Overrides:
listUpstreamJobs
in classAbstractPipelineMavenPluginDaoDecorator
- Parameters:
jobFullName
- seeItem.getFullName()
buildNumber
- seeRun.getNumber()
- Returns:
- list of builds : key
Item.getFullName()
, value:Run.getNumber()
- See Also:
-
listTransitiveUpstreamJobs
@NonNull public Map<String,Integer> listTransitiveUpstreamJobs(@NonNull String jobFullName, int buildNumber) Description copied from interface:PipelineMavenPluginDao
List the upstream jobs who generate an artifact that the given build depends on, including transitive dependencies (build identified by the givenjobFullName
,buildNumber
)- Specified by:
listTransitiveUpstreamJobs
in interfacePipelineMavenPluginDao
- Overrides:
listTransitiveUpstreamJobs
in classAbstractPipelineMavenPluginDaoDecorator
- Parameters:
jobFullName
- seeItem.getFullName()
buildNumber
- seeRun.getNumber()
- Returns:
- list of job full names (see
Item.getFullName()
) - See Also:
-
cleanup
public void cleanup()Description copied from interface:PipelineMavenPluginDao
Routine task to cleanup the database and reclaim disk space (if possible in the underlying database).- Specified by:
cleanup
in interfacePipelineMavenPluginDao
- Overrides:
cleanup
in classAbstractPipelineMavenPluginDaoDecorator
-
updateBuildOnCompletion
public void updateBuildOnCompletion(@NonNull String jobFullName, int buildNumber, int buildResultOrdinal, long startTimeInMillis, long durationInMillis) Description copied from interface:PipelineMavenPluginDao
Update the database with build result details.- Specified by:
updateBuildOnCompletion
in interfacePipelineMavenPluginDao
- Overrides:
updateBuildOnCompletion
in classAbstractPipelineMavenPluginDaoDecorator
- Parameters:
jobFullName
- seeItem.getFullName()
buildNumber
- seeRun.getNumber()
buildResultOrdinal
- seeResult.ordinal
startTimeInMillis
- seeRun.getStartTimeInMillis()
durationInMillis
- seeRun.getDuration()
-
toPrettyString
Description copied from interface:PipelineMavenPluginDao
Human readable toString- Specified by:
toPrettyString
in interfacePipelineMavenPluginDao
- Overrides:
toPrettyString
in classAbstractPipelineMavenPluginDaoDecorator
-