
org.kuali.common.deploy.DeployContext Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kuali-deploy Show documentation
Show all versions of kuali-deploy Show documentation
Project containing deployment logic for Kuali applications
The newest version!
package org.kuali.common.deploy;
import java.util.List;
import org.kuali.common.deploy.env.model.DeployEnvironment;
import org.kuali.common.util.Assert;
import org.kuali.common.util.maven.model.Artifact;
import org.kuali.common.util.secure.channel.SecureChannel;
import com.google.common.base.Optional;
import com.google.common.collect.ImmutableList;
public final class DeployContext {
private final SecureChannel channel;
private final DeployEnvironment environment;
private final Artifact application;
private final Optional jdbcDriver;
private final List configFiles;
public DeployEnvironment getEnvironment() {
return environment;
}
public Artifact getApplication() {
return application;
}
public Optional getJdbcDriver() {
return jdbcDriver;
}
public List getConfigFiles() {
return configFiles;
}
public SecureChannel getChannel() {
return channel;
}
public static class Builder {
// Required
private final SecureChannel channel;
private final DeployEnvironment environment;
private final Artifact application;
// Optional
private Optional jdbcDriver = Optional.absent();
private List configFiles = ImmutableList.of();
public Builder(DeployEnvironment environment, SecureChannel channel, Artifact application) {
this.channel = channel;
this.environment = environment;
this.application = application;
}
public Builder jdbcDriver(Optional jdbcDriver) {
this.jdbcDriver = jdbcDriver;
return this;
}
public Builder jdbcDriver(Artifact jdbcDriver) {
return jdbcDriver(Optional.fromNullable(jdbcDriver));
}
public Builder configFiles(List configFiles) {
this.configFiles = configFiles;
return this;
}
public DeployContext build() {
Assert.noNulls(environment, channel, application, jdbcDriver, configFiles);
this.configFiles = ImmutableList.copyOf(configFiles);
return new DeployContext(this);
}
}
private DeployContext(Builder builder) {
this.environment = builder.environment;
this.channel = builder.channel;
this.application = builder.application;
this.jdbcDriver = builder.jdbcDriver;
this.configFiles = builder.configFiles;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy