Examples of BillingException


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

       
        try {
            ruleSetDescription.setRuleSource(new FileInputStream(ruleFile));
        } catch (FileNotFoundException e) {
            String msg = "file not found. file name: " + ruleFile + ".";
            throw new BillingException(msg, e);
        }
       
        // ruleSetDescription.setBindURI("file:" + ruleFile);
        String uri = ruleEngine.addRuleSet(ruleSetDescription);
        SessionDescription sessionDescription = new SessionDescription();
View Full Code Here

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

            dayToTriggerOn = Integer.parseInt(dayToTriggerOnStr);
        } catch (NumberFormatException e) {
            String msg = "The trigger on field currently support only numbers. " + "" +
                            "Invalid dayToTriggerOn " + dayToTriggerOnStr + ".";
            log.error(msg, e);
            throw new BillingException(msg, e);
        }

        String hourToTriggerOnStr = triggerCalculatorConfig.get(HOUR_TO_TRIGGER_ON_KEY);
        try {
            hourToTriggerOn = Integer.parseInt(hourToTriggerOnStr);
        } catch (NumberFormatException e) {
            String msg = "The trigger on field currently support only numbers. " +
                    "Invalid hourToTriggerOn " + hourToTriggerOnStr + ".";
            log.error(msg, e);
            throw new BillingException(msg, e);
        }

        String minuteToTriggerOnStr = triggerCalculatorConfig.get(MINUTE_TO_TRIGGER_ON_KEY);
        try{
            minuteToTriggerOn = Integer.parseInt(minuteToTriggerOnStr);
        }catch (NumberFormatException e){
            String msg = "The trigger on field currently support only numbers. " +
                    "Invalid minuteToTriggerOn " + minuteToTriggerOnStr + ".";
            log.error(msg, e);
            throw new BillingException(msg, e);
        }

        cron = triggerCalculatorConfig.get(CRON_KEY);
        log.debug("Cron string: " + cron);
    }
View Full Code Here

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

        try {
            packageConfigs = CommonUtil.buildOMElement(new FileInputStream(configFilePath));
        } catch (Exception e) {
            String msg = "Error in deserializing the packageConfigs file: " + configFilePath + ".";
            log.error(msg, e);
            throw new BillingException(msg, e);
        }

        Iterator packageConfigsChildsIt = packageConfigs.getChildElements();
        while (packageConfigsChildsIt.hasNext()) {
            OMElement packageConfigEle = (OMElement) packageConfigsChildsIt.next();
View Full Code Here

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

            OMElement valueNode = (OMElement) valueNodes.get(0);
            return valueNode.getText();
        } catch (JaxenException e) {
            String msg = "Error in retrieving the key: " + qualifiedKey + ".";
            log.error(msg, e);
            throw new BillingException(msg, e);
        }
    }
View Full Code Here

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

                }
            }
            succeeded = true;
        }catch (Exception e){
            log.error(e.getMessage());
            throw new BillingException(e.getMessage(), e);
        }finally {
            if (succeeded) {
                dataAccessObject.commitTransaction();
            } else {
                dataAccessObject.rollbackTransaction();
View Full Code Here

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

            customer.setNumberOfUsers(usage.getNumberOfUsers());
        } catch (Exception e) {
            String msg = "Error in getting the tenant usage for customer name: "
                    + customer.getName() + ".";
            log.error(msg);
            throw new BillingException(msg, e);
        }
    }
View Full Code Here

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

            String msg = "Error occurred while getting subscription: " + filter;
            if(customer != null) {
                msg = msg + " for customer: " + customer.getName();
            }
            log.error(msg);
            throw new BillingException(msg, e);
        }finally {
            if (succeeded) {
                dataAccessObject.commitTransaction();
            } else {
                dataAccessObject.rollbackTransaction();
View Full Code Here

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

            conn.setAutoCommit(false);
            Transaction.incNestedDepth();
        } catch (SQLException e) {
            String msg = "Failed to start new billing transaction. " + e.getMessage();
            log.error(msg, e);
            throw new BillingException(msg, e);
        }

        Transaction.setConnection(conn);
    }
View Full Code Here

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

            conn.rollback();

        } catch (SQLException e) {
            String msg = "Failed to rollback transaction. " + e.getMessage();
            log.error(msg, e);
            throw new BillingException(msg, e);

        } finally {
            endTransaction();
            Transaction.decNestedDepth();
        }
View Full Code Here

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

        if (Transaction.isRollbacked()) {
            String msg = "The transaction is already rollbacked, you can not commit a transaction "
                    + "already rollbacked, nested depth: " + Transaction.getNestedDepth() + ".";
            log.debug(msg);
            Transaction.decNestedDepth();
            throw new BillingException(msg);
        }

        Connection conn = Transaction.getConnection();
        try {
            conn.commit();

        } catch (SQLException e) {
            String msg = "Failed to commit transaction. " + e.getMessage();
            log.error(msg, e);
            throw new BillingException(msg, e);

        } finally {
            endTransaction();
            Transaction.decNestedDepth();
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.