Class InstanceLifecycleManagerImpl
java.lang.Object
com.sap.cds.feature.mt.lib.subscription.InstanceLifecycleManagerImpl
- 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 -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckThatTenantExists(String tenantId) Checks if a schema has been created for a tenantvoidcreateAndGetLibContainers(DataSourceInfo dataSourceInfo) Creates on the database used by the given datasource a hdi container/schema reserved of the library itself.voidcreateNewInstance(String tenantId, ProvisioningParameters instanceParameters, 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 DataSourceInfogetDataSourceInfoInternal(String tenantId, 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
-
Field Details
-
CREATION_SUCCEEDED
- See Also:
-
-
Method Details
-
createNewInstance
public void createNewInstance(String tenantId, ProvisioningParameters instanceParameters, 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
-
getDataSourceInfoInternal
protected DataSourceInfo getDataSourceInfoInternal(String tenantId, boolean forceCacheUpdate) throws InternalError, UnknownTenant - 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 existInternalError- is thrown if a problem occurs, if for example service manager or DB cannot be accessed
-
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.
-
clearCache
public void clearCache() -
insertDbIdentifiers
- Specified by:
insertDbIdentifiersin interfaceInstanceLifecycleManager
-
getDbType
- Specified by:
getDbTypein interfaceInstanceLifecycleManager
-