Package org.wso2.carbon.billing.core

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


            //customer.setAddress(); //we dont have the address
        }catch (Exception e){
            String msg = "Failed to fill the data for customer: " +
                    customer.getId() + ".";
            log.error(msg, e);
            throw new BillingException(msg, e);
        }
    }
View Full Code Here


                }
            }
        } catch (Exception e){
            String msg = "Failed to get all the customers.";
            log.error(msg, e);
            throw new BillingException(msg, e);
        }

        return customers;
    }
View Full Code Here

                items.put(id, item);
            }
        } catch (SQLException e) {
            String msg = "Failed to get all the items.";
            log.error(msg, e);
            throw new BillingException(msg, e);

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

                customers.add(customer);
            }
        }catch(Exception e){
            String msg = "Failed to get customers for customers: " + customerName + ".";
            log.error(msg, e);
            throw new BillingException(msg, e);
        }

        return customers;
    }
View Full Code Here

                //customer.setAddress();
            }
        } catch (Exception e){
            String msg = "Failed to get customer for customer id: " + customerId + ".";
            log.error(msg, e);
            throw new BillingException(msg, e);
        }

        return customer;
    }
View Full Code Here

                return item;
            }
        } catch (SQLException e) {
            String msg = "Failed to get the item with item id: " + itemId + ".";
            log.error(msg, e);
            throw new BillingException(msg, e);

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

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

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

            //setting the customer id: we dont have the customer id in the customer object
            //which comes with the subscription object. Therefore we have to get it.
            if(subscription.getCustomer().getId()==0){
                int customerId = CustomerUtils.getCustomerId(subscription.getCustomer().getName());
                if(customerId==0){
                    throw new BillingException("No customer found with domain: " +
                            subscription.getCustomer().getName());
                }
                //ps.setInt(6, subscription.getCustomer().getId());
                ps.setInt(6, customerId);
            }else{
                ps.setInt(6, subscription.getCustomer().getId());
            }

            ps.executeUpdate();
            result = ps.getGeneratedKeys();
            if (result.next()) {
                subscriptionId = result.getInt(1);
                subscription.setId(subscriptionId);
            }
        } catch (SQLException e) {
            String msg = "Failed to insert the subscription.";
            log.error(msg, e);
            throw new BillingException(msg, e);

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

                // we will fill the payment details too
            }
        } catch (SQLException e) {
            String msg = "Failed to get the active subscriptions for filter: " + filter + ".";
            log.error(msg, e);
            throw new BillingException(msg, e);

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

                invoice.setTotalPayment(new Cash(totalPaymentsStr));
            }
        } catch (SQLException e) {
            String msg = "Failed to get the invoice for customer: " + customer.getName() + ".";
            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.