Package org.wso2.carbon.billing.core

Examples of org.wso2.carbon.billing.core.BillingException


            return true;
            }
        } catch (Exception e) {
            String msg = "Error in updating the subscription for tenant : " + customerID + ".";
            log.error(msg, e);
            throw new BillingException(msg, e);
        }

    }
View Full Code Here


                subscriptions.add(subscription);
            }
        } catch (SQLException e) {
            String msg = "Failed to get the inactive subscriptions for customer id: " + customerID + ".";
            log.error(msg, e);
            throw new BillingException(msg, e);

        } finally {
            try {
                if (ps != null) {
                    ps.close();
                }
            } catch (SQLException ex) {
                String msg = RegistryConstants.RESULT_SET_PREPARED_STATEMENT_CLOSE_ERROR
                        + ex.getMessage();
                log.error(msg, ex);
                throw new BillingException(msg, ex);
            }

            try {
                if (result != null) {
                    result.close();
View Full Code Here

            updated = ps.executeUpdate();
        } catch (SQLException e) {
            String msg = "Error in activating the subscription id : " + subscriptionId + ".";
            log.error(msg, e);
            throw new BillingException(msg, e);

        }finally {
            try {
                if (ps != null) {
                    ps.close();
View Full Code Here

                    BillingConstants.NS_PREFIX).equals(childEle.getQName())) {
                deserializeHandlers(childEle);
            } else {
                String msg = "Unknown element in task configuration for task " + id;
                log.error(msg);
                throw new BillingException(msg);
            }
        }
    }
View Full Code Here

        if (cashString.contains(".")) {
            String wholeNumberStr = cashString.substring(0, cashString.indexOf("."));
            if (wholeNumberStr.trim().equals("")) {
                String msg = "Whole number can not be empty";
                throw new BillingException(msg);
            }
            if (notNumbersPattern.matcher(wholeNumberStr).find()) {
                String msg = "The whole number expected to have only 0-9 characters.: " +
                                wholeNumberStr + " is not a number. ";
                throw new BillingException(msg);
            }
           
            String decimalNumberStr = cashString.substring(cashString.indexOf(".") + 1);
            if (notNumbersPattern.matcher(decimalNumberStr).find()) {
                String msg = "The decimal number expected to have only 0-9 characters.: " +
                                decimalNumberStr + " is not a number. ";
                throw new BillingException(msg);
            }
            if (decimalNumberStr.length() == 0) {
                String msg = "String after the decimal point is zero.";
                throw new BillingException(msg);
            } else if (decimalNumberStr.length() > 2) {
                String msg = "String after the decimal point is greater than 2";
                throw new BillingException(msg);
            } else if (decimalNumberStr.length() == 1) {
                decimalNumberStr += "0";
            }
           
            wholeNumber = Integer.parseInt(wholeNumberStr);
            decimalNumber = Integer.parseInt(decimalNumberStr);
           
        } else {
            if (notNumbersPattern.matcher(cashString).find()) {
                String msg = "The cash string to have only 0-9 characters.: " + cashString +
                                " is not a number. ";
                throw new BillingException(msg);
            }
           
            wholeNumber = Integer.parseInt(cashString);
            decimalNumber = 0;
        }
View Full Code Here

            OMElement handlerEle = (OMElement) handlersChildIt.next();
            if (!(new QName(BillingConstants.CONFIG_NS, BillingConstants.HANDLER,
                    BillingConstants.NS_PREFIX).equals(handlerEle.getQName()))) {
                String msg = "Unknown element in handler configuration for task " + id;
                log.error(msg);
                throw new BillingException(msg);
            }

            // get the parameters for handler
            Iterator handlerParametersIt = handlerEle.getChildElements();
            Map<String, String> constructorArgs = extractConstructorArgs(handlerParametersIt);
View Full Code Here

        if (!a.getCurrency().equals(b.getCurrency())) {
            // we still not support this.
            String msg = "Can not add in-similar currencies: " + a.getCurrency() + "!=" +
                            b.getCurrency() + ".";
            log.error(msg);
            throw new BillingException(msg);
        }
       
        if (a.getSign() == Sign.POSITIVE && b.getSign() == Sign.NEGATIVE) {
            Cash b2 = new Cash(b);
            b2.setSign(Sign.POSITIVE);
View Full Code Here

        if (!a.getCurrency().equals(b.getCurrency())) {
            // we still not support this.
            String msg = "Can not add in-similar currencies: " + a.getCurrency() + "!=" +
                            b.getCurrency() + ".";
            log.error(msg);
            throw new BillingException(msg);
        }
       
        if (a.getSign() == Sign.POSITIVE && b.getSign() == Sign.NEGATIVE) {
            Cash b2 = new Cash(b);
            b2.setSign(Sign.POSITIVE);
View Full Code Here

            scheduleHelper = schedulerServices.get(schedulerServiceName);
            if (scheduleHelper == null) {
                String msg = "The scheduler helper service: " + schedulerServiceName +
                                " is not loaded.";
                log.error(msg);
                throw new BillingException(msg);
            }
            scheduleHelper.init(schedulerHelperArgs);
        }
        return scheduleHelper;
    }
View Full Code Here

                    BillingHandler handlerService = handlerServices.get(bean.name);
                    if (handlerService == null) {
                        billingHandlers = null;
                        String msg = "The handler service: " + bean.name + " is not loaded.";
                        log.error(msg);
                        throw new BillingException(msg);
                    }
                    handlerService.init(bean.constructorArgs);
                    billingHandlers.add(handlerService);

                } else {
View Full Code Here

TOP

Related Classes of org.wso2.carbon.billing.core.BillingException

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.