Class AbstractPipelineMavenPluginDao
java.lang.Object
org.jenkinsci.plugins.pipeline.maven.db.AbstractPipelineMavenPluginDao
- All Implemented Interfaces:
Closeable,AutoCloseable,org.jenkinsci.plugins.pipeline.maven.dao.PipelineMavenPluginDao
- Direct Known Subclasses:
PipelineMavenPluginH2Dao,PipelineMavenPluginMySqlDao,PipelineMavenPluginPostgreSqlDao
public abstract class AbstractPipelineMavenPluginDao
extends Object
implements org.jenkinsci.plugins.pipeline.maven.dao.PipelineMavenPluginDao
- Author:
- Cyrille Le Clerc
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jenkinsci.plugins.pipeline.maven.dao.PipelineMavenPluginDao
org.jenkinsci.plugins.pipeline.maven.dao.PipelineMavenPluginDao.Builder -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanvoidcleanup()voidclose()voiddeleteBuild(String jobFullName, int buildNumber) voidorg.jenkinsci.plugins.pipeline.maven.dao.PipelineMavenPluginDao.Builderprotected Stringprotected DataSourceList<org.jenkinsci.plugins.pipeline.maven.MavenArtifact>getGeneratedArtifacts(String jobFullName, int buildNumber) List the artifacts generated by the given buildprotected LonggetGeneratedPrimaryKey(PreparedStatement stmt, String column) abstract Stringprotected MigrationStep.JenkinsDetailsfor mockingprotected longgetOrCreateArtifactPrimaryKey(String groupId, String artifactId, String version, String type, String classifier) protected longgetOrCreateBuildPrimaryKey(String jobFullName, int buildNumber) protected intprotected voidprotected voidList<org.jenkinsci.plugins.pipeline.maven.MavenDependency>listDependencies(String jobFullName, int buildNumber) listDownstreamJobs(String jobFullName, int buildNumber) Deprecated.listDownstreamJobs(String groupId, String artifactId, String version, String baseVersion, String type, String classifier) listDownstreamJobsByArtifact(String jobFullName, int buildNumber) listDownstreamJobsByArtifactBasedOnMavenDependencies(String jobFullName, int buildNumber) listDownstreamJobsByArtifactBasedOnParentProjectDependencies(String jobFullName, int buildNumber) listDownstreamPipelinesBasedOnMavenDependencies(String jobFullName, int buildNumber) Deprecated.listDownstreamPipelinesBasedOnMavenDependencies(String groupId, String artifactId, String version, String type, String classifier) listDownstreamPipelinesBasedOnParentProjectDependencies(String jobFullName, int buildNumber) Deprecated.listTransitiveUpstreamJobs(String jobFullName, int buildNumber) listTransitiveUpstreamJobs(String jobFullName, int buildNumber, org.jenkinsci.plugins.pipeline.maven.dao.UpstreamMemory upstreamMemory) listUpstreamJobs(String jobFullName, int buildNumber) listUpstreamPipelinesBasedOnMavenDependencies(String downstreamJobFullName, int downstreamBuildNumber) listUpstreamPipelinesBasedOnParentProjectDependencies(String downstreamJobFullName, int downstreamBuildNumber) voidrecordBuildUpstreamCause(String upstreamJobName, int upstreamBuildNumber, String downstreamJobName, int downstreamBuildNumber) voidrecordDependency(String jobFullName, int buildNumber, String groupId, String artifactId, String version, String type, String scope, boolean ignoreUpstreamTriggers, String classifier) voidrecordGeneratedArtifact(String jobFullName, int buildNumber, String groupId, String artifactId, String version, String type, String baseVersion, String repositoryUrl, boolean skipDownstreamTriggers, String extension, String classifier) voidrecordParentProject(String jobFullName, int buildNumber, String parentGroupId, String parentArtifactId, String parentVersion, boolean ignoreUpstreamTriggers) protected abstract voidvoidprotected voidBasic tests to ensure that the database is not corruptedvoidupdateBuildOnCompletion(String jobFullName, int buildNumber, int buildResultOrdinal, long startTimeInMillis, long durationInMillis) 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, getDescription, isEnoughProductionGradeForTheWorkload, listDownstreamJobs
-
Field Details
-
LOGGER
-
-
Constructor Details
-
AbstractPipelineMavenPluginDao
protected AbstractPipelineMavenPluginDao() -
AbstractPipelineMavenPluginDao
-
-
Method Details
-
acceptNoCredentials
protected boolean acceptNoCredentials() -
getBuilder
public org.jenkinsci.plugins.pipeline.maven.dao.PipelineMavenPluginDao.Builder getBuilder()- Specified by:
getBuilderin interfaceorg.jenkinsci.plugins.pipeline.maven.dao.PipelineMavenPluginDao
-
registerJdbcDriver
protected abstract void registerJdbcDriver() -
recordDependency
public void recordDependency(String jobFullName, int buildNumber, String groupId, String artifactId, String version, String type, String scope, boolean ignoreUpstreamTriggers, String classifier) - Specified by:
recordDependencyin interfaceorg.jenkinsci.plugins.pipeline.maven.dao.PipelineMavenPluginDao
-
listDependencies
@NonNull public List<org.jenkinsci.plugins.pipeline.maven.MavenDependency> listDependencies(@NonNull String jobFullName, int buildNumber) - Specified by:
listDependenciesin interfaceorg.jenkinsci.plugins.pipeline.maven.dao.PipelineMavenPluginDao
-
recordParentProject
public void recordParentProject(@NonNull String jobFullName, int buildNumber, @NonNull String parentGroupId, @NonNull String parentArtifactId, @NonNull String parentVersion, boolean ignoreUpstreamTriggers) - Specified by:
recordParentProjectin interfaceorg.jenkinsci.plugins.pipeline.maven.dao.PipelineMavenPluginDao
-
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) - Specified by:
recordGeneratedArtifactin interfaceorg.jenkinsci.plugins.pipeline.maven.dao.PipelineMavenPluginDao
-
recordBuildUpstreamCause
public void recordBuildUpstreamCause(String upstreamJobName, int upstreamBuildNumber, String downstreamJobName, int downstreamBuildNumber) - Specified by:
recordBuildUpstreamCausein interfaceorg.jenkinsci.plugins.pipeline.maven.dao.PipelineMavenPluginDao
-
renameJob
- Specified by:
renameJobin interfaceorg.jenkinsci.plugins.pipeline.maven.dao.PipelineMavenPluginDao
-
deleteJob
- Specified by:
deleteJobin interfaceorg.jenkinsci.plugins.pipeline.maven.dao.PipelineMavenPluginDao
-
deleteBuild
- Specified by:
deleteBuildin interfaceorg.jenkinsci.plugins.pipeline.maven.dao.PipelineMavenPluginDao
-
cleanup
public void cleanup()- Specified by:
cleanupin interfaceorg.jenkinsci.plugins.pipeline.maven.dao.PipelineMavenPluginDao
-
getOrCreateBuildPrimaryKey
-
getGeneratedPrimaryKey
- Throws:
SQLException
-
getOrCreateArtifactPrimaryKey
-
initializeDatabase
protected void initializeDatabase() -
handleDatabaseInitialisationException
-
getJdbcScheme
- Returns:
- "h2", "mysql"...
-
getSchemaVersion
- Throws:
SQLException
-
testDatabase
Basic tests to ensure that the database is not corrupted- Throws:
RuntimeSqlException
-
listDownstreamJobs
@NonNull @Deprecated public List<String> listDownstreamJobs(@NonNull String jobFullName, int buildNumber) Deprecated.- Specified by:
listDownstreamJobsin interfaceorg.jenkinsci.plugins.pipeline.maven.dao.PipelineMavenPluginDao
-
listDownstreamJobsByArtifact
@NonNull public Map<org.jenkinsci.plugins.pipeline.maven.MavenArtifact,SortedSet<String>> listDownstreamJobsByArtifact(@NonNull String jobFullName, int buildNumber) - Specified by:
listDownstreamJobsByArtifactin interfaceorg.jenkinsci.plugins.pipeline.maven.dao.PipelineMavenPluginDao
-
listDownstreamJobs
@NonNull public SortedSet<String> listDownstreamJobs(@NonNull String groupId, @NonNull String artifactId, @NonNull String version, @Nullable String baseVersion, @NonNull String type, @Nullable String classifier) - Specified by:
listDownstreamJobsin interfaceorg.jenkinsci.plugins.pipeline.maven.dao.PipelineMavenPluginDao
-
listDownstreamPipelinesBasedOnMavenDependencies
-
listDownstreamPipelinesBasedOnMavenDependencies
@Deprecated protected List<String> listDownstreamPipelinesBasedOnMavenDependencies(@NonNull String jobFullName, int buildNumber) Deprecated. -
listDownstreamJobsByArtifactBasedOnMavenDependencies
-
listDownstreamPipelinesBasedOnParentProjectDependencies
@Deprecated protected List<String> listDownstreamPipelinesBasedOnParentProjectDependencies(@NonNull String jobFullName, int buildNumber) Deprecated. -
listDownstreamJobsByArtifactBasedOnParentProjectDependencies
-
listUpstreamJobs
- Specified by:
listUpstreamJobsin interfaceorg.jenkinsci.plugins.pipeline.maven.dao.PipelineMavenPluginDao
-
listUpstreamPipelinesBasedOnMavenDependencies
protected Map<String,Integer> listUpstreamPipelinesBasedOnMavenDependencies(@NonNull String downstreamJobFullName, int downstreamBuildNumber) - Parameters:
downstreamJobFullName-downstreamBuildNumber-- Returns:
-
listUpstreamPipelinesBasedOnParentProjectDependencies
-
listTransitiveUpstreamJobs
@NonNull public Map<String,Integer> listTransitiveUpstreamJobs(@NonNull String jobFullName, int buildNumber) - Specified by:
listTransitiveUpstreamJobsin interfaceorg.jenkinsci.plugins.pipeline.maven.dao.PipelineMavenPluginDao
-
listTransitiveUpstreamJobs
@NonNull public Map<String,Integer> listTransitiveUpstreamJobs(@NonNull String jobFullName, int buildNumber, org.jenkinsci.plugins.pipeline.maven.dao.UpstreamMemory upstreamMemory) - Specified by:
listTransitiveUpstreamJobsin interfaceorg.jenkinsci.plugins.pipeline.maven.dao.PipelineMavenPluginDao
-
getGeneratedArtifacts
@NonNull public List<org.jenkinsci.plugins.pipeline.maven.MavenArtifact> getGeneratedArtifacts(@NonNull String jobFullName, @NonNull int buildNumber) List the artifacts generated by the given build- Specified by:
getGeneratedArtifactsin interfaceorg.jenkinsci.plugins.pipeline.maven.dao.PipelineMavenPluginDao- Parameters:
jobFullName- seeItem.getFullName()buildNumber- seeRun.getNumber()- Returns:
- list of artifact details stored as maps ("gav", "type", "skip_downstream_triggers")
-
getJenkinsMasterPrimaryKey
- Throws:
SQLException
-
getJenkinsDetails
for mocking -
toPrettyString
- Specified by:
toPrettyStringin interfaceorg.jenkinsci.plugins.pipeline.maven.dao.PipelineMavenPluginDao
-
getDatabaseDescription
-
updateBuildOnCompletion
public void updateBuildOnCompletion(@NonNull String jobFullName, int buildNumber, int buildResultOrdinal, long startTimeInMillis, long durationInMillis) - Specified by:
updateBuildOnCompletionin interfaceorg.jenkinsci.plugins.pipeline.maven.dao.PipelineMavenPluginDao
-
getDataSource
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-