org.bitbucket.bradleysmithllc.etlunit.feature.database.DatabaseConnectionFacade Maven / Gradle / Ivy
package org.bitbucket.bradleysmithllc.etlunit.feature.database;
import com.fasterxml.jackson.databind.JsonNode;
import org.bitbucket.bradleysmithllc.etlunit.feature.database.db.Database;
import org.bitbucket.bradleysmithllc.etlunit.feature.database.json.DatabaseDefinitionsProperty;
import java.net.UnknownHostException;
import java.util.List;
import java.util.Map;
/**
* This object wraps a database connection, only permitting one mode to be used.
*/
public class DatabaseConnectionFacade implements DatabaseConnection {
private final DatabaseConnection delegate;
private final String targetMode;
public DatabaseConnectionFacade(DatabaseConnection delegate, String mode) {
targetMode = mode;
this.delegate = delegate;
}
public String getId() {
return delegate.getId();
}
@Override
public Database getDatabase() {
return delegate.getDatabase();
}
@Override
public boolean hasDatabase() {
return delegate.hasDatabase();
}
public String getAdminUserName()
{
return delegate.getAdminUserName();
}
public String getAdminPassword()
{
return delegate.getAdminPassword();
}
public String getImplementationId() {
return delegate.getImplementationId();
}
public String getServerName() {
return delegate.getServerName();
}
@Override
public String getServerAddress() throws UnknownHostException {
return delegate.getServerAddress();
}
public List getSchemaScripts() {
return delegate.getSchemaScripts();
}
public DatabaseDefinitionsProperty getDatabaseConfiguration() {
return delegate.getDatabaseConfiguration();
}
@Override
public JsonNode getRawDatabaseConfiguration() {
return delegate.getRawDatabaseConfiguration();
}
@Override
public Map getDatabaseProperties() {
return delegate.getDatabaseProperties();
}
@Override
public void setDatabase(Database database) {
delegate.setDatabase(database);
}
@Override
public int getServerPort() {
return delegate.getServerPort();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy