Class DefaultB2BCustomerService
- java.lang.Object
-
- de.hybris.platform.b2b.services.impl.DefaultB2BCustomerService
-
- All Implemented Interfaces:
B2BCustomerService<B2BCustomerModel,B2BUnitModel>
public class DefaultB2BCustomerService extends java.lang.Object implements B2BCustomerService<B2BCustomerModel,B2BUnitModel>
Default implementation of theB2BCustomerService
- Spring Bean ID:
- b2bCustomerService
-
-
Constructor Summary
Constructors Constructor Description DefaultB2BCustomerService()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addMember(PrincipalModel member, PrincipalGroupModel group)
java.util.List<B2BUserGroupModel>
getAllB2BUserGroups()
Gets all b2b user groupsjava.util.List<B2BCustomerModel>
getAllUsers()
Gets all usersprotected BaseDao
getBaseDao()
B2BCustomerModel
getCurrentB2BCustomer()
Gets the current b2b customer.protected SearchRestrictionService
getSearchRestrictionService()
B2BCustomerModel
getUserForUID(java.lang.String userId)
Delegates toUserService.getUserForUID(String, Class)
if the user was not found return null rather than throwing up de.hybris.platform.servicelayer.exceptions.UnknownIdentifierExceptionprotected UserService
getUserService()
boolean
principalExists(java.lang.String uid)
Deprecated.Since 4.4.void
setBaseDao(BaseDao baseDao)
void
setParentB2BUnit(B2BCustomerModel member, B2BUnitModel parentB2BUnit)
Sets the parent b2b unit.void
setSearchRestrictionService(SearchRestrictionService searchRestrictionService)
void
setUserService(UserService userService)
-
-
-
Method Detail
-
addMember
public void addMember(PrincipalModel member, PrincipalGroupModel group)
- Specified by:
addMember
in interfaceB2BCustomerService<B2BCustomerModel,B2BUnitModel>
- Parameters:
member
- A user to be added to a group, likeB2BCustomerModel
for examplegroup
- A user group to which a member is going to be added, like aB2BUnitModel
for example
-
setParentB2BUnit
public void setParentB2BUnit(B2BCustomerModel member, B2BUnitModel parentB2BUnit)
Description copied from interface:B2BCustomerService
Sets the parent b2b unit. If the customer does not have a default b2b unit company will be set as the default. The client of this method will most likely want to callB2BUnitService.updateBranchInSession(de.hybris.platform.servicelayer.session.Session, de.hybris.platform.core.model.user.UserModel)
after calling this method to make sure the session breach is refreshed.- Specified by:
setParentB2BUnit
in interfaceB2BCustomerService<B2BCustomerModel,B2BUnitModel>
- Parameters:
member
- the customer who will be assigned to the parent unitparentB2BUnit
- the parent b2b unit
-
getUserForUID
public B2BCustomerModel getUserForUID(java.lang.String userId)
Description copied from interface:B2BCustomerService
Delegates toUserService.getUserForUID(String, Class)
if the user was not found return null rather than throwing up de.hybris.platform.servicelayer.exceptions.UnknownIdentifierException- Specified by:
getUserForUID
in interfaceB2BCustomerService<B2BCustomerModel,B2BUnitModel>
- Parameters:
userId
- The unique identifier of the user- Returns:
- A hybris user typed T
-
getCurrentB2BCustomer
public B2BCustomerModel getCurrentB2BCustomer()
Description copied from interface:B2BCustomerService
Gets the current b2b customer.- Specified by:
getCurrentB2BCustomer
in interfaceB2BCustomerService<B2BCustomerModel,B2BUnitModel>
- Returns:
- current session user, if B2BCustomer. If not B2BCustomer it returns null
-
getAllUsers
public java.util.List<B2BCustomerModel> getAllUsers()
Description copied from interface:B2BCustomerService
Gets all users- Specified by:
getAllUsers
in interfaceB2BCustomerService<B2BCustomerModel,B2BUnitModel>
- Returns:
- the
List
of users
-
getAllB2BUserGroups
public java.util.List<B2BUserGroupModel> getAllB2BUserGroups()
Description copied from interface:B2BCustomerService
Gets all b2b user groups- Specified by:
getAllB2BUserGroups
in interfaceB2BCustomerService<B2BCustomerModel,B2BUnitModel>
- Returns:
- the
List
ofB2BUserGroupModel
-
principalExists
@Deprecated(since="4.4") public boolean principalExists(java.lang.String uid)
Deprecated.Since 4.4.Description copied from interface:B2BCustomerService
Returns true is principalExists with this uid, Visibility restrictions do no apply in query.- Specified by:
principalExists
in interfaceB2BCustomerService<B2BCustomerModel,B2BUnitModel>
- Returns:
- true if principal exists with this uid.
-
setUserService
public void setUserService(UserService userService)
-
getUserService
protected UserService getUserService()
-
getBaseDao
protected BaseDao getBaseDao()
-
setBaseDao
public void setBaseDao(BaseDao baseDao)
-
getSearchRestrictionService
protected SearchRestrictionService getSearchRestrictionService()
-
setSearchRestrictionService
public void setSearchRestrictionService(SearchRestrictionService searchRestrictionService)
-
-