Class ServiceManagerCache
java.lang.Object
com.sap.cds.feature.mt.lib.subscription.ServiceManagerCache
For performance reasons the SM should not be accessed with single requests.Therefore, a cache is used that is filled by a scheduled
executer at a configurable time interval. It uses method getManagedInstances() to get all information with one request.
Operations that must be accurate, use a forceCacheUpdate flag to enforce SM access.
-
Constructor Summary
ConstructorsConstructorDescriptionServiceManagerCache(ServiceManager serviceManager, Duration smCacheRefreshInterval, ResilienceConfig resilienceConfig) ServiceManagerCache(ServiceManager serviceManager, Duration smCacheRefreshInterval, ResilienceConfig resilienceConfig, boolean acceptInstancesWithoutTenant, boolean ignoreDuplicateTenantInstances) -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateInstance(String tenantId, ProvisioningParameters provisioningParameters, BindingParameters bindingParameters) voiddeleteInstance(String tenantId) getInstance(String tenantId, boolean forceCacheUpdate) getInstances(boolean forceCacheUpdate) static voidsetAfterFillCache(Callable<Void> afterFillCache) static voidsetBlockRefresh(BooleanSupplier blockRefresh)
-
Constructor Details
-
ServiceManagerCache
public ServiceManagerCache(ServiceManager serviceManager, Duration smCacheRefreshInterval, ResilienceConfig resilienceConfig) -
ServiceManagerCache
public ServiceManagerCache(ServiceManager serviceManager, Duration smCacheRefreshInterval, ResilienceConfig resilienceConfig, boolean acceptInstancesWithoutTenant, boolean ignoreDuplicateTenantInstances)
-
-
Method Details
-
getInstance
public Optional<ServiceInstance> getInstance(String tenantId, boolean forceCacheUpdate) throws InternalError - Throws:
InternalError
-
getInstances
- Throws:
InternalError
-
deleteInstance
- Throws:
InternalError
-
createInstance
public ServiceInstance createInstance(String tenantId, ProvisioningParameters provisioningParameters, BindingParameters bindingParameters) throws InternalError - Throws:
InternalError
-
setBlockRefresh
-
clearCache
public void clearCache() -
setAfterFillCache
-