@Override public void checkCreate(Application application,String serverName) throws CheckException, ServiceException {
  try {
    if (checkAppExist(application.getUser(),application.getName())) {
      throw new CheckException(messageSource.getMessage("app.exists",null,locale));
    }
    if (checkNameLength(application.getName())) {
      throw new CheckException("This name has length equal to zero : " + application.getName());
    }
    if (imageService.findByName(serverName) == null)     throw new CheckException(messageSource.getMessage("image.not.found",null,locale));
    imageService.findByName(serverName);
  }
 catch (  PersistenceException e) {
    logger.error("ApplicationService Error : Create Application" + e);
    throw new ServiceException(e.getLocalizedMessage(),e);
  }
}

@ Override public void checkCreate ( Application application , String serverName ) throws CheckException , ServiceException { try { if ( checkAppExist ( application . getUser ( ) , application . getName ( ) ) ) { throw new CheckException ( messageSource . getMessage ( "app.exists" , null , locale ) ) ; } if ( checkNameLength ( application . getName ( ) ) ) { throw new CheckException ( "This name has length equal to zero : " + application . getName ( ) ) ; } if ( imageService . findByName ( serverName ) == null ) throw new CheckException ( messageSource . getMessage ( "image.not.found" , null , locale ) ) ; imageService . findByName ( serverName ) ; } catch ( PersistenceException e ) { logger . error ( "ApplicationService Error : Create Application" + e ) ; throw new ServiceException ( e . getLocalizedMessage ( ) , e ) ; } }
test if the user can create new applications because we limit the number per user
