org.etlunit.feature.database.DatabaseConnectionFacade Maven / Gradle / Ivy
package org.etlunit.feature.database;
import org.etlunit.parser.ETLTestValueObject;
import java.util.List;
/**
* 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();
}
public boolean declaresModes() {
return delegate.declaresModes();
}
public boolean isModeValid(String mode) {
throw new UnsupportedOperationException("Facade is modeless");
}
public String getAdminUserName()
{
return delegate.getAdminUserName();
}
public String getAdminPassword()
{
return delegate.getAdminPassword();
}
public String getImplementationId() {
return delegate.getImplementationId();
}
public String getDatabaseName() {
return delegate.getDatabaseName(targetMode);
}
public String getDatabaseName(String mode) {
throw new UnsupportedOperationException("Facade is modeless");
}
public String getLoginName() {
return delegate.getLoginName(targetMode);
}
public String getLoginName(String mode) {
throw new UnsupportedOperationException("Facade is modeless");
}
public String getPassword() {
return delegate.getPassword(targetMode);
}
public String getPassword(String mode) {
throw new UnsupportedOperationException("Facade is modeless");
}
public String getServerName() {
return delegate.getServerName();
}
public List getSchemaScripts() {
return delegate.getSchemaScripts();
}
public ETLTestValueObject getDatabaseConfiguration() {
return delegate.getDatabaseConfiguration();
}
}