public class SchemaPerTenantProvisioner extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_SCHEMA_PREFIX |
Constructor and Description |
---|
SchemaPerTenantProvisioner(Connection connection,
String liquibaseConfigPath)
Initializes the new instance based on the given JDBC connections and the path to a liquibase configuration file.
|
SchemaPerTenantProvisioner(Connection connection,
String liquibaseConfigPath,
String schemaPrefix)
Initializes the new instance based on the given JDBC connections, the path to a liquibase configuration file, and
the schema prefix given.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
canEqual(Object other) |
boolean |
equals(Object o) |
Connection |
getConnection() |
String |
getLiquibaseConfigPath() |
com.sap.cloud.sdk.frameworks.liquibase.NameSanitizer |
getNameSanitizer() |
String |
getSchemaPrefix() |
int |
hashCode() |
void |
subscribeTenant(String tenantId)
This method provides the default implementation for the tenant onboarding for a given tenantId.
|
String |
toString() |
void |
unsubscribeTenant(String tenantId)
This method provides the default implementation for the tenant offboarding for a given tenantId.
|
public static final String DEFAULT_SCHEMA_PREFIX
public SchemaPerTenantProvisioner(Connection connection, String liquibaseConfigPath)
The default prefix for the schema used by this constructor is stored in DEFAULT_SCHEMA_PREFIX
.
connection
- The JDBC connection to the database to be managed.liquibaseConfigPath
- The path to a liquibase configuration file containing the schema to use.public SchemaPerTenantProvisioner(Connection connection, String liquibaseConfigPath, @Nullable String schemaPrefix)
connection
- The JDBC connection to the database to be managed.liquibaseConfigPath
- The path to a liquibase configuration file containing the schema to use.schemaPrefix
- The prefix to be used for the name of each tenant schema.public void subscribeTenant(String tenantId) throws IllegalArgumentException, SQLException, liquibase.exception.LiquibaseException
tenantId
- The id of the tenant to build the schema for.IllegalArgumentException
- If the constructed schema name contains invalid characters.SQLException
- If there was a problem during the creation of the schema.liquibase.exception.LiquibaseException
- If there was a problem while applying the liquibase configuration.public void unsubscribeTenant(String tenantId) throws IllegalArgumentException, SQLException
tenantId
- The id of the tenant to drop the schema for.IllegalArgumentException
- If the constructed schema name contains invalid characters.SQLException
- If there was a problem with the SQL command.public com.sap.cloud.sdk.frameworks.liquibase.NameSanitizer getNameSanitizer()
public Connection getConnection()
public String getLiquibaseConfigPath()
public String getSchemaPrefix()
protected boolean canEqual(Object other)
Copyright © 2019 SAP SE. All rights reserved.