@Override
 public Long countApp(User user) throws ServiceException {
   try {
     return applicationDAO.countApp(user.getId());
   } catch (PersistenceException e) {
     throw new ServiceException(e.getLocalizedMessage(), e);
   }
 }
 /**
  * Test if the application already exists
  *
  * @param user
  * @param applicationName
  * @return
  * @throws ServiceException
  * @throws CheckException
  */
 @Override
 public boolean checkAppExist(User user, String applicationName)
     throws ServiceException, CheckException {
   logger.info("--CHECK APP EXIST--");
   if (applicationDAO.findByNameAndUser(user.getId(), applicationName) == null) {
     return false;
   } else {
     return true;
   }
 }
 @Override
 public List<Application> findAllByUser(User user) throws ServiceException {
   try {
     List<Application> applications = applicationDAO.findAllByUser(user.getId());
     logger.debug("ApplicationService : All Applications found ");
     return applications;
   } catch (PersistenceException e) {
     logger.error("Error ApplicationService : error findById Method : " + user);
     throw new ServiceException(user.toString(), e);
   }
 }
  @Override
  public Application findByNameAndUser(User user, String name) throws ServiceException {
    try {
      Application application = applicationDAO.findByNameAndUser(user.getId(), name);

      return application;

    } catch (PersistenceException e) {
      logger.error(user.toString(), e);
      throw new ServiceException(user.toString(), e);
    }
  }