public interface PlatformService
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
TENANT |
| Modifier and Type | Method and Description |
|---|---|
boolean |
activateTenant(long tenantId)
Set status of the tenant into activated
|
long |
createTenant(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)
|
void |
deactiveTenant(long tenantId)
Set status of the tenant into deactivated
|
void |
deleteTenant(long tenantId)
case 1 - Remove tenant specific tenant tables if no mor etenant in the db
case 2 - Remove tenant specific tables
|
void |
deleteTenantObjects(long tenantId)
Remove all rows from all tables where the tenantId matches
|
STenant |
getDefaultTenant()
Get default tenant
|
int |
getNumberOfTenants()
Get the total number of sTenants
|
long |
getNumberOfTenants(QueryOptions options)
Return a number of tenants by the given conditions, as one part of SearchResult that is search method's return value in platformApi
|
SPlatform |
getPlatform()
Retrieve the platform from the cache
No need to be in a transaction
|
SPlatformProperties |
getSPlatformProperties()
Return the platform properties
|
STenant |
getTenant(long id)
Get tenant by its id
|
STenant |
getTenantByName(java.lang.String name)
Get tenant by its name
|
java.util.List<STenant> |
getTenants(java.util.Collection<java.lang.Long> ids,
QueryOptions queryOptions)
Get tenants which ids belong to given collection
|
java.util.List<STenant> |
getTenants(QueryOptions queryOptions)
Get all tenants
|
boolean |
isDefaultTenantCreated()
Is the default tenant already created?
|
boolean |
isPlatformCreated()
Return true if the platform is created, else return false.
|
java.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 platformApi
|
void |
updateTenant(STenant tenant,
EntityUpdateDescriptor descriptor)
Update a sTenant from given sTenant and new content.
|
static final java.lang.String TENANT
SPlatform getPlatform() throws SPlatformNotFoundException
SPlatformNotFoundException - occurs when the identifier does not refer to an existing sPlatformlong createTenant(STenant tenant) throws STenantCreationException, STenantAlreadyExistException
tenant - sTenantSTenantCreationException - occurs when an exception is thrown during sTenant creationSTenantAlreadyExistException - occurs when the sTenant has already been takenvoid deleteTenant(long tenantId)
throws STenantDeletionException,
STenantNotFoundException,
SDeletingActivatedTenantException
tenantId - 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 sTenantvoid deleteTenantObjects(long tenantId)
throws STenantDeletionException,
STenantNotFoundException,
SDeletingActivatedTenantException
tenantId - STenantDeletionExceptionSTenantNotFoundExceptionSDeletingActivatedTenantExceptionvoid updateTenant(STenant tenant, EntityUpdateDescriptor descriptor) throws STenantUpdateException
tenant - sTenantdescriptor - new contentSTenantUpdateException - occurs when an exception is thrown during sTenant updateSTenant getTenant(long id) throws STenantNotFoundException
id - tenant idSTenantNotFoundException - occurs when the identifier does not refer to an existing sTenantSTenant getTenantByName(java.lang.String name) throws STenantNotFoundException
name - tenant's nameSTenantNotFoundException - occurs when the identifier does not refer to an existing sTenantSTenant getDefaultTenant() throws STenantNotFoundException
STenantNotFoundException - occurs when the identifier does not refer to an existing sTenantboolean isDefaultTenantCreated()
throws SBonitaReadException
SBonitaReadException - when we cannot determine if default tenant is createdjava.util.List<STenant> getTenants(java.util.Collection<java.lang.Long> ids, QueryOptions queryOptions) throws STenantNotFoundException, STenantException
ids - a collection of idsqueryOptions - The criterion used to search tenantsSTenantNotFoundException - occurs when the identifier does not refer to an existing sTenantSTenantExceptionboolean activateTenant(long tenantId)
throws STenantNotFoundException,
STenantActivationException
tenantId - STenantNotFoundException - occurs when the identifier does not refer to an existing sTenantSTenantActivationException - occurs when an exception is thrown during activating sTenantvoid deactiveTenant(long tenantId)
throws STenantNotFoundException,
STenantDeactivationException
tenantId - STenantNotFoundException - occurs when the identifier does not refer to an existing sTenantSTenantDeactivationException - occurs when an exception is thrown during deactivating sTenantint getNumberOfTenants()
throws STenantException
STenantExceptionboolean isPlatformCreated()
java.util.List<STenant> searchTenants(QueryOptions options) throws SBonitaReadException
options - SBonitaReadExceptionjava.util.List<STenant> getTenants(QueryOptions queryOptions) throws STenantException
queryOptions - The criterion used to search tenantsSTenantExceptionlong getNumberOfTenants(QueryOptions options) throws SBonitaReadException
options - SBonitaReadExceptionSPlatformProperties getSPlatformProperties()