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
-
Constructor Summary
ModifierConstructorDescriptionprotected
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
void
cleanup()
void
close()
void
deleteBuild
(String jobFullName, int buildNumber) void
org.jenkinsci.plugins.pipeline.maven.dao.PipelineMavenPluginDao.Builder
protected String
protected DataSource
List<org.jenkinsci.plugins.pipeline.maven.MavenArtifact>
getGeneratedArtifacts
(String jobFullName, int buildNumber) List the artifacts generated by the given buildprotected Long
getGeneratedPrimaryKey
(PreparedStatement stmt, String column) abstract String
protected MigrationStep.JenkinsDetails
for mockingprotected long
getOrCreateArtifactPrimaryKey
(String groupId, String artifactId, String version, String type, String classifier) protected long
getOrCreateBuildPrimaryKey
(String jobFullName, int buildNumber) protected int
protected void
protected void
List<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) void
recordBuildUpstreamCause
(String upstreamJobName, int upstreamBuildNumber, String downstreamJobName, int downstreamBuildNumber) void
recordDependency
(String jobFullName, int buildNumber, String groupId, String artifactId, String version, String type, String scope, boolean ignoreUpstreamTriggers, String classifier) void
recordGeneratedArtifact
(String jobFullName, int buildNumber, String groupId, String artifactId, String version, String type, String baseVersion, String repositoryUrl, boolean skipDownstreamTriggers, String extension, String classifier) void
recordParentProject
(String jobFullName, int buildNumber, String parentGroupId, String parentArtifactId, String parentVersion, boolean ignoreUpstreamTriggers) protected abstract void
void
protected void
Basic tests to ensure that the database is not corruptedvoid
updateBuildOnCompletion
(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, wait
Methods 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:
getBuilder
in 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:
recordDependency
in 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:
listDependencies
in 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:
recordParentProject
in 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:
recordGeneratedArtifact
in interfaceorg.jenkinsci.plugins.pipeline.maven.dao.PipelineMavenPluginDao
-
recordBuildUpstreamCause
public void recordBuildUpstreamCause(String upstreamJobName, int upstreamBuildNumber, String downstreamJobName, int downstreamBuildNumber) - Specified by:
recordBuildUpstreamCause
in interfaceorg.jenkinsci.plugins.pipeline.maven.dao.PipelineMavenPluginDao
-
renameJob
- Specified by:
renameJob
in interfaceorg.jenkinsci.plugins.pipeline.maven.dao.PipelineMavenPluginDao
-
deleteJob
- Specified by:
deleteJob
in interfaceorg.jenkinsci.plugins.pipeline.maven.dao.PipelineMavenPluginDao
-
deleteBuild
- Specified by:
deleteBuild
in interfaceorg.jenkinsci.plugins.pipeline.maven.dao.PipelineMavenPluginDao
-
cleanup
public void cleanup()- Specified by:
cleanup
in 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:
listDownstreamJobs
in 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:
listDownstreamJobsByArtifact
in 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:
listDownstreamJobs
in 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:
listUpstreamJobs
in 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:
listTransitiveUpstreamJobs
in 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:
listTransitiveUpstreamJobs
in 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:
getGeneratedArtifacts
in 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:
toPrettyString
in 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:
updateBuildOnCompletion
in interfaceorg.jenkinsci.plugins.pipeline.maven.dao.PipelineMavenPluginDao
-
getDataSource
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-