Interface CustomerFacade

    • Method Detail

      • nextDummyCustomerData

        CustomerData nextDummyCustomerData​(RegisterData registerData)
        Generate dummy customer data with random customerId to return if user already exists in database. * @param registerData data provided by user during registration
        Returns:
      • forgottenPassword

        void forgottenPassword​(java.lang.String id)
        Sends a forgotten password request for the customer specified. The given id is one of the unique identifiers that is used to recognize the customer in matching strategies.
        Parameters:
        id - the id of the customer to send the forgotten password mail for.
        Throws:
        UnknownIdentifierException - if the customer cannot be found for the id specified
        See Also:
        DefaultUserMatchingService
      • updatePassword

        void updatePassword​(java.lang.String token,
                            java.lang.String newPassword)
                     throws TokenInvalidatedException
        Update the password for the user by decrypting and validating the token.
        Parameters:
        token - the token to identify the the customer to reset the password for.
        newPassword - the new password to set
        Throws:
        java.lang.IllegalArgumentException - If the new password is empty or the token is invalid or expired
        TokenInvalidatedException - if the token was already used or there is a newer token
      • getCurrentCustomer

        CustomerData getCurrentCustomer()
                                 throws ConversionException
        Returns the current session user.
        Returns:
        current session user data
        Throws:
        ConversionException - the conversion exception when exception occurred when converting user
      • getCurrentCustomerUid

        java.lang.String getCurrentCustomerUid()
        Returns the uid of current session user.
        Returns:
        current session user uid
      • changeUid

        void changeUid​(java.lang.String newUid,
                       java.lang.String currentPassword)
                throws DuplicateUidException,
                       PasswordMismatchException
        Change the current customer's UID. The current password is required for 2 reasons, firstly to validate that the current visitor is actually the customer, secondly the password hash may be salted with the UID and therefore if the UID is changed then the password needs to be re-hashed.
        Parameters:
        newUid - the new UID for the current customer
        currentPassword - current user password to validate user
        Throws:
        PasswordMismatchException - thrown if the password is invalid
        DuplicateUidException - thrown if the newUid is already in use
      • changePassword

        void changePassword​(java.lang.String oldPassword,
                            java.lang.String newPassword)
                     throws PasswordMismatchException
        Changes current user password. If current session user is anonymous nothing happens.
        Parameters:
        oldPassword - old password to confirm
        newPassword - new password to set
        Throws:
        PasswordMismatchException - if the given old password does not match the one stored in the system
      • updateFullProfile

        void updateFullProfile​(CustomerData customerData)
                        throws DuplicateUidException
        Updates current customer's profile with given parameters
        Parameters:
        customerData - the updated customer data
        Throws:
        DuplicateUidException - if the login is not unique
      • loginSuccess

        void loginSuccess()
        updates the session currency and language to the user settings, assigns the cart to the current user and calculates the cart
      • changeGuestToCustomer

        void changeGuestToCustomer​(java.lang.String pwd,
                                   java.lang.String orderCode)
                            throws DuplicateUidException
        Create a regular customer from a guest customer who has just completed the guest checkout.
        Parameters:
        pwd - the new password entered by the user
        orderCode - the order code
        Throws:
        DuplicateUidException - if the login is not unique
      • generateGUID

        java.lang.String generateGUID()
        Generates a random guid
        Returns:
        a unique random guid
      • createGuestUserForAnonymousCheckout

        void createGuestUserForAnonymousCheckout​(java.lang.String email,
                                                 java.lang.String name)
                                          throws DuplicateUidException
        Creates a new guest customer for anonymousCheckout and sets the email and name.
        Parameters:
        email - the email address of the anonymous customer
        name - the name of the anonymous customer
        Throws:
        DuplicateUidException
      • updateCartWithGuestForAnonymousCheckout

        void updateCartWithGuestForAnonymousCheckout​(CustomerData guestCustomerData)
        Guest customer which is created for anonymous checkout will be the cart user. The session user will remain anonymous.
        Parameters:
        guestCustomerData - customer data to update the cart with
      • rememberMeLoginSuccessWithUrlEncoding

        void rememberMeLoginSuccessWithUrlEncoding​(boolean languageEncoding,
                                                   boolean currencyEncoding)
        This method will be used by rememberMeServices when there is encoding attributes for language and currency.
        Parameters:
        languageEncoding - enable/disable language encoding
        currencyEncoding - enable/disable currency encoding
      • getUserForUID

        CustomerData getUserForUID​(java.lang.String userId)
        Gets the user for UID.
        Parameters:
        userId - the user id
        Returns:
        the user for UID
      • setPassword

        void setPassword​(java.lang.String userId,
                         java.lang.String newPassword)
        Sets the new password for the user. The given userId is one of the unique identifiers that is used to recognize the user in matching strategies.
        Parameters:
        userId - id used to identify the user.
        newPassword - new password for the user
        Throws:
        UnknownIdentifierException - if user not found
        PasswordEncoderNotFoundException - if encoding not found
        See Also:
        DefaultUserMatchingService