Class PurchasingImpl

  • All Implemented Interfaces:
    Purchasing

    public class PurchasingImpl
    extends Object
    implements Purchasing
    This class implements basic logic used to implement the purchasing aspects of the application.
    • Field Detail

      • logger

        private static final org.slf4j.Logger logger
      • random

        private Random random
    • Constructor Detail

      • PurchasingImpl

        public PurchasingImpl()
    • Method Detail

      • setEntityManager

        public void setEntityManager​(EntityManager em)
      • createAccount

        public Account createAccount​(String email,
                                     String firstName,
                                     String lastName)
        Description copied from interface: Purchasing
        Creates an account for the user to use in purchasing products.
        Specified by:
        createAccount in interface Purchasing
        Returns:
        the Account created with primary key assigned
      • checkout

        public double checkout​(String email,
                               String password)
        Description copied from interface: Purchasing
        Completes the purchase of the items in the user's shopping cart, empties the cart, and returns the total cost paid.

        Note that this capability is not yet fully defined.

        Specified by:
        checkout in interface Purchasing
        Returns:
        amount charged as part of this checkout
      • generatePassword

        private String generatePassword()