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

net.nemerosa.ontrack.extension.jenkins.client.DefaultJenkinsClientFactory.kt Maven / Gradle / Ivy

There is a newer version: 4.4.5
Show newest version
package net.nemerosa.ontrack.extension.jenkins.client

import net.nemerosa.ontrack.extension.jenkins.JenkinsConfiguration
import net.nemerosa.ontrack.extension.jenkins.JenkinsConfigurationProperties
import net.nemerosa.ontrack.extension.support.client.ClientConnection
import net.nemerosa.ontrack.extension.support.client.ClientFactory
import org.springframework.stereotype.Component

@Component
class DefaultJenkinsClientFactory(
        private val clientFactory: ClientFactory,
        private val jenkinsConfigurationProperties: JenkinsConfigurationProperties
) : JenkinsClientFactory {

    override fun getClient(configuration: JenkinsConfiguration): JenkinsClient {
        return DefaultJenkinsClient(
                clientFactory.getJsonClient(
                        ClientConnection(
                                configuration.url,
                                configuration.user,
                                configuration.password,
                                jenkinsConfigurationProperties.timeout
                        )
                )
        )
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy