Package com.cin.exceptions

Examples of com.cin.exceptions.UserNotFoundException


  }
 
  public UserDTO retrieveUserRecord(int ssn) throws UserNotFoundException{
    UserDTO userFound = userFactory.findUserBySsn(ssn);
    if( userFound == null ){
      throw new UserNotFoundException("User with ssn "+ssn+" was not found.");
    }
    return userFound;
  }
View Full Code Here


      if( quote < 1 ){
        quote = 1;
      }
      return Math.round((float) quote);
    } catch (UserNotFoundException e) {
      throw new UserNotFoundException("Client of this insurence policy was not found in system.");
    }
  }
View Full Code Here

    }
    UserDTO customer;
    try{
      customer = retrieveUserRecord(invitation.getCustomer());
    }catch(UserNotFoundException e){
      throw new UserNotFoundException(
          "Customer with ssn "+ invitation.getCustomer().getSsn()+" cannot be found.");
    }

    // check if agent exists
    if (invitation.getAgent() == null) {
      throw new IllegalArgumentException("Invitation must include agent.");
    }
   
    UserDTO agent;
    try{
      agent = retrieveUserRecord(invitation.getAgent());
    } catch(UserNotFoundException e){
      throw new UserNotFoundException(
          "Agent with ssn " + invitation.getAgent().getSsn() + " cannot be found.");
    }

    // record & send invitation
    // TODO: no invitation is actually mailed.
View Full Code Here

    // verify all data of the policy
    UserDTO user;
    try{
      user = retrieveUserRecord(policy.getUserSSN());
    }catch(UserNotFoundException e){
      throw new UserNotFoundException("Customer on the policy is not registered.");
    }
   
    calculateScoreForUser(user);
    if (user.getScore() <= 0) {
      throw new PurchaseException("Customer is not eligible for policy.");
View Full Code Here

TOP

Related Classes of com.cin.exceptions.UserNotFoundException

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.