Class DefaultUserFieldMappingService<P extends UserFieldMapping,D extends com.broadleafcommerce.data.tracking.core.mapping.BusinessTypeAware & com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable>
java.lang.Object
com.broadleafcommerce.auth.user.service.DefaultUserFieldMappingService<P,D>
- All Implemented Interfaces:
UserFieldMappingService<P>
public class DefaultUserFieldMappingService<P extends UserFieldMapping,D extends com.broadleafcommerce.data.tracking.core.mapping.BusinessTypeAware & com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable>
extends Object
implements UserFieldMappingService<P>
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefaultUserFieldMappingService
(FieldMappingRepository<D> repository, SimplePayloadMapper mapper) -
Method Summary
Modifier and TypeMethodDescriptionvoid
clearCache
(String tenantId) Clear cached field mappings for the tenant ID.Create a new user field mappingvoid
Delete the user field mappingprotected com.broadleafcommerce.common.extension.cache.key.ContextKeyGen
protected SimplePayloadMapper
readAllByTenantId
(String tenantId) Find all user field mappings for a tenantreadByTargetKey
(String targetKey) Find a user field mapping by target keyreadByTenantIdAndAttributeName
(String tenantId, String attributeName) Find a user field mapping by tenant ID and attribute nameReplace a user field mappingvoid
setCacheByTenantIdKeyGen
(com.broadleafcommerce.common.extension.cache.key.ContextKeyGen cacheByTenantIdKeyGen)
-
Field Details
-
CACHE_BY_TENANT_ID
- See Also:
-
-
Constructor Details
-
DefaultUserFieldMappingService
public DefaultUserFieldMappingService(FieldMappingRepository<D> repository, SimplePayloadMapper mapper)
-
-
Method Details
-
readAllByTenantId
@Cacheable(cacheNames="authCacheByTenantID", key="#a0", condition="@cacheStateManager.isEnabled(#root.caches, #root.args)") public List<P> readAllByTenantId(String tenantId) Description copied from interface:UserFieldMappingService
Find all user field mappings for a tenant- Specified by:
readAllByTenantId
in interfaceUserFieldMappingService<P extends UserFieldMapping>
- Parameters:
tenantId
- the tenant ID- Returns:
- a page of user field mappings for the tenant
-
readByTenantIdAndAttributeName
Description copied from interface:UserFieldMappingService
Find a user field mapping by tenant ID and attribute name- Specified by:
readByTenantIdAndAttributeName
in interfaceUserFieldMappingService<P extends UserFieldMapping>
- Parameters:
tenantId
- the tenant IDattributeName
- the attribute name- Returns:
- an optional of user field mapping
-
readByTargetKey
Description copied from interface:UserFieldMappingService
Find a user field mapping by target key- Specified by:
readByTargetKey
in interfaceUserFieldMappingService<P extends UserFieldMapping>
- Parameters:
targetKey
- the target key- Returns:
- an optional of user field mapping
-
replace
Description copied from interface:UserFieldMappingService
Replace a user field mapping- Specified by:
replace
in interfaceUserFieldMappingService<P extends UserFieldMapping>
userFieldMapping
- The replacement- Returns:
- The replaced user field mapping
-
create
Description copied from interface:UserFieldMappingService
Create a new user field mapping- Specified by:
create
in interfaceUserFieldMappingService<P extends UserFieldMapping>
- Parameters:
userFieldMapping
- the user field mapping to create- Returns:
- the created user field mapping
-
delete
Description copied from interface:UserFieldMappingService
Delete the user field mapping- Specified by:
delete
in interfaceUserFieldMappingService<P extends UserFieldMapping>
- Parameters:
id
- the id of the entity to delete
-
clearCache
@CacheEvict(value="authCacheByTenantID", key="#a0", condition="@cacheStateManager.isEnabled(#root.caches, #root.args)") public void clearCache(String tenantId) Description copied from interface:UserFieldMappingService
Clear cached field mappings for the tenant ID.- Specified by:
clearCache
in interfaceUserFieldMappingService<P extends UserFieldMapping>
- Parameters:
tenantId
- The tenant ID to clear
-
getMapper
-
setCacheByTenantIdKeyGen
@Autowired @Qualifier("authCacheByTenantID") public void setCacheByTenantIdKeyGen(@Nullable com.broadleafcommerce.common.extension.cache.key.ContextKeyGen cacheByTenantIdKeyGen) - See Also:
-
getCacheByTenantIdKeyGen
@Nullable protected com.broadleafcommerce.common.extension.cache.key.ContextKeyGen getCacheByTenantIdKeyGen()- See Also:
-