Пример #1
0
 @Override
 public List<String> getBeneficiary() {
   List<String> res = new LinkedList();
   res.add(recipient.getUsername());
   res.add(recipient.getFirstname());
   res.add(recipient.getSecondname());
   return res;
 }
Пример #2
0
 public void checkRecipient() throws InvalidCustomerAccountException {
   try {
     em.createNamedQuery("UserEntity.findByUsername")
         .setParameter("username", recipient.getUsername())
         .getSingleResult();
   } catch (NoResultException nre) {
     System.out.println("No recipient found");
     throw new InvalidCustomerAccountException("Error: the recipient does not exist anymore.");
   }
 }
Пример #3
0
 public void checkCredentials(String user, String pwd) throws InvalidCustomerAccountException {
   if (!(sender.getUsername().equals(user) && sender.getPassword().equals(pwd))) {
     throw new InvalidCustomerAccountException("Error: Username or password not correct");
   }
 }