Package org.zeroexchange.exception

Examples of org.zeroexchange.exception.BusinessLogicException


            bqDAO.save(assessment);
        }
       

        if(supplier == null) {
            throw new BusinessLogicException(
                    "Cannot find the accepted supply for the resource #"+ resource.getId() +"!");
        }
       
        AssessmentDescriptor assessmentDescriptor = new AssessmentDescriptor();
        assessmentDescriptor.setAssessmentType(BasicAssessmentTypes.BUSINESS_QUALITY);
View Full Code Here


            for(CurrencyManager provider: providers) {
                String currencyCodes[] = provider.getSupportedCurrencyCodes();
                if(currencyCodes != null) {
                    for(String nextCurrencyCode: currencyCodes) {
                        if(currencyCode2AmountProvider.containsKey(nextCurrencyCode)) {
                            throw new BusinessLogicException("The amount provider for currency with code '" +
                                    nextCurrencyCode + "' already exists!");
                           
                        }
                        currencyCode2AmountProvider.put(nextCurrencyCode, provider);
                    }
View Full Code Here

        if(credential == null) {
            throw new NullPointerException();
        }
        CredentialReader<Credential> processor = getProcessor(credential.getClass());
        if(processor == null) {
            throw new BusinessLogicException("Processor for class " + credential.getClass() + " does not exists");
        }
        return processor.credentialExists(credential);
    }
View Full Code Here

    @Override
    public <T extends Resource> T getResource(Integer resourceId) {
        @SuppressWarnings("unchecked")
        T resource = (T)resourceDAO.getById(resourceId);
        if(resource == null) {
            throw new BusinessLogicException("Unknown resource #" + resourceId);
        }
       
        Hibernate.initialize(resource.getNeeds());
        Hibernate.initialize(resource.getSupplies());
        Hibernate.initialize(resource.getTransientValues());
View Full Code Here

       
        Date currentDate = new Date();
        if(contract.getId() != null) {
            Contract existentContract = contractDAO.getById(contract.getId());
            if(ContractStatus.COMPLETED == existentContract.getStatus()) {
                throw new BusinessLogicException("Contract #" + contract.getId() + " is already completed!");
            }
        } else {
            contract.setCreationDate(currentDate);
        }
       
View Full Code Here

                contract,
                user,
                moneyManager.getDefaultCurrency());
       
        if(!moneyManager.isOutlayAllowed(moneyManager.getDefaultCurrency(), user, userContribution)) {
            throw new BusinessLogicException("Outlay " + userContribution + " is not allowed for user '" + user.getDisplayName() + "'");
        }
       
        contract.getAcceptors().add(user);
        return save(contract);
    }
View Full Code Here

       
        //Finish the current step.
//        currentStep.finishStep();
       
        if(!isNextStepAllowed(nextStepDiscriminator)) {
            throw new BusinessLogicException("The next step '" + nextStepDiscriminator + "' is not allowed for ");
        }
        Step<D> nextStep = getStep(nextStepDiscriminator);
       
        //Receive inter-step data
        D flowData = currentStep.getFlowDataManager().getData();
View Full Code Here

        Step<D> currentStep = null;
        if(!stepsStack.isEmpty()) {
            currentStep = stepsStack.get(stepsStack.size() - 1);
        }
        if(currentStep == null) {
            throw new BusinessLogicException("Workflow is not started");
        }
        return currentStep;
    }
View Full Code Here

                break;
            }
        }

        if(!found) {
            throw new BusinessLogicException("Cannot find step '" + stepDiscriminator + "' in stack!");
        }
       
        //Go back
        for(int i = idx + 1; i < count; i++) {
            stepsStack.remove(idx + 1);
View Full Code Here

        if(authentication == null) {
            throw new NullPointerException();
        }
        AuthTokenInformer<? super Authentication> processor = getProcessor(authentication.getClass());
        if(processor == null) {
            throw new BusinessLogicException("Cannot find processor for auth. token of class " + authentication.getClass());
        }
       
        return processor.getCredentials(authentication);
    }
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.