Class InstanceLifecycleManagerSqlDb
java.lang.Object
com.sap.cds.feature.mt.lib.subscription.InstanceLifecycleManagerSqlDb
- All Implemented Interfaces:
InstanceLifecycleManager
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.sap.cds.feature.mt.lib.subscription.InstanceLifecycleManager
InstanceLifecycleManager.ContainerStatus -
Field Summary
FieldsFields inherited from interface com.sap.cds.feature.mt.lib.subscription.InstanceLifecycleManager
DATABASE_ID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckThatTenantExists(String tenantId) Checks if a schema has been created for a tenantcreateAndGetLibContainers(DataSourceInfo dataSourceInfo) Creates on the database used by the given datasource a hdi container/schema reserved of the library itself.voidcreateNewInstance(String tenantId, ProvisioningParameters provisioningParameters, BindingParameters bindingParameters) voiddeleteInstance(String tenantId) getAllTenantInfos(boolean forceCacheUpdate) Returns all tenants that have a DB container/schema.getContainerStatus(String tenantId) getDataSourceInfo(String tenantId, boolean forceCacheUpdate) protected DbIdentifiersbooleanhasCredentials(String tenantId, boolean forceCacheUpdate) Checks if the tenant has credentials for the schema.voidinsertDbIdentifiers(DbIdentifiers dbIdentifiers) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.sap.cds.feature.mt.lib.subscription.InstanceLifecycleManager
createProvisioningParameters, getAllTenants, getMtLibContainerName
-
Field Details
-
SCHEMA_PREFIX
- See Also:
-
-
Constructor Details
-
InstanceLifecycleManagerSqlDb
- Throws:
InternalError
-
-
Method Details
-
createNewInstance
public void createNewInstance(String tenantId, ProvisioningParameters provisioningParameters, BindingParameters bindingParameters) throws InternalError - Specified by:
createNewInstancein interfaceInstanceLifecycleManager- Throws:
InternalError
-
deleteInstance
- Specified by:
deleteInstancein interfaceInstanceLifecycleManager- Throws:
InternalError
-
getDataSourceInfo
public DataSourceInfo getDataSourceInfo(String tenantId, boolean forceCacheUpdate) throws InternalError, UnknownTenant - Specified by:
getDataSourceInfoin interfaceInstanceLifecycleManager- Throws:
InternalErrorUnknownTenant
-
getContainerStatus
public InstanceLifecycleManager.ContainerStatus getContainerStatus(String tenantId) throws InternalError - Specified by:
getContainerStatusin interfaceInstanceLifecycleManager- Throws:
InternalError
-
hasCredentials
Description copied from interface:InstanceLifecycleManagerChecks if the tenant has credentials for the schema.- Specified by:
hasCredentialsin interfaceInstanceLifecycleManager- Parameters:
tenantId- identifier of tenant that is checkedforceCacheUpdate- If set, the current tenant is re-determined.- Returns:
- true if credentials are available
- Throws:
InternalError- is thrown if a problem occurs, if for example service manager cannot be accessed
-
getAllTenantInfos
Description copied from interface:InstanceLifecycleManagerReturns all tenants that have a DB container/schema. In contrast toInstanceLifecycleManager.getAllTenants(boolean)this method provides additional tenant properties like database_id if available.- Specified by:
getAllTenantInfosin interfaceInstanceLifecycleManager- Parameters:
forceCacheUpdate- If set, the current list of tenants is re-determined.- Returns:
- A map with all
TenantMetadata. Tenant id is used as key. - Throws:
InternalError
-
checkThatTenantExists
Description copied from interface:InstanceLifecycleManagerChecks if a schema has been created for a tenant- Specified by:
checkThatTenantExistsin interfaceInstanceLifecycleManager- Parameters:
tenantId- identifier of tenant that is checked- Throws:
UnknownTenant- is thrown if tenant doesn't exist
-
createAndGetLibContainers
public List<DataSourceInfo> createAndGetLibContainers(DataSourceInfo dataSourceInfo) throws InternalError Description copied from interface:InstanceLifecycleManagerCreates on the database used by the given datasource a hdi container/schema reserved of the library itself. If the parameter is null or the database cannot be determined, the missing containers are created on all databases. When used with Hana a service instance is created for tenant MT_LIB_TENANT-"database id" No error is thrown if container creation failed !- Specified by:
createAndGetLibContainersin interfaceInstanceLifecycleManager- Parameters:
dataSourceInfo- Credentials of dataSource for which lib container is created- Returns:
- Info for lib container
- Throws:
InternalError- is thrown when a communication problems arises
-
getLibContainers
- Specified by:
getLibContainersin interfaceInstanceLifecycleManager- Returns:
- the credentials of mt-libs's own containers/schemas. In case of HANA, the list is based on the current state of the instance manager client libs cache.
- Throws:
InternalError- is thrown when a communication problems arises
-
insertDbIdentifiers
- Specified by:
insertDbIdentifiersin interfaceInstanceLifecycleManager
-
getDbIdentifiers
-
getDbType
- Specified by:
getDbTypein interfaceInstanceLifecycleManager
-