Class TenantServiceRestClient
java.lang.Object
org.craftercms.commons.rest.AbstractRestClientBase
org.craftercms.profile.services.impl.AbstractProfileRestClientBase
org.craftercms.profile.services.impl.TenantServiceRestClient
- All Implemented Interfaces:
TenantService
REST client implementation of
TenantService
.- Author:
- avasquez
-
Field Summary
FieldsModifier and TypeFieldDescriptionFields inherited from class org.craftercms.profile.services.impl.AbstractProfileRestClientBase
accessTokenIdResolver
Fields inherited from class org.craftercms.commons.rest.AbstractRestClientBase
baseUrl, extension, restTemplate
-
Constructor Summary
ConstructorsConstructorDescriptionTenantServiceRestClient
(String baseUrl, org.springframework.web.client.RestTemplate restTemplate, AccessTokenIdResolver accessTokenIdResolver) -
Method Summary
Modifier and TypeMethodDescriptionaddAttributeDefinitions
(String tenantName, Collection<AttributeDefinition> attributeDefinitions) Adds the given attribute definitions to the specified tenant.addRoles
(String tenantName, Collection<String> roles) Adds the given roles to the specified tenant.createTenant
(Tenant tenant) Creates the given tenant, failing if it already has been created.void
deleteTenant
(String name) Deletes a tenant.Returns a list with all the tenants.Returns a tenant.long
Returns the total number of tenants.removeAttributeDefinitions
(String tenantName, Collection<String> attributeNames) Removes the given attribute definitions from the specified tenant.removeRoles
(String tenantName, Collection<String> roles) Removes the given roles from the specified tenant.updateAttributeDefinitions
(String tenantName, Collection<AttributeDefinition> attributeDefinitions) Updates the given attribute definitions of the specified tenant.updateTenant
(Tenant tenant) Updates the given tenant.verifyNewProfiles
(String tenantName, boolean verify) Sets if new profiles for the specified tenant should be verified or not.Methods inherited from class org.craftercms.profile.services.impl.AbstractProfileRestClientBase
createBaseParams, doGetForObject, doGetForObject, doGetForObject, doGetForObject, doPostForLocation, doPostForObject, doPostForUpload, getAbsoluteUrlWithAccessTokenIdParam, handleException, handleRestServiceException
Methods inherited from class org.craftercms.commons.rest.AbstractRestClientBase
getAbsoluteUrl, setExtension
-
Field Details
-
tenantListTypeRef
-
-
Constructor Details
-
TenantServiceRestClient
public TenantServiceRestClient(String baseUrl, org.springframework.web.client.RestTemplate restTemplate, AccessTokenIdResolver accessTokenIdResolver)
-
-
Method Details
-
createTenant
Description copied from interface:TenantService
Creates the given tenant, failing if it already has been created.- Specified by:
createTenant
in interfaceTenantService
- Parameters:
tenant
- the tenant to create- Returns:
- the created tenant
- Throws:
ProfileException
-
getTenant
Description copied from interface:TenantService
Returns a tenant.- Specified by:
getTenant
in interfaceTenantService
- Parameters:
name
- the tenant's name- Returns:
- the tenant
- Throws:
ProfileException
-
updateTenant
Description copied from interface:TenantService
Updates the given tenant.- Specified by:
updateTenant
in interfaceTenantService
- Parameters:
tenant
- the tenant to update- Returns:
- the updated tenant
- Throws:
ProfileException
-
deleteTenant
Description copied from interface:TenantService
Deletes a tenant.- Specified by:
deleteTenant
in interfaceTenantService
- Parameters:
name
- the tenant's name- Throws:
ProfileException
-
getTenantCount
Description copied from interface:TenantService
Returns the total number of tenants.- Specified by:
getTenantCount
in interfaceTenantService
- Returns:
- the number of tenants
- Throws:
ProfileException
-
getAllTenants
Description copied from interface:TenantService
Returns a list with all the tenants.- Specified by:
getAllTenants
in interfaceTenantService
- Returns:
- a list with al the tenants.
- Throws:
ProfileException
-
verifyNewProfiles
Description copied from interface:TenantService
Sets if new profiles for the specified tenant should be verified or not.- Specified by:
verifyNewProfiles
in interfaceTenantService
- Parameters:
tenantName
- the tenant's nameverify
- true to verify new profiles through email, false otherwise- Returns:
- the tenant
- Throws:
ProfileException
-
addRoles
Description copied from interface:TenantService
Adds the given roles to the specified tenant.- Specified by:
addRoles
in interfaceTenantService
- Parameters:
tenantName
- the tenant's nameroles
- the roles to add- Returns:
- the tenant
- Throws:
ProfileException
-
removeRoles
Description copied from interface:TenantService
Removes the given roles from the specified tenant.- Specified by:
removeRoles
in interfaceTenantService
- Parameters:
tenantName
- the tenant's nameroles
- the roles to remove- Returns:
- the tenant
- Throws:
ProfileException
-
addAttributeDefinitions
public Tenant addAttributeDefinitions(String tenantName, Collection<AttributeDefinition> attributeDefinitions) throws ProfileException Description copied from interface:TenantService
Adds the given attribute definitions to the specified tenant.- Specified by:
addAttributeDefinitions
in interfaceTenantService
- Parameters:
tenantName
- the tenant's nameattributeDefinitions
- the definitions to add- Returns:
- the tenant
- Throws:
ProfileException
-
updateAttributeDefinitions
public Tenant updateAttributeDefinitions(String tenantName, Collection<AttributeDefinition> attributeDefinitions) throws ProfileException Description copied from interface:TenantService
Updates the given attribute definitions of the specified tenant.- Specified by:
updateAttributeDefinitions
in interfaceTenantService
- 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
public Tenant removeAttributeDefinitions(String tenantName, Collection<String> attributeNames) throws ProfileException Description copied from interface:TenantService
Removes the given attribute definitions from the specified tenant.- Specified by:
removeAttributeDefinitions
in interfaceTenantService
- Parameters:
tenantName
- the tenant's nameattributeNames
- the name of the attributes whose definitions should be removed- Returns:
- the tenant
- Throws:
ProfileException
-