Package org.bonitasoft.engine.tenant
Class TenantStateManager
- java.lang.Object
-
- org.bonitasoft.engine.tenant.TenantStateManager
-
@Component public class TenantStateManager extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description TenantStateManager(UserTransactionService transactionService, PlatformService platformService, NodeConfiguration nodeConfiguration, SessionService sessionService, long tenantId, SchedulerService schedulerService, BroadcastService broadcastService, TenantServicesManager tenantServicesManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivate()Activate the tenant: - resume elements - start services - tenant has the status ACTIVATED in database - services are started on other nodes **Called outside a transaction in a platform-level session**voiddeactivate()Deactivate the tenant: - stop services - tenant has the status DEACTIVATED in database - services are stopped on other nodes **Called outside a transaction with a platform-level session**<T> TexecuteTenantManagementOperation(java.lang.String operationName, java.util.concurrent.Callable<T> operation)protected PlatformServiceAccessorgetPlatformAccessor()longgetTenantId()voidpause()Pause the tenant: - pause services - tenant has the status PAUSED in database - other nodes pause the services **Called outside a transaction with a tenant-level session**voidresume()Resume the tenant: - resume services - tenant has the status ACTIVATED in database - other nodes resume the services **Called outside a transaction with a tenant-level session**voidstart()Start the tenant: - start services - resume elements if its the only node **Called outside of a transaction in a platform-level session**voidstop()Stop the tenant: - stop services - delete session if its the only node **Called outside of a transaction in a platform-level session**
-
-
-
Constructor Detail
-
TenantStateManager
public TenantStateManager(UserTransactionService transactionService, PlatformService platformService, NodeConfiguration nodeConfiguration, SessionService sessionService, @Value("${tenantId}") long tenantId, SchedulerService schedulerService, BroadcastService broadcastService, TenantServicesManager tenantServicesManager)
-
-
Method Detail
-
getTenantId
public long getTenantId()
-
stop
public void stop() throws java.lang.ExceptionStop the tenant: - stop services - delete session if its the only node **Called outside of a transaction in a platform-level session**- Throws:
java.lang.Exception
-
start
public void start() throws java.lang.ExceptionStart the tenant: - start services - resume elements if its the only node **Called outside of a transaction in a platform-level session**- Throws:
java.lang.Exception
-
getPlatformAccessor
protected PlatformServiceAccessor getPlatformAccessor() throws org.bonitasoft.engine.exception.BonitaHomeNotSetException, java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.ClassNotFoundException, java.io.IOException, org.bonitasoft.engine.exception.BonitaHomeConfigurationException
- Throws:
org.bonitasoft.engine.exception.BonitaHomeNotSetExceptionjava.lang.InstantiationExceptionjava.lang.IllegalAccessExceptionjava.lang.ClassNotFoundExceptionjava.io.IOExceptionorg.bonitasoft.engine.exception.BonitaHomeConfigurationException
-
pause
public void pause() throws java.lang.ExceptionPause the tenant: - pause services - tenant has the status PAUSED in database - other nodes pause the services **Called outside a transaction with a tenant-level session**- Throws:
java.lang.Exception
-
resume
public void resume() throws java.lang.ExceptionResume the tenant: - resume services - tenant has the status ACTIVATED in database - other nodes resume the services **Called outside a transaction with a tenant-level session**- Throws:
java.lang.Exception
-
activate
public void activate() throws java.lang.ExceptionActivate the tenant: - resume elements - start services - tenant has the status ACTIVATED in database - services are started on other nodes **Called outside a transaction in a platform-level session**- Throws:
java.lang.Exception
-
deactivate
public void deactivate() throws java.lang.ExceptionDeactivate the tenant: - stop services - tenant has the status DEACTIVATED in database - services are stopped on other nodes **Called outside a transaction with a platform-level session**- Throws:
java.lang.Exception
-
executeTenantManagementOperation
public <T> T executeTenantManagementOperation(java.lang.String operationName, java.util.concurrent.Callable<T> operation) throws java.lang.Exception- Throws:
java.lang.Exception
-
-