コード例 #1
0
 @Override
 public Long countApp(User user) throws ServiceException {
   try {
     return applicationDAO.countApp(user.getId());
   } catch (PersistenceException e) {
     throw new ServiceException(e.getLocalizedMessage(), e);
   }
 }
コード例 #2
0
 /**
  * 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;
   }
 }
コード例 #3
0
 @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);
   }
 }
コード例 #4
0
  @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);
    }
  }