Package webshop.customer.api

Examples of webshop.customer.api.CustomerNotFoundException


  @Override
  public Customer getCustomerByEmail(String email) {
        JacksonDBCollection<Customer, String> customers = JacksonDBCollection.wrap(customerCollection, Customer.class, String.class);
        Customer findOne = customers.findOne(new BasicDBObject("email", email));
        if(findOne == null) {
          throw new CustomerNotFoundException(email);
        }
    return findOne;
  }
View Full Code Here


  public Customer getCustomerByEmailAndPassword(String email, String password) {
    String hash = DigestUtils.sha256Hex(password);
    JacksonDBCollection<Customer, String> customers = JacksonDBCollection.wrap(customerCollection, Customer.class, String.class);
        Customer findOne = customers.findOne(new BasicDBObject("email", email).append("password", hash));
        if(findOne == null) {
          throw new CustomerNotFoundException(email);
        }
    return findOne;
  }
View Full Code Here

TOP

Related Classes of webshop.customer.api.CustomerNotFoundException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.