Package org.zeroexchange.exception

Examples of org.zeroexchange.exception.BusinessLogicException


                valueProvidersMap.put(provider.getPropertyTypeId(), provider);
            }
        }
        ValueProvider<Value> valueProvider = valueProvidersMap.get(propertyType.getId());
        if(valueProvider == null) {
            throw new BusinessLogicException("Cannot find value provider for the property type '" + propertyType.getId() + "'");
        }
        return valueProvider.createValue();
    }
View Full Code Here


            User user) {
        BigDecimal reserved = creditStatusDAO.getReserved(user.getId());
        if(reserved != null && reserved.compareTo(amount) >= 0) {
            creditStatusDAO.freeAmount(amount, user.getId());
        } else {
            throw new BusinessLogicException("Cannot free requested amount");
        }
    }
View Full Code Here

    protected ContractStatus getNextContractStatus(Contract contract) {
       
        ContractStatus contractStatus = contract.getStatus();
        ContractFlowStep currentContractStep = contractFlowStatesRegistry.getFlowStep(contractStatus);
        if(currentContractStep == null) {
            throw new BusinessLogicException("Cannot find processor to process contract status '" + contractStatus + "'");
        }
       
        return currentContractStep.nextStep(contract);
    }
View Full Code Here

    @Override
    public ContractStatus nextStep(Contract contract) {
        ContractStatus contractStatus = contract.getStatus();
        ContractStatus processorStatus = getProcessingStatus();
        if(contract.getStatus() != processorStatus) {
            throw new BusinessLogicException("Contract with status '" + contractStatus.name() +
                    "' cannot be processed with the processor for state '" + getProcessingStatus() + "'!");
        }
        return calculateNextNearestStep(contract);
    }
View Full Code Here

                       
                        session.createSQLQuery(line).executeUpdate();
                    }
                } catch (Exception e) {
                    log.error("", e);
                    throw new BusinessLogicException(e.getMessage(), e);
                } finally {
                    IOUtils.closeQuietly(reader);
                }
                return null;
            }
View Full Code Here

        for(User recipient: recipients) {
            if(recipient == null) {
                String unknownRecipientMessage = MessageFormat.format(getString(MKEY_UNKNOWN_RECIPIENT), new Object[]{recipient});
                recipientsListLabel.error(unknownRecipientMessage);
                throw new BusinessLogicException(unknownRecipientMessage);
            }
        }
        event.setRecipients(recipients);
       
        return event;
View Full Code Here

     */
    protected void initUI() {
       
        Integer tenderId = getPageParameters().get(PKEY_TENDER_ID).toInteger();
        if(tenderId == null) {
            throw new BusinessLogicException("tenderId is null");
        }
       
        tender = getTenderType() == TenderType.NEED ?
                needManager.getNeed(tenderId) : supplyManager.getSupply(tenderId);
       
View Full Code Here

            } else if(ServiceResource.class.isAssignableFrom(resource.getClass())) {
                return new ResourceEditPanel<ServiceResource, ResourceFormData>(componentId, this.<ServiceResource>getResourceModel());
            } else if(MoneyResource.class.isAssignableFrom(resource.getClass())) {
                return new MoneyEditPanel(componentId, this.<MoneyResource>getResourceModel());
            } else {
                throw new BusinessLogicException("Unknown resource type:" + (resource == null ? "NULL" : resource.getClass().getName()));
            }
        case CONFIRM_SUPPLY:
            return new ConfirmSupplyPanel(componentId, getResourceModel());
        case TENDERS_NEED:
            return new NeedsManagementPanel(componentId, getResourceModel());
        case TENDERS_SUPPLY:
            return new SuppliesManagementPanel(componentId, getResourceModel());
        case PERSONAL_TENDER:
            return new PersonalTenderPanel(componentId, getResourceModel());
        }
        throw new BusinessLogicException("Cannot build the panel for action '" + action + "'");
    }
View Full Code Here

            JAXBContext jaxbContext;
            try {
                jaxbContext = JAXBContext.newInstance(Menu.class);
                menu = (Menu) jaxbContext.createUnmarshaller().unmarshal(menuDescriptionResource.getInputStream());
            } catch (Exception e) {
                new BusinessLogicException("Cannot load menu description", e);
            }
        }
   
        return menu.getMenuItems();
    }
View Full Code Here

                        return true;
                    }
                    return localizationCallback.onValue(value, language);
                } catch (Exception e) {
                    log.error("Cannot read property '" + Strings.FIELD_VALUE + language + "'", e);
                    throw new BusinessLogicException("Cannot read property '" + Strings.FIELD_VALUE + language + "'", e);
                }
            }

            @Override
            public T getResult() {
View Full Code Here

TOP

Related Classes of org.zeroexchange.exception.BusinessLogicException

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.