net.nemerosa.ontrack.model.support.ConfigurationRepository.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ontrack-model Show documentation
Show all versions of ontrack-model Show documentation
Ontrack module: ontrack-model
package net.nemerosa.ontrack.model.support
import com.fasterxml.jackson.databind.JsonNode
interface ConfigurationRepository {
/**
* Gets the list of items for this configuration class
*/
fun > list(configurationClass: Class): List
/**
* Gets a configuration using its name
*/
fun > find(configurationClass: Class, name: String): T?
/**
* Saves or creates a configuration
*/
fun > save(configuration: T): T
/**
* Deletes a configuration
*/
fun > delete(configurationClass: Class, name: String)
/**
* Method used to migrate existing configurations using their JSON representation as a source
* and rewrites them before saving them.
*
* @param configurationClass Type of the configuration
* @param migration This code takes the raw JSON representation and converts it into a new format just before
* being saved. If it returns null, the configuration does not have to change.
*/
fun > migrate(
configurationClass: Class,
migration: (raw: JsonNode) -> T?
)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy