Class DefaultPunchOutUserSelectionStrategy

    • Constructor Detail

      • DefaultPunchOutUserSelectionStrategy

        public DefaultPunchOutUserSelectionStrategy()
    • Method Detail

      • select

        public UserModel select​(java.lang.String userId,
                                java.util.Collection<UserGroupModel> userGroups,
                                PunchOutSession punchoutSession)
        Tries to find a user with the given userId. If the user does not exist, creates a new one.
        Specified by:
        select in interface PunchOutUserSelectionStrategy
        Parameters:
        userId - The user's ID.
        userGroups - The user groups related to the given user (not mandatory for existent users).
        punchoutSession - The Punch Out session.
        Returns:
        The UserModel for the given userId.
      • findUser

        protected UserModel findUser​(java.lang.String userId)
      • validateUser

        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() .
        Parameters:
        user - The user to validate.
        groups - The groups that the user belongs to.
      • setUserService

        public void setUserService​(UserService userService)
      • setModelService

        public void setModelService​(ModelService modelService)
      • getAcceptedUserTypes

        public java.util.Collection<java.lang.String> getAcceptedUserTypes()
      • setAcceptedUserTypes

        public void setAcceptedUserTypes​(java.util.Collection<java.lang.String> acceptedUserTypes)
      • setCustomerAccountService

        public void setCustomerAccountService​(CustomerAccountService customerAccountService)