Examples of UsageServiceClient


Examples of org.apache.stratos.usage.ui.clients.UsageServiceClient

    private static long TB_LIMIT = (long) 1024 * 1024 * 1024 * 1024;

    public static TenantUsage retrieveCurrentTenantUsage(ServletRequest request,
                                                         ServletConfig config, HttpSession session) throws Exception {
        try {
            UsageServiceClient serviceClient = new UsageServiceClient(config, session);
            String yearMonth = request.getParameter("year-month");
            if (yearMonth == null) {
                // get the current year month
                yearMonth = getCurrentYearMonth();
            }
            return serviceClient.retrieveCurrentTenantUsage(yearMonth);
        } catch (Exception e) {
            String msg = "Failed to get current tenant usage.";
            log.error(msg, e);
            throw new UIException(msg, e);
        }
View Full Code Here

Examples of org.apache.stratos.usage.ui.clients.UsageServiceClient

    }

    public static TenantUsage[] retrieveTenantUsages(ServletRequest request,
                                                     ServletConfig config, HttpSession session) throws Exception {
        try {
            UsageServiceClient serviceClient = new UsageServiceClient(config, session);
            String yearMonth = request.getParameter("year-month");
            if (yearMonth == null) {
                // get the current year month
                yearMonth = getCurrentYearMonth();
            }
            return serviceClient.retrieveTenantUsages(yearMonth);
        } catch (Exception e) {
            String msg = "Failed to get all tenants usages.";
            log.error(msg, e);
            throw new UIException(msg, e);
        }
View Full Code Here

Examples of org.apache.stratos.usage.ui.clients.UsageServiceClient

        if (requestedPage != null && requestedPage.length() > 0) {
            pageNumber = new Integer(requestedPage);
        }

        try {
            UsageServiceClient serviceClient = new UsageServiceClient(config, session);
            String yearMonth = request.getParameter("year-month");
            if (yearMonth == null) {
                // get the current year month
                yearMonth = getCurrentYearMonth();
            }
            return serviceClient.retrievePaginatedTenantUsages(yearMonth, pageNumber, entriesPerPage);
        } catch (Exception e) {
            String msg = "Failed to get all tenants usages.";
            log.error(msg, e);
            throw new UIException(msg, e);
        }
View Full Code Here

Examples of org.apache.stratos.usage.ui.clients.UsageServiceClient

    }

    public static TenantUsage retrieveTenantUsage(ServletRequest request,
                                                  ServletConfig config, HttpSession session) throws Exception {
        try {
            UsageServiceClient serviceClient = new UsageServiceClient(config, session);
            String yearMonth = request.getParameter("year-month");
            if (yearMonth == null) {
                // get the current year month
                yearMonth = getCurrentYearMonth();
            }
            String tenantIdStr = request.getParameter("tenant-id");
            if (tenantIdStr == null) {
                tenantIdStr = "0";
            }
            return serviceClient.retrieveTenantUsage(yearMonth, Integer.parseInt(tenantIdStr));
        } catch (Exception e) {
            String msg = "Failed to get tenant usages.";
            log.error(msg, e);
            throw new UIException(msg, e);
        }
View Full Code Here

Examples of org.apache.stratos.usage.ui.clients.UsageServiceClient

    public static InstanceUsageStatics[] retrieveInstanceUsage(ServletRequest request,
                                                               ServletConfig config, HttpSession session)
            throws Exception {

        try {
            UsageServiceClient serviceClient = new UsageServiceClient(config, session);
            InstanceUsageStatics[] returnInstanceUsage = serviceClient.retrieveInstanceUsage();
            return returnInstanceUsage;
        } catch (Exception e) {
            String msg = "Failed to get current instance usage.";
            log.error(msg, e);
            throw new UIException(msg, e);
View Full Code Here

Examples of org.apache.stratos.usage.ui.clients.UsageServiceClient

        int entriesPerPage = 15;
        if (requestedPage != null && requestedPage.length() > 0) {
            pageNumber = new Integer(requestedPage);
        }
        try {
            UsageServiceClient serviceClient = new UsageServiceClient(config, session);
            String yearMonth = request.getParameter("year-month");
            if (yearMonth == null) {
                // get the current year month
                yearMonth = getCurrentYearMonth();
            }
            return serviceClient.retrievePaginatedInstanceUsage(yearMonth, pageNumber, entriesPerPage);
        } catch (Exception e) {
            String msg = "Failed to get paginated instance usages.";
            log.error(msg, e);
            throw new UIException(msg, e);
        }
View Full Code Here

Examples of org.wso2.carbon.usage.ui.clients.UsageServiceClient

    private static long TB_LIMIT = (long) 1024 * 1024 * 1024 * 1024;

    public static TenantUsage retrieveCurrentTenantUsage(ServletRequest request,
                                                         ServletConfig config, HttpSession session) throws Exception {
        try {
            UsageServiceClient serviceClient = new UsageServiceClient(config, session);
            String yearMonth = request.getParameter("year-month");
            if (yearMonth == null) {
                // get the current year month
                yearMonth = getCurrentYearMonth();
            }
            return serviceClient.retrieveCurrentTenantUsage(yearMonth);
        } catch (Exception e) {
            String msg = "Failed to get current tenant usage.";
            log.error(msg, e);
            throw new UIException(msg, e);
        }
View Full Code Here

Examples of org.wso2.carbon.usage.ui.clients.UsageServiceClient

    }

    public static TenantUsage[] retrieveTenantUsages(ServletRequest request,
                                                     ServletConfig config, HttpSession session) throws Exception {
        try {
            UsageServiceClient serviceClient = new UsageServiceClient(config, session);
            String yearMonth = request.getParameter("year-month");
            if (yearMonth == null) {
                // get the current year month
                yearMonth = getCurrentYearMonth();
            }
            return serviceClient.retrieveTenantUsages(yearMonth);
        } catch (Exception e) {
            String msg = "Failed to get all tenants usages.";
            log.error(msg, e);
            throw new UIException(msg, e);
        }
View Full Code Here

Examples of org.wso2.carbon.usage.ui.clients.UsageServiceClient

        if (requestedPage != null && requestedPage.length() > 0) {
            pageNumber = new Integer(requestedPage);
        }

        try {
            UsageServiceClient serviceClient = new UsageServiceClient(config, session);
            String yearMonth = request.getParameter("year-month");
            if (yearMonth == null) {
                // get the current year month
                yearMonth = getCurrentYearMonth();
            }
            return serviceClient.retrievePaginatedTenantUsages(yearMonth, pageNumber, entriesPerPage);
        } catch (Exception e) {
            String msg = "Failed to get all tenants usages.";
            log.error(msg, e);
            throw new UIException(msg, e);
        }
View Full Code Here

Examples of org.wso2.carbon.usage.ui.clients.UsageServiceClient

    }

    public static TenantUsage retrieveTenantUsage(ServletRequest request,
                                                  ServletConfig config, HttpSession session) throws Exception {
        try {
            UsageServiceClient serviceClient = new UsageServiceClient(config, session);
            String yearMonth = request.getParameter("year-month");
            if (yearMonth == null) {
                // get the current year month
                yearMonth = getCurrentYearMonth();
            }
            String tenantIdStr = request.getParameter("tenant-id");
            if (tenantIdStr == null) {
                tenantIdStr = "0";
            }
            return serviceClient.retrieveTenantUsage(yearMonth, Integer.parseInt(tenantIdStr));
        } catch (Exception e) {
            String msg = "Failed to get tenant usages.";
            log.error(msg, e);
            throw new UIException(msg, e);
        }
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.