Examples of TenantUsageRetriever


Examples of org.apache.stratos.usage.api.TenantUsageRetriever

    @Override
    public void invoke(ThrottlingDataContext dataContext) throws ThrottlingException {
        int tenantId = dataContext.getTenantId();
        String userName = dataContext.getUserName();
        String yearMonth = Util.getCurrentMonthString(Calendar.getInstance());
        TenantUsageRetriever tenantUsageRetriever = Util.getTenantUsageRetriever();
       
        try {
            TenantUsage usage = tenantUsageRetriever.getTenantUsage(tenantId, yearMonth);
           
            //Bandwidth usages
            long tenantIncomingBandwidth = usage.getTotalIncomingBandwidth();
            long tenantOutgoingBandwidth = usage.getTotalOutgoingBandwidth();
            dataContext.addDataLong(ThrottlingDataEntryConstants.TENANT_INCOMING_BANDWIDTH,
View Full Code Here

Examples of org.apache.stratos.usage.api.TenantUsageRetriever

    public static void registerRetrieverServices(BundleContext bundleContext) throws Exception {
        ConfigurationContextService confCtxSvc = Util.getConfigurationContextService();

        // creating and registering tenant and user usage retrievers
        tenantUsageRetriever = new TenantUsageRetriever(
                registryService, confCtxSvc.getServerConfigContext());
        bundleContext.registerService(
                TenantUsageRetriever.class.getName(), tenantUsageRetriever, null);
    }
View Full Code Here

Examples of org.wso2.carbon.usage.api.TenantUsageRetriever

    @Override
    public void invoke(ThrottlingDataContext dataContext) throws ThrottlingException {
        int tenantId = dataContext.getTenantId();
        String userName = dataContext.getUserName();
        String yearMonth = Util.getCurrentMonthString(Calendar.getInstance());
        TenantUsageRetriever tenantUsageRetriever = Util.getTenantUsageRetriever();
       
        try {
            TenantUsage usage = tenantUsageRetriever.getTenantUsage(tenantId, yearMonth);
           
            //Bandwidth usages
            long tenantIncomingBandwidth = usage.getTotalIncomingBandwidth();
            long tenantOutgoingBandwidth = usage.getTotalOutgoingBandwidth();
            dataContext.addDataLong(ThrottlingDataEntryConstants.TENANT_INCOMING_BANDWIDTH,
View Full Code Here

Examples of org.wso2.carbon.usage.api.TenantUsageRetriever

    public static void registerRetrieverServices(BundleContext bundleContext) throws Exception {
        ConfigurationContextService confCtxSvc = Util.getConfigurationContextService();

        // creating and registering tenant and user usage retrievers
        tenantUsageRetriever = new TenantUsageRetriever(
                registryService, confCtxSvc.getClientConfigContext());
        bundleContext.registerService(
                TenantUsageRetriever.class.getName(), tenantUsageRetriever, null);
    }
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.