Package com.sap.cloud.mt.subscription
Class InstanceLifecycleManagerImpl
java.lang.Object
com.sap.cloud.mt.subscription.InstanceLifecycleManagerImpl
- All Implemented Interfaces:
InstanceLifecycleManager
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.sap.cloud.mt.subscription.InstanceLifecycleManager
InstanceLifecycleManager.ContainerStatus -
Field Summary
Fields inherited from interface com.sap.cloud.mt.subscription.InstanceLifecycleManager
DATABASE_ID -
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, com.sap.xsa.core.instancemanager.client.InstanceCreationOptions instanceCreationOptions) 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) booleanvoidinsertDbIdentifiers(DbIdentifiers dbIdentifiers) booleanstatic voidsetBlockRefresh(BooleanSupplier blockRefresh) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.sap.cloud.mt.subscription.InstanceLifecycleManager
createInstanceCreationOptions, getAllTenants, getMtLibContainerName
-
Method Details
-
createNewInstance
public void createNewInstance(String tenantId, com.sap.xsa.core.instancemanager.client.InstanceCreationOptions instanceCreationOptions) 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
-
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.
-
hasDbIdentifiers
public boolean hasDbIdentifiers()- Specified by:
hasDbIdentifiersin interfaceInstanceLifecycleManager
-
insertDbIdentifiers
- Specified by:
insertDbIdentifiersin interfaceInstanceLifecycleManager
-
getDbType
- Specified by:
getDbTypein interfaceInstanceLifecycleManager
-
knowsDbCredentials
public boolean knowsDbCredentials()- Specified by:
knowsDbCredentialsin interfaceInstanceLifecycleManager
-
setBlockRefresh
- Parameters:
blockRefresh- lambda expression that is called before each refresh to decide if a refresh shall be executed. Needed for unit tests to enable refresh in a controlled way.
-