All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.nemerosa.ontrack.model.support.ConfigurationRepository.kt Maven / Gradle / Ivy

There is a newer version: 4.4.5
Show newest version
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