Class DefaultCustomerGroupFacade
- java.lang.Object
-
- de.hybris.platform.commercefacades.customergroups.impl.DefaultCustomerGroupFacade
-
- All Implemented Interfaces:
CustomerGroupFacade
public class DefaultCustomerGroupFacade extends java.lang.Object implements CustomerGroupFacade
Default implementation ofCustomerGroupFacade
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classDefaultCustomerGroupFacade.UserGroupDataComparator
-
Constructor Summary
Constructors Constructor Description DefaultCustomerGroupFacade()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddUserToCustomerGroup(java.lang.String customerGroupId, java.lang.String userId)Assign user to customer groupvoidcreateCustomerGroup(java.lang.String uid, java.lang.String localizedName)Create customer group (direct sub group of 'customergroup') with given uid and localized name in current localeUserGroupDataListgetAllCustomerGroups(PageOption pageOption)Returns user group with uid 'customergroup' and all it's direct subgroupsprotected UserGroupModelgetBaseCustomerGroup()java.lang.StringgetBaseCustomerGroupId()UserGroupDatagetCustomerGroup(java.lang.String customerGroupId, java.util.Set<UserGroupOption> options)Returns customer group (a sub-group of 'cutomergroup') by uid.protected UserGroupModelgetCustomerGroupById(java.lang.String customerGroupId)protected ConfigurablePopulator<UserGroupModel,UserGroupData,UserGroupOption>getCustomerGroupMembersPopulator()java.util.List<UserGroupData>getCustomerGroupsForCurrentUser()Returns all customers groups for the current user.java.util.List<UserGroupData>getCustomerGroupsForUser(java.lang.String userId)Gets a user's customer groups The givenuserIdis one of the unique identifiers that is used to recognize the user in matching strategies.protected I18NServicegetI18NService()protected ModelServicegetModelService()protected UserModelgetUserById(java.lang.String userId)protected Converter<UserGroupModel,UserGroupData>getUserGroupConverter()protected UserMatchingServicegetUserMatchingService()protected UserServicegetUserService()protected booleanisCustomerGroup(UserGroupModel group)voidremoveUserFromCustomerGroup(java.lang.String customerGroupId, java.lang.String userId)Remove user from customer groupvoidsetBaseCustomerGroupId(java.lang.String value)voidsetCustomerGroupMembersPopulator(ConfigurablePopulator<UserGroupModel,UserGroupData,UserGroupOption> customerGroupMembersPopulator)voidsetI18NService(I18NService i18NService)voidsetModelService(ModelService modelService)voidsetUserGroupConverter(Converter<UserGroupModel,UserGroupData> userGroupConverter)voidsetUserMatchingService(UserMatchingService userMatchingService)voidsetUserService(UserService userService)protected UserGroupDataListsortAndGetSubListDependsOnPageOption(java.util.List<UserGroupData> input, PageOption pageOption)
-
-
-
Method Detail
-
createCustomerGroup
public void createCustomerGroup(java.lang.String uid, java.lang.String localizedName)Description copied from interface:CustomerGroupFacadeCreate customer group (direct sub group of 'customergroup') with given uid and localized name in current locale- Specified by:
createCustomerGroupin interfaceCustomerGroupFacade- Parameters:
uid- the customer group uidlocalizedName- the customer group localized name
-
addUserToCustomerGroup
public void addUserToCustomerGroup(java.lang.String customerGroupId, java.lang.String userId)Description copied from interface:CustomerGroupFacadeAssign user to customer group- Specified by:
addUserToCustomerGroupin interfaceCustomerGroupFacade- Parameters:
customerGroupId- customer group uiduserId- user uid
-
removeUserFromCustomerGroup
public void removeUserFromCustomerGroup(java.lang.String customerGroupId, java.lang.String userId)Description copied from interface:CustomerGroupFacadeRemove user from customer group- Specified by:
removeUserFromCustomerGroupin interfaceCustomerGroupFacade- Parameters:
customerGroupId- customer group uiduserId- user uid
-
getCustomerGroupsForCurrentUser
public java.util.List<UserGroupData> getCustomerGroupsForCurrentUser()
Description copied from interface:CustomerGroupFacadeReturns all customers groups for the current user.- Specified by:
getCustomerGroupsForCurrentUserin interfaceCustomerGroupFacade- Returns:
- all customer groups of a current customer
-
getCustomerGroup
public UserGroupData getCustomerGroup(java.lang.String customerGroupId, java.util.Set<UserGroupOption> options)
Description copied from interface:CustomerGroupFacadeReturns customer group (a sub-group of 'cutomergroup') by uid.- Specified by:
getCustomerGroupin interfaceCustomerGroupFacade- Parameters:
customerGroupId- the customer group uidoptions- aSetof requiredUserGroupOptions- Returns:
- the customer group
-
getBaseCustomerGroup
protected UserGroupModel getBaseCustomerGroup()
-
getCustomerGroupById
protected UserGroupModel getCustomerGroupById(java.lang.String customerGroupId)
-
isCustomerGroup
protected boolean isCustomerGroup(UserGroupModel group)
- Parameters:
group-- Returns:
- true if the
groupis a direct sub-group of configured baseCustomerGroup
-
getUserById
protected UserModel getUserById(java.lang.String userId)
-
getCustomerGroupsForUser
public java.util.List<UserGroupData> getCustomerGroupsForUser(java.lang.String userId)
Description copied from interface:CustomerGroupFacadeGets a user's customer groups The givenuserIdis one of the unique identifiers that is used to recognize the user in matching strategies.- Specified by:
getCustomerGroupsForUserin interfaceCustomerGroupFacade- Parameters:
userId- the user's id used to identify the user.- Returns:
- all customer groups of a given customer
- See Also:
DefaultUserMatchingService
-
getAllCustomerGroups
public UserGroupDataList getAllCustomerGroups(PageOption pageOption)
Description copied from interface:CustomerGroupFacadeReturns user group with uid 'customergroup' and all it's direct subgroups- Specified by:
getAllCustomerGroupsin interfaceCustomerGroupFacade- Parameters:
pageOption- - result paging option.- Returns:
- All customer groups as
UserGroupDataList.
-
sortAndGetSubListDependsOnPageOption
protected UserGroupDataList sortAndGetSubListDependsOnPageOption(java.util.List<UserGroupData> input, PageOption pageOption)
-
getModelService
protected ModelService getModelService()
-
setModelService
public void setModelService(ModelService modelService)
-
getUserService
protected UserService getUserService()
-
setUserService
public void setUserService(UserService userService)
-
getUserMatchingService
protected UserMatchingService getUserMatchingService()
-
setUserMatchingService
public void setUserMatchingService(UserMatchingService userMatchingService)
-
getI18NService
protected I18NService getI18NService()
-
setI18NService
public void setI18NService(I18NService i18NService)
-
getUserGroupConverter
protected Converter<UserGroupModel,UserGroupData> getUserGroupConverter()
-
setUserGroupConverter
public void setUserGroupConverter(Converter<UserGroupModel,UserGroupData> userGroupConverter)
-
getCustomerGroupMembersPopulator
protected ConfigurablePopulator<UserGroupModel,UserGroupData,UserGroupOption> getCustomerGroupMembersPopulator()
-
setCustomerGroupMembersPopulator
public void setCustomerGroupMembersPopulator(ConfigurablePopulator<UserGroupModel,UserGroupData,UserGroupOption> customerGroupMembersPopulator)
-
getBaseCustomerGroupId
public java.lang.String getBaseCustomerGroupId()
-
setBaseCustomerGroupId
public void setBaseCustomerGroupId(java.lang.String value)
-
-