Package org.wso2.carbon.billing.core

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


            }
        } catch (SQLException e) {
            String msg =
                    "Failed to get the invoice payments for: " + "invoice id = " + invoice.getId() + ".";
            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


            }
        } catch (SQLException e) {
            String msg = "Failed to get the invoice subscriptions for: " + "invoice id = "
                    + invoiceId + ".";
            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

                subscription.setSubscriptionPlan(result.getString("BC_FILTER"));
            }
        } catch (SQLException e) {
            String msg = "Failed to get the active subscription for id: " + subscriptionId + ".";
            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

                subscription.setSubscriptionPlan(result.getString("BC_FILTER"));
            }
        } catch (SQLException e) {
            String msg = "Failed to get the active subscription 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

        int invoiceSubscriptionId = subscription.getInvoiceSubscriptionId();
        if (invoiceSubscriptionId == INVALID) {
            String msg = "Not a invoiced subscription, subscription id: "
                    + subscription.getId() + ".";
            log.error(msg);
            throw new BillingException(msg);
        }

        List<Item> items = new ArrayList<Item>();
        try {
            String sql = "SELECT BC_ITEM_ID, BC_COST " +
                    "FROM BC_INVOICE_SUBSCRIPTION_ITEM WHERE BC_INVOICE_SUBSCRIPTION_ID=?";
            ps = conn.prepareStatement(sql);
            ps.setInt(1, invoiceSubscriptionId);
            result = ps.executeQuery();

            while (result.next()) {
                Item item = getItem(result.getInt("BC_ITEM_ID"));
                String cost = result.getString("BC_COST");
                if (cost != null) {
                    item.setCost(new Cash(cost));
                }
                items.add(item);
            }
        } catch (SQLException e) {
            String msg = "Failed to get the invoiced subscription items for " +
                    "invoice subscription id: " + invoiceSubscriptionId + ".";
            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

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

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

                customerId = result.getInt("BC_CUSTOMER_ID");
            }
        } catch (SQLException e) {
            String msg = "Failed to get the customer Id for invoice: " + invoiceId + ".";
            log.error(msg, e);
            throw new BillingException(msg, e);

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

                payment.setDescription(result.getString("BC_DESCRIPTION"));
            }
        } catch (SQLException e) {
            String msg = "Failed to get the last payment for customer: " + customer.getName() + ".";
            log.error(msg, e);
            throw new BillingException(msg, e);

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

                }
            }
        } catch (SQLException e) {
            String msg = "Failed to get the last invoice date";
            log.error(msg, e);
            throw new BillingException(msg, e);

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

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

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

        } finally {
            try {
                if (ps != null) {
                    ps.close();
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.