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 TypeMethodDescriptionvoidclearCache(String tenantId) Clear cached field mappings for the tenant ID.Create a new user field mappingvoidDelete the user field mappingprotected com.broadleafcommerce.common.extension.cache.key.ContextKeyGenprotected SimplePayloadMapperreadAllByTenantId(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 mappingvoidsetCacheByTenantIdKeyGen(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:UserFieldMappingServiceFind all user field mappings for a tenant- Specified by:
readAllByTenantIdin interfaceUserFieldMappingService<P extends UserFieldMapping>- Parameters:
tenantId- the tenant ID- Returns:
- a page of user field mappings for the tenant
-
readByTenantIdAndAttributeName
Description copied from interface:UserFieldMappingServiceFind a user field mapping by tenant ID and attribute name- Specified by:
readByTenantIdAndAttributeNamein interfaceUserFieldMappingService<P extends UserFieldMapping>- Parameters:
tenantId- the tenant IDattributeName- the attribute name- Returns:
- an optional of user field mapping
-
readByTargetKey
Description copied from interface:UserFieldMappingServiceFind a user field mapping by target key- Specified by:
readByTargetKeyin interfaceUserFieldMappingService<P extends UserFieldMapping>- Parameters:
targetKey- the target key- Returns:
- an optional of user field mapping
-
replace
Description copied from interface:UserFieldMappingServiceReplace a user field mapping- Specified by:
replacein interfaceUserFieldMappingService<P extends UserFieldMapping>userFieldMapping- The replacement- Returns:
- The replaced user field mapping
-
create
Description copied from interface:UserFieldMappingServiceCreate a new user field mapping- Specified by:
createin interfaceUserFieldMappingService<P extends UserFieldMapping>- Parameters:
userFieldMapping- the user field mapping to create- Returns:
- the created user field mapping
-
delete
Description copied from interface:UserFieldMappingServiceDelete the user field mapping- Specified by:
deletein 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:UserFieldMappingServiceClear cached field mappings for the tenant ID.- Specified by:
clearCachein 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:
-