public class VolatileSingleTenantRegistry extends Object implements TenantRegistry, com.atlassian.tenancy.api.TenantAccessor, com.atlassian.tenancy.api.TenantContext
The registered tenant is not persisted, meaning it has to be replayed during bootstrap.
This class should be considered a temporary solution on the way to multi-tenancy.
Constructor and Description |
---|
VolatileSingleTenantRegistry() |
Modifier and Type | Method and Description |
---|---|
boolean |
addTenant(com.atlassian.tenancy.api.Tenant tenant) |
<T> T |
asTenant(com.atlassian.tenancy.api.Tenant tenant,
Callable<T> callback) |
Iterable<com.atlassian.tenancy.api.Tenant> |
getAvailableTenants() |
com.atlassian.tenancy.api.Tenant |
getCurrentTenant() |
boolean |
isRegistryVacant() |
boolean |
isTenantRegistered(com.atlassian.tenancy.api.Tenant tenant) |
boolean |
removeTenant(com.atlassian.tenancy.api.Tenant tenant) |
public Iterable<com.atlassian.tenancy.api.Tenant> getAvailableTenants()
getAvailableTenants
in interface com.atlassian.tenancy.api.TenantAccessor
public <T> T asTenant(com.atlassian.tenancy.api.Tenant tenant, Callable<T> callback) throws com.atlassian.tenancy.api.TenantUnavailableException, InvocationTargetException
asTenant
in interface com.atlassian.tenancy.api.TenantAccessor
com.atlassian.tenancy.api.TenantUnavailableException
InvocationTargetException
public boolean addTenant(com.atlassian.tenancy.api.Tenant tenant)
addTenant
in interface TenantRegistry
tenant
- the tenant to addpublic boolean removeTenant(com.atlassian.tenancy.api.Tenant tenant)
removeTenant
in interface TenantRegistry
tenant
- the tenant to removepublic boolean isTenantRegistered(com.atlassian.tenancy.api.Tenant tenant)
isTenantRegistered
in interface TenantRegistry
tenant
- the tenant to test for being registeredpublic boolean isRegistryVacant()
isRegistryVacant
in interface TenantRegistry
@Nullable public com.atlassian.tenancy.api.Tenant getCurrentTenant()
getCurrentTenant
in interface com.atlassian.tenancy.api.TenantContext
Copyright © 2003–2016 Atlassian. All rights reserved.