Class PipelineMavenPluginNullDao
java.lang.Object
org.jenkinsci.plugins.pipeline.maven.dao.PipelineMavenPluginNullDao
- All Implemented Interfaces:
Closeable,AutoCloseable,PipelineMavenPluginDao
- Author:
- Cyrille Le Clerc
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jenkinsci.plugins.pipeline.maven.dao.PipelineMavenPluginDao
PipelineMavenPluginDao.Builder -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcleanup()Routine task to cleanup the database and reclaim disk space (if possible in the underlying database).voidclose()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.booleanIndicates if the underlying database is production grade enough for the workload.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)listTransitiveUpstreamJobs(String jobFullName, int buildNumber, UpstreamMemory upstreamMemory) List the upstream jobs who generate an artifact that the given build depends on, including transitive dependencies (build identified by the givenjobFullName,buildNumber) Use a memory for already known upstreams to boost performancelistUpstreamJobs(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.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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jenkinsci.plugins.pipeline.maven.dao.PipelineMavenPluginDao
getDefaultJdbcUrl, listDownstreamJobs
-
Constructor Details
-
PipelineMavenPluginNullDao
public PipelineMavenPluginNullDao()
-
-
Method Details
-
getDescription
- Specified by:
getDescriptionin interfacePipelineMavenPluginDao
-
getBuilder
- Specified by:
getBuilderin interfacePipelineMavenPluginDao
-
recordDependency
public void recordDependency(String jobFullName, int buildNumber, String groupId, String artifactId, String version, String type, String scope, boolean ignoreUpstreamTriggers, String classifier) Description copied from interface:PipelineMavenPluginDaoRecord a Maven dependency of a build.- Specified by:
recordDependencyin interfacePipelineMavenPluginDao- 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
-
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- Parameters:
jobFullName- seeItem.getFullName()buildNumber- seeRun.getNumber()- Returns:
- sorted list of maven artifacts.
- See Also:
-
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- Parameters:
jobFullName- seeItem.getFullName()buildNumber- seeRun.getNumber()parentGroupId- Maven dependency groupIdparentArtifactId- Maven dependency artifactIdparentVersion- Maven dependency versionignoreUpstreamTriggers- see PipelineGraphPublisher#isIgnoreUpstreamTriggers()
-
recordGeneratedArtifact
public void recordGeneratedArtifact(String jobFullName, int buildNumber, String groupId, String artifactId, String version, String type, String baseVersion, String repositoryUrl, boolean skipDownstreamTriggers, String extension, String classifier) Description copied from interface:PipelineMavenPluginDaoRecord a Maven artifact generated in a build.- Specified by:
recordGeneratedArtifactin interfacePipelineMavenPluginDao- 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()
-
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- 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().
-
renameJob
Description copied from interface:PipelineMavenPluginDaoSync database when a job is renamed (seeItemListener.onRenamed(Item, String, String))- Specified by:
renameJobin interfacePipelineMavenPluginDao- 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- 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- 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- 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- 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- 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- Parameters:
jobFullName- seeItem.getFullName()buildNumber- seeRun.getNumber()- Returns:
- list of builds : key
Item.getFullName(), value:Run.getNumber() - See Also:
-
listTransitiveUpstreamJobs
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- Parameters:
jobFullName- seeItem.getFullName()buildNumber- seeRun.getNumber()- Returns:
- list of job full names (see
Item.getFullName()) - See Also:
-
listTransitiveUpstreamJobs
@NonNull public Map<String,Integer> listTransitiveUpstreamJobs(String jobFullName, int buildNumber, UpstreamMemory upstreamMemory) 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) Use a memory for already known upstreams to boost performance- Specified by:
listTransitiveUpstreamJobsin interfacePipelineMavenPluginDao- Parameters:
jobFullName- seeItem.getFullName()buildNumber- seeRun.getNumber()upstreamMemory- seeUpstreamMemory- if called for several jobs in a loop we save the already known upstreams- 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
-
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- Parameters:
jobFullName- seeItem.getFullName()buildNumber- seeRun.getNumber()- Returns:
- sorted list of generated maven artifacts.
-
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- 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
-
isEnoughProductionGradeForTheWorkload
public boolean isEnoughProductionGradeForTheWorkload()Description copied from interface:PipelineMavenPluginDaoIndicates if the underlying database is production grade enough for the workload. H2 database is not enough for production grade workloads of the pipeline-maven-plugin.- Specified by:
isEnoughProductionGradeForTheWorkloadin interfacePipelineMavenPluginDao- Returns:
falseif the underlying database is not production grade enough for the workload
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-