/** * Retrieves the number of the unread emails for the given account. * * @param account is the account associated to the user we are interested in. * @return the number of unread emails. * @throws com.funambol.email.exception.EntityException if any error occurs. */ public int getNumUnreadEmail(MailServerAccount account) throws EntityException { int numberUnreadEmails = 0; try { numberUnreadEmails = cdao.getNumUnreadEmail(account); } catch (DBAccessException e) { throw new EntityException("Error getting the number of unread emails.", e); } return numberUnreadEmails; }
/** * Retrieves the number of the unread emails. * * @param username is the username * @return the number of unread emails. * @throws com.funambol.email.exception.EntityException if any error occurs. */ public int getNumUnreadEmail(String username) throws EntityException { int numberUnreadEmails = 0; try { numberUnreadEmails = cdao.getNumUnreadEmail(username); } catch (DBAccessException e) { throw new EntityException("Error getting the number of unread emails.", e); } return numberUnreadEmails; }