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

ai.digital.integration.server.common.domain.providers.DefaultProviderContainer.kt Maven / Gradle / Ivy

There is a newer version: 23.3.0-1025.941
Show newest version
package ai.digital.integration.server.common.domain.providers

import groovy.lang.Closure
import org.gradle.api.Action
import org.gradle.api.NamedDomainObjectContainer
import org.gradle.api.Project
import org.gradle.api.provider.Property
import org.gradle.kotlin.dsl.property
import org.gradle.util.internal.ConfigureUtil

@Suppress("UnstableApiUsage")
internal class DefaultProviderContainer(delegate: NamedDomainObjectContainer, project: Project) :
    OperatorProviderContainer, NamedDomainObjectContainer by delegate {

    private var _activeProviderName: Property = project.objects.property()

    override var activeProviderName: String
        get() = _activeProviderName.get()
        set(value) {
            _activeProviderName.set(value)
        }

    override fun awsEks(): AwsEksProvider = awsEks {}

    override fun awsEks(closure: Closure<*>): AwsEksProvider {
        return awsEks(ConfigureUtil.configureUsing(closure))
    }

    override fun awsEks(action: Action): AwsEksProvider {
        return (findByName("awsEks")
            ?: create("awsEks") {
                action.execute(this)
            }) as AwsEksProvider
    }

    override fun awsOpenshift(): AwsOpenshiftProvider = awsOpenshift {}

    override fun awsOpenshift(closure: Closure<*>): AwsOpenshiftProvider {
        return awsOpenshift(ConfigureUtil.configureUsing(closure))
    }

    override fun awsOpenshift(action: Action): AwsOpenshiftProvider {
        return (findByName("awsOpenshift")
            ?: create("awsOpenshift") {
                action.execute(this)
            }) as AwsOpenshiftProvider
    }

    override fun azureAks(): AzureAksProvider = azureAks {}

    override fun azureAks(closure: Closure<*>): AzureAksProvider {
        return azureAks(ConfigureUtil.configureUsing(closure))
    }

    override fun azureAks(action: Action): AzureAksProvider {
        return (findByName("azureAks")
            ?: create("azureAks") {
                action.execute(this)
            }) as AzureAksProvider
    }

    override fun gcpGke(): GcpGkeProvider = gcpGke {}

    override fun gcpGke(closure: Closure<*>): GcpGkeProvider {
        return gcpGke(ConfigureUtil.configureUsing(closure))
    }

    override fun gcpGke(action: Action): GcpGkeProvider {
        return (findByName("gcpGke")
            ?: create("gcpGke") {
                action.execute(this)
            }) as GcpGkeProvider
    }

    override fun onPremise(): OnPremiseProvider = onPremise {}

    override fun onPremise(closure: Closure<*>): OnPremiseProvider {
        return onPremise(ConfigureUtil.configureUsing(closure))
    }

    override fun onPremise(action: Action): OnPremiseProvider {
        return (findByName("onPremise")
            ?: create("onPremise") {
                action.execute(this)
            }) as OnPremiseProvider
    }

    override fun vmwareOpenshift(): VmwareOpenshiftProvider = vmwareOpenshift {}

    override fun vmwareOpenshift(closure: Closure<*>): VmwareOpenshiftProvider {
        return vmwareOpenshift(ConfigureUtil.configureUsing(closure))
    }

    override fun vmwareOpenshift(action: Action): VmwareOpenshiftProvider {
        return (findByName("vmwareOpenshift")
            ?: create("vmwareOpenshift") {
                action.execute(this)
            }) as VmwareOpenshiftProvider
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy