
ch.sourcepond.maven.plugin.jenkins.config.Config Maven / Gradle / Ivy
/*Copyright (C) 2015 Roland Hauser,
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.*/
package ch.sourcepond.maven.plugin.jenkins.config;
import java.io.File;
import java.net.URI;
import java.nio.file.Path;
import java.util.Map;
import org.apache.maven.settings.Proxy;
import org.apache.maven.settings.Settings;
import ch.sourcepond.maven.plugin.jenkins.CliMojo;
/**
* Provides access to all parameters passed to {@link CliMojo}. A {@link Config}
* instance should only be created by {@link CliMojo#execute()}.
*
*/
public interface Config {
/**
* Determines whether SSL is used for connecting to Jenkins. If this method
* returns {@code true} {@link #getTrustStoreOrNull()} and
* {@link #getTrustStorePasswordOrNull()} must return valid non-null values.
*
* @return {@code true} if a secure connection is used, {@code false}
* otherwise.
*/
boolean isSecure();
/**
* Returns the {@link Settings} instance passed by Maven to {@link CliMojo}.
*
* @return Settings, never {@code null}
*/
Settings getSettings();
/**
* Returns the download directory of jenkins-cli.jar specified through mojo
* parameter jenkinscliDirectory.
*
* @return Work-directory, never {@code null}
*/
Path getJenkinscliDirectory();
/**
* Returns the custom jenkins-cli.jar to be used by this plugin; specified
* through mojo parameter customJenkinsCliJar.
*
* @return Custom jenkins-cli.jar or {@code null}
*/
File getCustomJenkinsCliJarOrNull();
/**
* Returns the base URL specified through mojo parameter baseUrl.
*
* @return Base URL, never {@code null}
*/
URI getBaseUri();
/**
* Returns whether private key loading is skipped. Specified through mojo
* parameter noKeyAuth
*
* @return {@code true} if loading is skipped, {@code false} otherwise.
*/
boolean isNoKeyAuth();
/**
* Returns whether SSL certificate check is skipped entirely. Specified
* through mojo parameter noCertificateCheck
*
* @return {@code true} if certificate check is skipped, {@code false}
* otherwise.
*/
boolean isNoCertificateCheck();
/**
* Returns the SSH authentication private key specified through mojo
* parameter privateKey.
*
* @return Private key or {@code null}
*/
String getPrivateKeyOrNull();
/**
* Returns the proxy from the Maven settings which has been specified
* through mojo parameter proxyId.
*
* @return Proxy definition or {@code null}
*/
Proxy getProxyOrNull();
/**
* Returns the command to be executed by the CLI specified through mojo
* parameter command.
*
* @return Command, never {@code null}
*/
String getCommand();
/**
* Returns the file to be used as stdin by the CLI; specified through mojo
* parameter stdin.
*
* @return Path to stdin or {@code null}
*/
Path getStdinOrNull();
/**
* Returns the XSLT file to be applied on the stdin; specified through mojo
* parameter stdinXslt.
*
* @return XSLT file or {@code null}
*/
File getStdinXsltOrNull();
/**
* Returns the custom parameters which should be passed to the XSLT
* specified by {@link #getStdinXsltOrNull()}. If no parameters have been
* specified, {@code null} will be returned. Specified through mojo
* parameter stdinXsltParams.
*
* @return Stdin parameters or {@code null}
*/
Map getStdinXsltParamsOrNull();
/**
* Returns the file to be used as stdout by the CLI; specified through mojo
* parameter stdout.
*
* @return Path to stdout or {@code null}
*/
Path getStdoutOrNull();
/**
* Returns the XSLT file to be applied on the stdout; specified through mojo
* parameter stdoutXslt.
*
* @return XSLT file or {@code null}
*/
File getStdoutXsltOrNull();
/**
* Returns the custom parameters which should be passed to the XSLT
* specified by {@link #getStdoutXsltOrNull()}. If no parameters have been
* specified, {@code null} will be returned. Specified through mojo
* parameter stdoutXsltParams.
*
* @return Stdout parameters or {@code null}
*/
Map getStdoutXsltParamsOrNull();
/**
* Returns whether the standard output of the CLI should be appended to the
* target file. Specified through mojo parameter append.
*
* @return {@code true} if appending, {@code false} if overwriting.
*/
boolean isAppending();
/**
* Returns the download link of the jenkins-cli.jar to be used by the
* plugin. The cli-uri is the concatenation of the required mojo parameters
* baseUrl and cliJar.
*
* @return Cli-jar URI, never {@code null}.
*/
URI getCliJarUri();
/**
* Returns the trust-store to be used by the CLI specified through mojo
* parameter trustStore.
*
* @return Trust-store or {@code null}
*/
File getTrustStoreOrNull();
/**
* Returns the password of the trust-store to be used by the CLI. Specified
* through mojo parameter trustStorePassword.
*
* @return Password or {@code null}
*/
String getTrustStorePasswordOrNull();
/**
* Returns the absolute path to the local copy of the jenkins-cli.jar. The
* file is downloaded from the URI returned by {@link #getCliJarUri()}. The
* download is be performed during building this config (see
* {@link ConfigBuilder#build(org.apache.maven.plugin.logging.Log)}).
*
* @return Absolute path, never {@code null}
*/
String getDownloadedCliJar();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy