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 class
DefaultCustomerGroupFacade.UserGroupDataComparator
-
Constructor Summary
Constructors Constructor Description DefaultCustomerGroupFacade()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addUserToCustomerGroup(java.lang.String customerGroupId, java.lang.String userId)
Assign user to customer groupvoid
createCustomerGroup(java.lang.String uid, java.lang.String localizedName)
Create customer group (direct sub group of 'customergroup') with given uid and localized name in current localeUserGroupDataList
getAllCustomerGroups(PageOption pageOption)
Returns user group with uid 'customergroup' and all it's direct subgroupsprotected UserGroupModel
getBaseCustomerGroup()
java.lang.String
getBaseCustomerGroupId()
UserGroupData
getCustomerGroup(java.lang.String customerGroupId, java.util.Set<UserGroupOption> options)
Returns customer group (a sub-group of 'cutomergroup') by uid.protected UserGroupModel
getCustomerGroupById(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 givenuserId
is one of the unique identifiers that is used to recognize the user in matching strategies.protected I18NService
getI18NService()
protected ModelService
getModelService()
protected UserModel
getUserById(java.lang.String userId)
protected Converter<UserGroupModel,UserGroupData>
getUserGroupConverter()
protected UserMatchingService
getUserMatchingService()
protected UserService
getUserService()
protected boolean
isCustomerGroup(UserGroupModel group)
void
removeUserFromCustomerGroup(java.lang.String customerGroupId, java.lang.String userId)
Remove user from customer groupvoid
setBaseCustomerGroupId(java.lang.String value)
void
setCustomerGroupMembersPopulator(ConfigurablePopulator<UserGroupModel,UserGroupData,UserGroupOption> customerGroupMembersPopulator)
void
setI18NService(I18NService i18NService)
void
setModelService(ModelService modelService)
void
setUserGroupConverter(Converter<UserGroupModel,UserGroupData> userGroupConverter)
void
setUserMatchingService(UserMatchingService userMatchingService)
void
setUserService(UserService userService)
protected UserGroupDataList
sortAndGetSubListDependsOnPageOption(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:CustomerGroupFacade
Create customer group (direct sub group of 'customergroup') with given uid and localized name in current locale- Specified by:
createCustomerGroup
in 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:CustomerGroupFacade
Assign user to customer group- Specified by:
addUserToCustomerGroup
in interfaceCustomerGroupFacade
- Parameters:
customerGroupId
- customer group uiduserId
- user uid
-
removeUserFromCustomerGroup
public void removeUserFromCustomerGroup(java.lang.String customerGroupId, java.lang.String userId)
Description copied from interface:CustomerGroupFacade
Remove user from customer group- Specified by:
removeUserFromCustomerGroup
in interfaceCustomerGroupFacade
- Parameters:
customerGroupId
- customer group uiduserId
- user uid
-
getCustomerGroupsForCurrentUser
public java.util.List<UserGroupData> getCustomerGroupsForCurrentUser()
Description copied from interface:CustomerGroupFacade
Returns all customers groups for the current user.- Specified by:
getCustomerGroupsForCurrentUser
in 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:CustomerGroupFacade
Returns customer group (a sub-group of 'cutomergroup') by uid.- Specified by:
getCustomerGroup
in interfaceCustomerGroupFacade
- Parameters:
customerGroupId
- the customer group uidoptions
- aSet
of requiredUserGroupOption
s- 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
group
is 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:CustomerGroupFacade
Gets a user's customer groups The givenuserId
is one of the unique identifiers that is used to recognize the user in matching strategies.- Specified by:
getCustomerGroupsForUser
in 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:CustomerGroupFacade
Returns user group with uid 'customergroup' and all it's direct subgroups- Specified by:
getAllCustomerGroups
in 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)
-
-