Interface TenantService
-
public interface TenantService
Service for managing tenants.- Author:
- avasquez
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Tenant
addAttributeDefinitions(String tenantName, Collection<AttributeDefinition> attributeDefinitions)
Adds the given attribute definitions to the specified tenant.Tenant
addRoles(String tenantName, Collection<String> roles)
Adds the given roles to the specified tenant.Tenant
createTenant(Tenant tenant)
Creates the given tenant, failing if it already has been created.void
deleteTenant(String name)
Deletes a tenant.List<Tenant>
getAllTenants()
Returns a list with all the tenants.Tenant
getTenant(String name)
Returns a tenant.long
getTenantCount()
Returns the total number of tenants.Tenant
removeAttributeDefinitions(String tenantName, Collection<String> attributeNames)
Removes the given attribute definitions from the specified tenant.Tenant
removeRoles(String tenantName, Collection<String> roles)
Removes the given roles from the specified tenant.Tenant
updateAttributeDefinitions(String tenantName, Collection<AttributeDefinition> attributeDefinitions)
Updates the given attribute definitions of the specified tenant.Tenant
updateTenant(Tenant tenant)
Updates the given tenant.Tenant
verifyNewProfiles(String tenantName, boolean verify)
Sets if new profiles for the specified tenant should be verified or not.
-
-
-
Method Detail
-
createTenant
Tenant createTenant(Tenant tenant) throws ProfileException
Creates the given tenant, failing if it already has been created.- Parameters:
tenant
- the tenant to create- Returns:
- the created tenant
- Throws:
ProfileException
-
getTenant
Tenant getTenant(String name) throws ProfileException
Returns a tenant.- Parameters:
name
- the tenant's name- Returns:
- the tenant
- Throws:
ProfileException
-
updateTenant
Tenant updateTenant(Tenant tenant) throws ProfileException
Updates the given tenant.- Parameters:
tenant
- the tenant to update- Returns:
- the updated tenant
- Throws:
ProfileException
-
deleteTenant
void deleteTenant(String name) throws ProfileException
Deletes a tenant.- Parameters:
name
- the tenant's name- Throws:
ProfileException
-
getTenantCount
long getTenantCount() throws ProfileException
Returns the total number of tenants.- Returns:
- the number of tenants
- Throws:
ProfileException
-
getAllTenants
List<Tenant> getAllTenants() throws ProfileException
Returns a list with all the tenants.- Returns:
- a list with al the tenants.
- Throws:
ProfileException
-
verifyNewProfiles
Tenant verifyNewProfiles(String tenantName, boolean verify) throws ProfileException
Sets if new profiles for the specified tenant should be verified or not.- Parameters:
tenantName
- the tenant's nameverify
- true to verify new profiles through email, false otherwise- Returns:
- the tenant
- Throws:
ProfileException
-
addRoles
Tenant addRoles(String tenantName, Collection<String> roles) throws ProfileException
Adds the given roles to the specified tenant.- Parameters:
tenantName
- the tenant's nameroles
- the roles to add- Returns:
- the tenant
- Throws:
ProfileException
-
removeRoles
Tenant removeRoles(String tenantName, Collection<String> roles) throws ProfileException
Removes the given roles from the specified tenant.- Parameters:
tenantName
- the tenant's nameroles
- the roles to remove- Returns:
- the tenant
- Throws:
ProfileException
-
addAttributeDefinitions
Tenant addAttributeDefinitions(String tenantName, Collection<AttributeDefinition> attributeDefinitions) throws ProfileException
Adds the given attribute definitions to the specified tenant.- Parameters:
tenantName
- the tenant's nameattributeDefinitions
- the definitions to add- Returns:
- the tenant
- Throws:
ProfileException
-
updateAttributeDefinitions
Tenant updateAttributeDefinitions(String tenantName, Collection<AttributeDefinition> attributeDefinitions) throws ProfileException
Updates the given attribute definitions of the specified tenant.- Parameters:
tenantName
- the tenant's nameattributeDefinitions
- the definitions to update (should have the same name as definitions that the tenant already has)- Returns:
- the tenant
- Throws:
ProfileException
-
removeAttributeDefinitions
Tenant removeAttributeDefinitions(String tenantName, Collection<String> attributeNames) throws ProfileException
Removes the given attribute definitions from the specified tenant.- Parameters:
tenantName
- the tenant's nameattributeNames
- the name of the attributes whose definitions should be removed- Returns:
- the tenant
- Throws:
ProfileException
-
-