net.nemerosa.ontrack.extension.jenkins.autoversioning.JenkinsPostProcessingSettingsManager.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ontrack-extension-jenkins Show documentation
Show all versions of ontrack-extension-jenkins Show documentation
Ontrack module: ontrack-extension-jenkins
package net.nemerosa.ontrack.extension.jenkins.autoversioning
import net.nemerosa.ontrack.model.form.Form
import net.nemerosa.ontrack.model.form.intField
import net.nemerosa.ontrack.model.form.textField
import net.nemerosa.ontrack.model.security.SecurityService
import net.nemerosa.ontrack.model.settings.AbstractSettingsManager
import net.nemerosa.ontrack.model.settings.CachedSettingsService
import net.nemerosa.ontrack.model.support.SettingsRepository
import net.nemerosa.ontrack.model.support.setInt
import net.nemerosa.ontrack.model.support.setString
import org.springframework.stereotype.Component
@Component
class JenkinsPostProcessingSettingsManager(
cachedSettingsService: CachedSettingsService,
securityService: SecurityService,
private val settingsRepository: SettingsRepository,
) : AbstractSettingsManager(
JenkinsPostProcessingSettings::class.java,
cachedSettingsService,
securityService
) {
override fun doSaveSettings(settings: JenkinsPostProcessingSettings) {
settingsRepository.setString(settings::config)
settingsRepository.setString(settings::job)
settingsRepository.setInt(settings::retries)
settingsRepository.setInt(settings::retriesDelaySeconds)
}
override fun getId(): String = "jenkins-auto-versioning-processing"
override fun getTitle(): String = "Jenkins Auto Versioning Processing"
override fun getSettingsForm(settings: JenkinsPostProcessingSettings): Form =
Form.create()
.textField(
JenkinsPostProcessingSettings::config,
settings.config
)
.textField(
JenkinsPostProcessingSettings::job,
settings.job
)
.intField(
JenkinsPostProcessingSettings::retries,
settings.retries
)
.intField(
JenkinsPostProcessingSettings::retriesDelaySeconds,
settings.retriesDelaySeconds
)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy