Interface InstanceLifecycleManager

All Known Implementing Classes:
InstanceLifecycleManagerImpl, InstanceLifecycleManagerSqlDb, InstanceLifecycleManagerSqLite

public interface InstanceLifecycleManager
  • Field Details

  • Method Details

    • createNewInstance

      void createNewInstance(String tenantId, ProvisioningParameters instanceParameters, BindingParameters bindingParameters) throws InternalError
      Throws:
      InternalError
    • deleteInstance

      void deleteInstance(String tenantId) throws InternalError
      Throws:
      InternalError
    • getDataSourceInfo

      DataSourceInfo getDataSourceInfo(String tenantId, boolean forceCacheUpdate) throws InternalError, UnknownTenant
      Throws:
      InternalError
      UnknownTenant
    • getContainerStatus

      InstanceLifecycleManager.ContainerStatus getContainerStatus(String tenantId) throws InternalError
      Throws:
      InternalError
    • hasCredentials

      boolean hasCredentials(String tenantId, boolean forceCacheUpdate) throws InternalError
      Checks if the tenant has credentials for the schema.
      Parameters:
      tenantId - identifier of tenant that is checked
      forceCacheUpdate - 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

      Map<String,TenantMetadata> getAllTenantInfos(boolean forceCacheUpdate) throws InternalError
      Returns all tenants that have a DB container/schema. In contrast to getAllTenants(boolean) this method provides additional tenant properties like database_id if available.
      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
    • getAllTenants

      default Set<String> getAllTenants(boolean forceCacheUpdate) throws InternalError
      Returns all tenants that have a DB container/schema
      Parameters:
      forceCacheUpdate - If set, the current list of tenants is re-determined.
      Returns:
      A set with all tenant ids
      Throws:
      InternalError
    • checkThatTenantExists

      void checkThatTenantExists(String tenantId) throws UnknownTenant, InternalError
      Checks if a schema has been created for a tenant
      Parameters:
      tenantId - identifier of tenant that is checked
      Throws:
      UnknownTenant - is thrown if tenant doesn't exist
      InternalError - is thrown if a problem occurs, if for example service manager or DB cannot be accessed
    • createAndGetLibContainers

      List<DataSourceInfo> createAndGetLibContainers(DataSourceInfo dataSourceInfo) throws InternalError
      Creates 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 !
      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

      List<DataSourceInfo> getLibContainers() throws InternalError
      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
    • getMtLibContainerName

      default String getMtLibContainerName(String databaseId)
      The mt-lib creates a container/schema in each provided database for itself. This function returns the fake tenantId which is used for it.
      Parameters:
      databaseId -
      Returns:
      tenantId for mt-lib schema/container
    • createProvisioningParameters

      default ProvisioningParameters createProvisioningParameters(String databaseId)
      Create InstanceCreateOptions that contain the specified database id
      Parameters:
      databaseId -
      Returns:
      new instance create options with set database id
    • hasDbIdentifiers

      boolean hasDbIdentifiers()
    • insertDbIdentifiers

      void insertDbIdentifiers(DbIdentifiers dbIdentifiers)
    • getDbType

      default DbIdentifiers.DB getDbType()