Package org.bonitasoft.engine.platform
Interface PlatformService
-
- All Known Implementing Classes:
PlatformServiceImpl
public interface PlatformService- Author:
- Charles Souillard, Matthieu Chaffotte, Celine Souchet
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringTENANT
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidactivateTenant(long tenantId)Set status of the tenant into activatedlongcreateTenant(STenant tenant)insert a new row in the Tenant table case 1 - create tenants tables if not already exists + insert rows where necessary (sequences for example) + insert default users (defined in configuration) case 2 - create tenants tables + insert rows where necessary (sequences for example) + insert default users (defined in configuration)voiddeactivateTenant(long tenantId)Set status of the tenant into deactivatedvoiddeleteTenant(long tenantId)case 1 - Remove tenant specific tenant tables if no mor etenant in the db case 2 - Remove tenant specific tablesvoiddeleteTenantObjects(long tenantId)Remove all rows from all tables where the tenantId matchesSTenantgetDefaultTenant()Get default tenantintgetNumberOfTenants()Get the total number of sTenantslonggetNumberOfTenants(QueryOptions options)Return a number of tenants by the given conditions, as one part of SearchResult that is search method's return value in platformApiSPlatformgetPlatform()Retrieve the platform from the cache No need to be in a transactionSPlatformPropertiesgetSPlatformProperties()Return the platform propertiesSTenantgetTenant(long id)Get tenant by its idSTenantgetTenantByName(java.lang.String name)Get tenant by its namejava.util.List<STenant>getTenants(java.util.Collection<java.lang.Long> ids, QueryOptions queryOptions)Get tenants which ids belong to given collectionjava.util.List<STenant>getTenants(QueryOptions queryOptions)Get all tenantsbooleanisDefaultTenantCreated()Is the default tenant already created?booleanisPlatformCreated()Return true if the platform is created, else return false.voidpauseTenant(long tenantId)update status of tenant object to PAUSEDjava.util.List<STenant>searchTenants(QueryOptions options)Return a list of tenants by the given conditions, as one part of SearchResult that is search method's return value in platformApivoidupdateTenant(STenant tenant, EntityUpdateDescriptor descriptor)Update a sTenant from given sTenant and new content.
-
-
-
Field Detail
-
TENANT
static final java.lang.String TENANT
- See Also:
- Constant Field Values
-
-
Method Detail
-
getPlatform
SPlatform getPlatform() throws SPlatformNotFoundException
Retrieve the platform from the cache No need to be in a transaction- Returns:
- sPlatform
- Throws:
SPlatformNotFoundException- occurs when the identifier does not refer to an existing sPlatform- Since:
- 6.0
-
createTenant
long createTenant(STenant tenant) throws STenantCreationException, STenantAlreadyExistException
insert a new row in the Tenant table case 1 - create tenants tables if not already exists + insert rows where necessary (sequences for example) + insert default users (defined in configuration) case 2 - create tenants tables + insert rows where necessary (sequences for example) + insert default users (defined in configuration)- Parameters:
tenant- sTenant- Returns:
- id of new created tenant
- Throws:
STenantCreationException- occurs when an exception is thrown during sTenant creationSTenantAlreadyExistException- occurs when the sTenant has already been taken- Since:
- 6.0
-
deleteTenant
void deleteTenant(long tenantId) throws STenantDeletionException, STenantNotFoundException, SDeletingActivatedTenantExceptioncase 1 - Remove tenant specific tenant tables if no mor etenant in the db case 2 - Remove tenant specific tables- Parameters:
tenantId-- Throws:
STenantDeletionException- occurs when an exception is thrown during sTenant deletionSTenantNotFoundException- occurs when the identifier does not refer to an existing sTenantSDeletingActivatedTenantException- occurs when an exception is thrown during deleting an activated sTenant- Since:
- 6.0
-
deleteTenantObjects
void deleteTenantObjects(long tenantId) throws STenantDeletionException, STenantNotFoundException, SDeletingActivatedTenantExceptionRemove all rows from all tables where the tenantId matches- Parameters:
tenantId-- Throws:
STenantDeletionExceptionSTenantNotFoundExceptionSDeletingActivatedTenantException
-
updateTenant
void updateTenant(STenant tenant, EntityUpdateDescriptor descriptor) throws STenantUpdateException
Update a sTenant from given sTenant and new content.- Parameters:
tenant- sTenantdescriptor- new content- Throws:
STenantUpdateException- occurs when an exception is thrown during sTenant update- Since:
- 6.0
-
getTenant
STenant getTenant(long id) throws STenantNotFoundException
Get tenant by its id- Parameters:
id- tenant id- Returns:
- sTenant
- Throws:
STenantNotFoundException- occurs when the identifier does not refer to an existing sTenant- Since:
- 6.0
-
getTenantByName
STenant getTenantByName(java.lang.String name) throws STenantNotFoundException
Get tenant by its name- Parameters:
name- tenant's name- Returns:
- sTenant
- Throws:
STenantNotFoundException- occurs when the identifier does not refer to an existing sTenant- Since:
- 6.0
-
getDefaultTenant
STenant getDefaultTenant() throws STenantNotFoundException
Get default tenant- Returns:
- sTenant
- Throws:
STenantNotFoundException- occurs when the identifier does not refer to an existing sTenant- Since:
- 6.0
-
isDefaultTenantCreated
boolean isDefaultTenantCreated() throws SBonitaReadExceptionIs the default tenant already created?- Returns:
- true if the default tenant exists, false otherwise.
- Throws:
SBonitaReadException- when we cannot determine if default tenant is created- Since:
- 7.3
-
getTenants
java.util.List<STenant> getTenants(java.util.Collection<java.lang.Long> ids, QueryOptions queryOptions) throws STenantNotFoundException, STenantException
Get tenants which ids belong to given collection- Parameters:
ids- a collection of idsqueryOptions- The criterion used to search tenants- Returns:
- a list of sTenant
- Throws:
STenantNotFoundException- occurs when the identifier does not refer to an existing sTenantSTenantException- Since:
- 6.0
-
activateTenant
void activateTenant(long tenantId) throws STenantNotFoundException, STenantActivationExceptionSet status of the tenant into activated- Parameters:
tenantId-- Throws:
STenantNotFoundException- occurs when the identifier does not refer to an existing sTenantSTenantActivationException- occurs when an exception is thrown during activating sTenant- Since:
- 6.0
-
deactivateTenant
void deactivateTenant(long tenantId) throws STenantNotFoundException, STenantDeactivationExceptionSet status of the tenant into deactivated- Parameters:
tenantId-- Throws:
STenantNotFoundException- occurs when the identifier does not refer to an existing sTenantSTenantDeactivationException- occurs when an exception is thrown during deactivating sTenant- Since:
- 6.0
-
pauseTenant
void pauseTenant(long tenantId) throws STenantUpdateException, STenantNotFoundExceptionupdate status of tenant object to PAUSED- Parameters:
tenantId- the id of the tenant to update- Throws:
STenantUpdateExceptionSTenantNotFoundException
-
getNumberOfTenants
int getNumberOfTenants() throws STenantExceptionGet the total number of sTenants- Returns:
- the total number of sTenants
- Throws:
STenantException- Since:
- 6.0
-
isPlatformCreated
boolean isPlatformCreated()
Return true if the platform is created, else return false.- Returns:
- true or false
- Since:
- 6.0
-
searchTenants
java.util.List<STenant> searchTenants(QueryOptions options) throws SBonitaReadException
Return a list of tenants by the given conditions, as one part of SearchResult that is search method's return value in platformApi- Parameters:
options-- Returns:
- a list of tenants by the given conditions
- Throws:
SBonitaReadException
-
getTenants
java.util.List<STenant> getTenants(QueryOptions queryOptions) throws STenantException
Get all tenants- Parameters:
queryOptions- The criterion used to search tenants- Returns:
- a list of sTenant
- Throws:
STenantException- Since:
- 6.0
-
getNumberOfTenants
long getNumberOfTenants(QueryOptions options) throws SBonitaReadException
Return a number of tenants by the given conditions, as one part of SearchResult that is search method's return value in platformApi- Parameters:
options-- Returns:
- a number of tenants by the given conditions
- Throws:
SBonitaReadException
-
getSPlatformProperties
SPlatformProperties getSPlatformProperties()
Return the platform properties- Returns:
- The platform properties
- Since:
- 6.1
-
-