public void validateIdent(InvoiceId id) throws ServiceException {
if (id==null) {
throw new NullPointerException("invoice identifier cannot be null");
}
try {
InvoiceIdImpl idInBase = (InvoiceIdImpl)DaoFactory.getInvoiceIdDao().find(id);
if (idInBase==null) {
throw new ServiceException("invoice identifier " + id.getIdent() + " cannot be found in database");
}
idInBase.setValid(true);
DaoFactory.getInvoiceIdDao().save(idInBase);
} catch (DaoException e) {
LOGGER.warn("cannot validate invoice identifier " + id);
throw new ServiceException("cannot validate invoice identifier");
}