Class InstanceLifecycleManagerSqLite
java.lang.Object
com.sap.cds.feature.mt.lib.subscription.InstanceLifecycleManagerSqLite
- All Implemented Interfaces:
InstanceLifecycleManager
This implementation of
InstanceLifecycleManager intended for multi tenancy based on
SQLite database files. It should not be used in production.-
Nested Class Summary
Nested classes/interfaces inherited from interface com.sap.cds.feature.mt.lib.subscription.InstanceLifecycleManager
InstanceLifecycleManager.ContainerStatus -
Field Summary
Fields inherited from interface com.sap.cds.feature.mt.lib.subscription.InstanceLifecycleManager
DATABASE_ID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckThatTenantExists(String tenant) 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 tenant, ProvisioningParameters provisioningParameters, BindingParameters bindingParameters) voiddeleteInstance(String tenant) getAllTenantInfos(boolean forceCacheUpdate) Returns all tenants that have a DB container/schema.getContainerStatus(String tenant) getDataSourceInfo(String tenant, boolean forceCacheUpdate) booleanhasCredentials(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
-
Constructor Details
-
InstanceLifecycleManagerSqLite
-
InstanceLifecycleManagerSqLite
-
-
Method Details
-
createNewInstance
public void createNewInstance(String tenant, ProvisioningParameters provisioningParameters, BindingParameters bindingParameters) - Specified by:
createNewInstancein interfaceInstanceLifecycleManager
-
deleteInstance
- Specified by:
deleteInstancein interfaceInstanceLifecycleManager
-
getDataSourceInfo
public DataSourceInfo getDataSourceInfo(String tenant, boolean forceCacheUpdate) throws UnknownTenant - Specified by:
getDataSourceInfoin interfaceInstanceLifecycleManager- Throws:
UnknownTenant
-
getContainerStatus
- Specified by:
getContainerStatusin interfaceInstanceLifecycleManager
-
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.
-
checkThatTenantExists
Description copied from interface:InstanceLifecycleManagerChecks if a schema has been created for a tenant- Specified by:
checkThatTenantExistsin interfaceInstanceLifecycleManager- Parameters:
tenant- identifier of tenant that is checked- Throws:
UnknownTenant- is thrown if tenant doesn't exist
-
createAndGetLibContainers
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
-
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.
-
insertDbIdentifiers
- Specified by:
insertDbIdentifiersin interfaceInstanceLifecycleManager
-
getDbType
- Specified by:
getDbTypein interfaceInstanceLifecycleManager
-