Examples of DayDimension


Examples of org.wso2.carbon.bam.common.dataobjects.dimensions.DayDimension

        long regBandwidth = 0;
        long regHistoryBandwidth=0;
       
        try {
            SummaryPersistenceManager spm = SummaryPersistenceManager.getInstance();
            DayDimension dd = spm.getDayDimension(start);
            if (dd == null) {
                spm.addDayDimension(start);
                dd = spm.getDayDimension(start);
            }
           
            //Get the usages
            BandwidthUsage[] usages = client.getStub().getRegistryBandwidthUsage(tenant.getId());
            if((usages != null) && (usages[0] != null)){
                //We are sure there will be only one value
                regBandwidth = usages[0].getBandwidth();
                if(regBandwidth < 0){
                    //reg bandwidth should be not null, non-negative
                    regBandwidth = 0;
                }
            }
           
            usages = client.getStub().getRegistryHistoryBandwidthUsage(tenant.getId());
            if((usages != null) && (usages[0] != null)){
                //We are sure there will be only one value
                regHistoryBandwidth = usages[0].getBandwidth();
                if(regHistoryBandwidth < 0){
                    //reg history bandwidth should be not null, non-negative
                    regHistoryBandwidth = 0;
                }
            }
           
            //Write the summary
            client.getStub().addRegistryBandwidthUsageDailySummary(tenant.getId(), dd.getId(),
                    UsageConstants.REGISTRY_CONTENT_BANDWIDTH, regBandwidth, regHistoryBandwidth);
        } catch (Exception e) {
            String msg = "Unable to run Registry Usage daily summary for domain "
                    + tenant.getDomain();
            log.error(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.