public class DefaultPunchOutUserSelectionStrategy extends java.lang.Object implements PunchOutUserSelectionStrategy
PunchOutUserSelectionStrategy that makes sure we create a new user if
none exists for the provided PunchOutContact.| Constructor and Description |
|---|
DefaultPunchOutUserSelectionStrategy() |
| Modifier and Type | Method and Description |
|---|---|
protected UserModel |
findUser(java.lang.String userId) |
java.util.Collection<java.lang.String> |
getAcceptedUserTypes() |
CustomerAccountService |
getCustomerAccountService() |
ModelService |
getModelService() |
UserService |
getUserService() |
UserModel |
select(java.lang.String userId,
java.util.Collection<UserGroupModel> userGroups,
PunchOutSession punchoutSession)
Tries to find a user with the given
userId. |
void |
setAcceptedUserTypes(java.util.Collection<java.lang.String> acceptedUserTypes) |
void |
setCustomerAccountService(CustomerAccountService customerAccountService) |
void |
setModelService(ModelService modelService) |
void |
setUserService(UserService userService) |
protected void |
validateUser(UserModel user,
java.util.Collection<UserGroupModel> groups)
Validates that the given user is part of all
groups and is at least one of getAcceptedUserTypes()
. |
public DefaultPunchOutUserSelectionStrategy()
public UserModel select(java.lang.String userId, java.util.Collection<UserGroupModel> userGroups, PunchOutSession punchoutSession)
userId. If the user does not exist, creates a new one.select in interface PunchOutUserSelectionStrategyuserId - The user's ID.userGroups - The user groups related to the given user (not mandatory for existent users).punchoutSession - The Punch Out session.UserModel for the given userId.protected UserModel findUser(java.lang.String userId)
protected void validateUser(UserModel user, java.util.Collection<UserGroupModel> groups)
groups and is at least one of getAcceptedUserTypes()
.user - The user to validate.groups - The groups that the user belongs to.public UserService getUserService()
public void setUserService(UserService userService)
public ModelService getModelService()
public void setModelService(ModelService modelService)
public java.util.Collection<java.lang.String> getAcceptedUserTypes()
public void setAcceptedUserTypes(java.util.Collection<java.lang.String> acceptedUserTypes)
public CustomerAccountService getCustomerAccountService()
public void setCustomerAccountService(CustomerAccountService customerAccountService)
Copyright © 2018 SAP SE. All Rights Reserved.