Class TenantServiceImpl
java.lang.Object
org.craftercms.profile.services.impl.TenantServiceImpl
- All Implemented Interfaces:
TenantService
Default implementation of
TenantService
.- Author:
- avasquez
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprotected org.craftercms.commons.security.permissions.PermissionEvaluator<AccessToken,
AttributeDefinition> protected org.craftercms.commons.entitlements.validator.EntitlementValidator
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
protected ProfileRepository
protected ProfileService
protected org.craftercms.commons.security.permissions.PermissionEvaluator<AccessToken,
String> protected TenantRepository
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddAttributeDefinitions
(String tenantName, Collection<AttributeDefinition> attributeDefinitions) protected void
addDefaultValue
(String tenantName, String attributeName, Object defaultValue) addRoles
(String tenantName, Collection<String> roles) protected void
checkIfTenantActionIsAllowed
(String tenantName, TenantAction action) createTenant
(Tenant tenant) void
deleteTenant
(String name) long
removeAttributeDefinitions
(String tenantName, Collection<String> attributeNames) protected void
removeAttributeFromProfiles
(String tenantName, String attributeName) protected void
removeRoleFromProfiles
(String tenantName, String role) removeRoles
(String tenantName, Collection<String> roles) void
setAttributePermissionEvaluator
(org.craftercms.commons.security.permissions.PermissionEvaluator<AccessToken, AttributeDefinition> attributePermissionEvaluator) void
setEntitlementValidator
(org.craftercms.commons.entitlements.validator.EntitlementValidator entitlementValidator) void
setProfileRepository
(ProfileRepository profileRepository) void
setProfileService
(ProfileService profileService) void
setTenantPermissionEvaluator
(org.craftercms.commons.security.permissions.PermissionEvaluator<AccessToken, String> tenantPermissionEvaluator) void
setTenantRepository
(TenantRepository tenantRepository) updateAttributeDefinitions
(String tenantName, Collection<AttributeDefinition> attributeDefinitions) protected Tenant
updateTenant
(String tenantName, TenantServiceImpl.UpdateCallback callback) updateTenant
(Tenant tenant) verifyNewProfiles
(String tenantName, boolean verify)
-
Field Details
-
LOG_KEY_TENANT_CREATED
- See Also:
-
LOG_KEY_TENANT_DELETED
- See Also:
-
LOG_KEY_VERIFY_NEW_PROFILES_FLAG_SET
- See Also:
-
LOG_KEY_ROLES_ADDED
- See Also:
-
LOG_KEY_ROLES_REMOVED
- See Also:
-
LOG_KEY_ATTRIBUTE_DEFINITIONS_ADDED
- See Also:
-
LOG_KEY_ATTRIBUTE_DEFINITIONS_UPDATED
- See Also:
-
LOG_KEY_ATTRIBUTE_DEFINITIONS_REMOVED
- See Also:
-
ERROR_KEY_CREATE_TENANT_ERROR
- See Also:
-
ERROR_KEY_GET_TENANT_ERROR
- See Also:
-
ERROR_KEY_UPDATE_TENANT_ERROR
- See Also:
-
ERROR_KEY_DELETE_TENANT_ERROR
- See Also:
-
ERROR_KEY_GET_TENANT_COUNT_ERROR
- See Also:
-
ERROR_KEY_GET_ALL_TENANTS_ERROR
- See Also:
-
ERROR_KEY_DELETE_ALL_PROFILES_ERROR
- See Also:
-
ERROR_KEY_REMOVE_ROLE_FROM_ALL_PROFILES_ERROR
- See Also:
-
ERROR_KEY_REMOVE_ATTRIBUTE_FROM_ALL_PROFILES_ERROR
- See Also:
-
ERROR_KEY_ADD_DEFAULT_VALUE_ERROR
- See Also:
-
ERROR_KEY_ENTITLEMENT_ERROR
- See Also:
-
tenantPermissionEvaluator
protected org.craftercms.commons.security.permissions.PermissionEvaluator<AccessToken,String> tenantPermissionEvaluator -
attributePermissionEvaluator
protected org.craftercms.commons.security.permissions.PermissionEvaluator<AccessToken,AttributeDefinition> attributePermissionEvaluator -
tenantRepository
-
profileRepository
-
profileService
-
entitlementValidator
protected org.craftercms.commons.entitlements.validator.EntitlementValidator entitlementValidator
-
-
Constructor Details
-
TenantServiceImpl
public TenantServiceImpl()
-
-
Method Details
-
setTenantPermissionEvaluator
public void setTenantPermissionEvaluator(org.craftercms.commons.security.permissions.PermissionEvaluator<AccessToken, String> tenantPermissionEvaluator) -
setAttributePermissionEvaluator
public void setAttributePermissionEvaluator(org.craftercms.commons.security.permissions.PermissionEvaluator<AccessToken, AttributeDefinition> attributePermissionEvaluator) -
setTenantRepository
-
setProfileRepository
-
setProfileService
-
setEntitlementValidator
public void setEntitlementValidator(org.craftercms.commons.entitlements.validator.EntitlementValidator entitlementValidator) -
createTenant
- Specified by:
createTenant
in interfaceTenantService
- Throws:
ProfileException
-
getTenant
- Specified by:
getTenant
in interfaceTenantService
- Throws:
ProfileException
-
updateTenant
- Specified by:
updateTenant
in interfaceTenantService
- Throws:
ProfileException
-
deleteTenant
- Specified by:
deleteTenant
in interfaceTenantService
- Throws:
ProfileException
-
getTenantCount
- Specified by:
getTenantCount
in interfaceTenantService
- Throws:
ProfileException
-
getAllTenants
- Specified by:
getAllTenants
in interfaceTenantService
- Throws:
ProfileException
-
verifyNewProfiles
- Specified by:
verifyNewProfiles
in interfaceTenantService
- Throws:
ProfileException
-
addRoles
- Specified by:
addRoles
in interfaceTenantService
- Throws:
ProfileException
-
removeRoles
- Specified by:
removeRoles
in interfaceTenantService
- Throws:
ProfileException
-
addAttributeDefinitions
public Tenant addAttributeDefinitions(String tenantName, Collection<AttributeDefinition> attributeDefinitions) throws ProfileException - Specified by:
addAttributeDefinitions
in interfaceTenantService
- Throws:
ProfileException
-
updateAttributeDefinitions
public Tenant updateAttributeDefinitions(String tenantName, Collection<AttributeDefinition> attributeDefinitions) throws ProfileException - Specified by:
updateAttributeDefinitions
in interfaceTenantService
- Throws:
ProfileException
-
removeAttributeDefinitions
public Tenant removeAttributeDefinitions(String tenantName, Collection<String> attributeNames) throws ProfileException - Specified by:
removeAttributeDefinitions
in interfaceTenantService
- Throws:
ProfileException
-
checkIfTenantActionIsAllowed
-
updateTenant
protected Tenant updateTenant(String tenantName, TenantServiceImpl.UpdateCallback callback) throws ProfileException - Throws:
ProfileException
-
removeRoleFromProfiles
- Throws:
ProfileException
-
removeAttributeFromProfiles
protected void removeAttributeFromProfiles(String tenantName, String attributeName) throws ProfileException - Throws:
ProfileException
-
addDefaultValue
protected void addDefaultValue(String tenantName, String attributeName, Object defaultValue) throws ProfileException - Throws:
ProfileException
-