Package org.bigk.invoices.exceptions

Examples of org.bigk.invoices.exceptions.ServiceException


    User user = null;
    try {
      user = usersDAO.getUser4Login(login);
    } catch (DBAccessException ex) {
      logger.error("processLogin(String, String)", ex);
      throw new ServiceException(ex);
    }
   
    if (user == null) {
      throw new ServiceException("No user found for username",
          "services.LoginServiceImpl.processLogin.no_user",
          new Object[] {login}
      );
    }
   
    String passSHA1 = null;
    try {
      passSHA1 = DigestUtils.digestSHA1(password);
    } catch (NoSuchAlgorithmException e) {
      logger.error("processLogin(String, String)", e);
      throw new ServiceException("NoSuchAlgorithmException", e,
          "services.LoginServiceImpl.processLogin.algoritm_problem",
          new Object[] {e.getMessage()}
      );     
    }
   

    if (logger.isDebugEnabled()) {
      logger.debug("processLogin(String, String) - passSHA1=" + passSHA1);
      logger.debug("processLogin(String, String) - user.getPassword()=" + user.getPassword());
    }
   
    if (!passSHA1.equalsIgnoreCase(user.getPassword())) {
      throw new ServiceException("Wrong password",
          "services.LoginServiceImpl.processLogin.wrong_password",
          null
      );
    }
   
View Full Code Here


        }
      }
     
    } catch (HibernateException ex) {
      logger.error("listAllItems()", ex);
      throw new ServiceException(ex);
    }

    if (logger.isDebugEnabled()) {
      logger.debug("listAllItems() - end - return value=" + CollectionUtils.size(list));
    }
View Full Code Here

        }
      }

    } catch (HibernateException ex) {
      logger.error("listItems4Page(InvoiceFilter)", ex);
      throw new ServiceException(ex);
    }

    if (logger.isDebugEnabled()) {
      logger.debug("listItems4Page(InvoiceFilter) - end - return value=" + CollectionUtils.size(list));
    }
View Full Code Here

      recalculateInvoice(object);
      hrInvoiceNumberService.updateHRInvoiceNumber(object);
     
    } catch (HibernateException ex) {
      logger.error("getInvoice(Long)", ex);
      throw new ServiceException(ex);
    }

    if (logger.isDebugEnabled()) {
      logger.debug("getInvoice(Long) - end - return value=" + object);
    }
View Full Code Here

        maxNumber = maxNumberLong.intValue();
      crit.setProjection(null);
      crit.setResultTransformer(Criteria.ROOT_ENTITY);
    } catch (HibernateException ex) {
      logger.error("getMaxInvoiceNumber(Long)", ex);
      throw new ServiceException(ex);
    }

    if (logger.isDebugEnabled()) {
      logger.debug("getMaxInvoiceNumber(String) - end - return value=" + maxNumber);
    }
View Full Code Here

    try {
      session = HibernateUtils.getCurrentSession();
      session.save(invoice);
    } catch (HibernateException ex) {
      logger.error("saveInvoice(Invoice)", ex);
      throw new ServiceException(ex);
    }

    if (logger.isDebugEnabled()) {
      logger.debug("saveInvoice(Invoice) - end");
    }
View Full Code Here

    try {
      session = HibernateUtils.getCurrentSession();
      session.delete(invoice);
    } catch (HibernateException ex) {
      logger.error("deleteInvoice(Invoice)", ex);
      throw new ServiceException(ex);
    }

    if (logger.isDebugEnabled()) {
      logger.debug("deleteInvoice(Invoice) - end");
    }
View Full Code Here

      crit.addOrder(Order.asc("id"));
      list = crit.list();
     
    } catch (HibernateException ex) {
      logger.error("listAllItems()", ex);
      throw new ServiceException(ex);
    }

    if (logger.isDebugEnabled()) {
      logger.debug("listAllItems() - end - return value=" + CollectionUtils.size(list));
    }
View Full Code Here

      session = HibernateUtils.getCurrentSession();
      object = (Tax) session.get(Tax.class, id);
     
    } catch (HibernateException ex) {
      logger.error("getTax(Long)", ex);
      throw new ServiceException(ex);
    }

    if (logger.isDebugEnabled()) {
      logger.debug("getTax(Long) - end - return value=" + object);
    }
View Full Code Here

      throws ServiceException {
    logger.debug("calculatePaymentDate(soldDate=[{}], paymentKindId=[{}]) - start", soldDate, paymentKindId);

    PaymentKind paymentKind = this.getPaymentKind(paymentKindId);
    if (paymentKind == null) {
      throw new ServiceException("No PaymentKind read for id: " + paymentKindId);
    }
    Date returnDate = calculatePaymentDate(soldDate, paymentKind.getValue());

    logger.debug("calculatePaymentDate() - end - return value=[{}]", returnDate);
    return returnDate;
View Full Code Here

TOP

Related Classes of org.bigk.invoices.exceptions.ServiceException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.