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 PipelineMavenPluginDao
PipelineMavenPluginDao.Builder -
Field Summary
Fields inherited from class AbstractPipelineMavenPluginDaoDecorator
delegate -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcleanup()Routine task to cleanup the database and reclaim disk space (if possible in the underlying database).voiddeleteBuild(String jobFullName, int buildNumber) Sync database when a build is deleted (seeRunListener.onDeleted(Run))voidSync 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 producesvoidrecordBuildUpstreamCause(String upstreamJobName, int upstreamBuildNumber, String downstreamJobName, int downstreamBuildNumber) TODO addMavenArtifactas org.jenkinsci.plugins.pipeline.maven.cause.MavenDependencyUpstreamCause gives these detailsvoidrecordDependency(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.voidrecordGeneratedArtifact(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.voidrecordParentProject(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 voidregisterCacheStatsSupplier(Supplier<CacheStats> supplier) voidSync database when a job is renamed (seeItemListener.onRenamed(Item, String, String))Human readable toStringvoidupdateBuildOnCompletion(String jobFullName, int buildNumber, int buildResultOrdinal, long startTimeInMillis, long durationInMillis) Update the database with build result details.Methods inherited from class AbstractPipelineMavenPluginDaoDecorator
close, getBuilder, getDescription, isEnoughProductionGradeForTheWorkload, listTransitiveUpstreamJobsMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface 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:PipelineMavenPluginDaoRecord a Maven dependency of a build.- Specified by:
recordDependencyin interfacePipelineMavenPluginDao- Overrides:
recordDependencyin 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:PipelineMavenPluginDaoRecord a Maven parent project of a pom processed by this build of a build.- Specified by:
recordParentProjectin interfacePipelineMavenPluginDao- Overrides:
recordParentProjectin 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:PipelineMavenPluginDaoRecord a Maven artifact generated in a build.- Specified by:
recordGeneratedArtifactin interfacePipelineMavenPluginDao- Overrides:
recordGeneratedArtifactin 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").nullif the artifact was not deployedskipDownstreamTriggers- see PipelineGraphPublisher#isSkipDownstreamTriggers()extension-classifier-
-
recordBuildUpstreamCause
public void recordBuildUpstreamCause(String upstreamJobName, int upstreamBuildNumber, String downstreamJobName, int downstreamBuildNumber) Description copied from interface:PipelineMavenPluginDaoTODO addMavenArtifactas org.jenkinsci.plugins.pipeline.maven.cause.MavenDependencyUpstreamCause gives these details- Specified by:
recordBuildUpstreamCausein interfacePipelineMavenPluginDao- Overrides:
recordBuildUpstreamCausein 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:PipelineMavenPluginDaoReturn the dependencies registered by the given build.- Specified by:
listDependenciesin interfacePipelineMavenPluginDao- Overrides:
listDependenciesin 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:PipelineMavenPluginDaoReturn the artifacts generated by the given build.- Specified by:
getGeneratedArtifactsin interfacePipelineMavenPluginDao- Overrides:
getGeneratedArtifactsin classAbstractPipelineMavenPluginDaoDecorator- Parameters:
jobFullName- seeItem.getFullName()buildNumber- seeRun.getNumber()- Returns:
- sorted list of generated maven artifacts.
-
renameJob
Description copied from interface:PipelineMavenPluginDaoSync database when a job is renamed (seeItemListener.onRenamed(Item, String, String))- Specified by:
renameJobin interfacePipelineMavenPluginDao- Overrides:
renameJobin classAbstractPipelineMavenPluginDaoDecorator- Parameters:
oldFullName- seeItem.getFullName()newFullName- seeItem.getFullName()- See Also:
-
deleteJob
Description copied from interface:PipelineMavenPluginDaoSync database when a job is deleted (seeItemListener.onDeleted(Item))- Specified by:
deleteJobin interfacePipelineMavenPluginDao- Overrides:
deleteJobin classAbstractPipelineMavenPluginDaoDecorator- Parameters:
jobFullName- seeItem.getFullName()- See Also:
-
deleteBuild
Description copied from interface:PipelineMavenPluginDaoSync database when a build is deleted (seeRunListener.onDeleted(Run))- Specified by:
deleteBuildin interfacePipelineMavenPluginDao- Overrides:
deleteBuildin classAbstractPipelineMavenPluginDaoDecorator- Parameters:
jobFullName- seeItem.getFullName()- See Also:
-
listDownstreamJobs
@NonNull @Deprecated public List<String> listDownstreamJobs(@NonNull String jobFullName, int buildNumber) Deprecated.Description copied from interface:PipelineMavenPluginDaoList 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:
listDownstreamJobsin interfacePipelineMavenPluginDao- Overrides:
listDownstreamJobsin 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:PipelineMavenPluginDaoList 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:
listDownstreamJobsByArtifactin interfacePipelineMavenPluginDao- Overrides:
listDownstreamJobsByArtifactin 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:PipelineMavenPluginDaoList the downstream jobs who have a dependency on the given artifact.- Specified by:
listDownstreamJobsin interfacePipelineMavenPluginDao- Overrides:
listDownstreamJobsin 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:PipelineMavenPluginDaoList 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:
listUpstreamJobsin interfacePipelineMavenPluginDao- Overrides:
listUpstreamJobsin 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:PipelineMavenPluginDaoList the upstream jobs who generate an artifact that the given build depends on, including transitive dependencies (build identified by the givenjobFullName,buildNumber)- Specified by:
listTransitiveUpstreamJobsin interfacePipelineMavenPluginDao- Overrides:
listTransitiveUpstreamJobsin 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:PipelineMavenPluginDaoRoutine task to cleanup the database and reclaim disk space (if possible in the underlying database).- Specified by:
cleanupin interfacePipelineMavenPluginDao- Overrides:
cleanupin classAbstractPipelineMavenPluginDaoDecorator
-
updateBuildOnCompletion
public void updateBuildOnCompletion(@NonNull String jobFullName, int buildNumber, int buildResultOrdinal, long startTimeInMillis, long durationInMillis) Description copied from interface:PipelineMavenPluginDaoUpdate the database with build result details.- Specified by:
updateBuildOnCompletionin interfacePipelineMavenPluginDao- Overrides:
updateBuildOnCompletionin classAbstractPipelineMavenPluginDaoDecorator- Parameters:
jobFullName- seeItem.getFullName()buildNumber- seeRun.getNumber()buildResultOrdinal- seeResult.ordinalstartTimeInMillis- seeRun.getStartTimeInMillis()durationInMillis- seeRun.getDuration()
-
toPrettyString
Description copied from interface:PipelineMavenPluginDaoHuman readable toString- Specified by:
toPrettyStringin interfacePipelineMavenPluginDao- Overrides:
toPrettyStringin classAbstractPipelineMavenPluginDaoDecorator
-