public class TenantService extends Object implements ITenantService
| Constructor and Description |
|---|
TenantService(DataSourceService dataSourceService) |
| Modifier and Type | Method and Description |
|---|---|
List<Protos.Tenant> |
getAllTenants() |
IProtobufDao |
getDaoForTenant(String tenant)
Get the DAO instance for tenant, or return null if tenant is not registered.
|
IObjectsService |
getObjectsServicesForTenant(String tenant) |
Protos.Tenant |
getTenant(String tenant)
Get the protobuf type meta object associated to the given tenant
|
boolean |
isRegistered(String tenant) |
void |
registerTenant(Protos.Tenant tenant)
Given an instance of Tenant, register services for the tenant.
|
void |
validateTenant(String tenant)
Validate the given tenant name; check that the name is not empty or whitespaces,
and that the tenant name is already registered.
|
@Inject public TenantService(DataSourceService dataSourceService)
public void validateTenant(String tenant) throws IllegalArgumentException
validateTenant in interface ITenantServicetenant - the tenant nameIllegalArgumentException - if the tenant name is not valid or not registeredpublic void registerTenant(Protos.Tenant tenant) throws IOException, ReflectiveOperationException, com.google.protobuf.Descriptors.DescriptorValidationException
registerTenant in interface ITenantServicetenant - the tenant to registerIOExceptionReflectiveOperationExceptioncom.google.protobuf.Descriptors.DescriptorValidationExceptionpublic Protos.Tenant getTenant(String tenant)
getTenant in interface ITenantServicetenant - public IProtobufDao getDaoForTenant(String tenant)
getDaoForTenant in interface ITenantServicetenant - the tenant namepublic IObjectsService getObjectsServicesForTenant(String tenant)
getObjectsServicesForTenant in interface ITenantServicepublic List<Protos.Tenant> getAllTenants()
getAllTenants in interface ITenantServicepublic boolean isRegistered(String tenant)
isRegistered in interface ITenantServiceCopyright © 2015. All rights reserved.