Package org.wso2.carbon.bam.core.summary

Examples of org.wso2.carbon.bam.core.summary.SummaryPersistenceManager


        }
    }

    protected void summarizeYearly(BAMCalendar loYear, BAMCalendar hiYear) {
        try {
            SummaryPersistenceManager spm = SummaryPersistenceManager.getInstance();

            YearDimension qd = spm.getYearDimension(loYear);
            if (qd == null) {
                spm.addYearDimension(loYear);
                qd = spm.getYearDimension(loYear);
            }

            SummaryStatistic stat = spm.getOperationStatYearlySummary(this.getOperation().getOperationID(), loYear, hiYear);
            if (stat != null) {
                stat.setTypeId(this.getOperation().getOperationID());
                stat.setTimeDimensionId(qd.getId());
                SummaryPersistenceManager.getInstance().addOperationStatYearlySummary(stat);
            }
View Full Code Here


        this.setServer(server);
    }

    protected void summarizeHourly(BAMCalendar loHour, BAMCalendar hiHour) {
        try {
            SummaryPersistenceManager spm = SummaryPersistenceManager.getInstance();

            HourDimension hd = spm.getHourDimension(loHour);
            if (hd == null) {
                spm.addHourDimension(loHour);
                hd = spm.getHourDimension(loHour);
            }

            //TODO: flag
            MediationSummaryStatistic stat = spm.getProxyServiceStatHourlySummary(getServer().getId(),
                    getProxyService().getName(), getProxyService().getDirection(), loHour, hiHour);
            stat.setName(getProxyService().getName());
            stat.setTimeDimensionId(hd.getId());
            stat.setServerId(getServer().getId());
            stat.setDirection(getProxyService().getDirection());

            SummaryPersistenceManager.getInstance().addProxyServiceStatHourlySummary(stat);

            TimeRange retention = BAMPersistenceManager.getPersistenceManager(BAMUtil.getRegistry()).getDataRetentionPeriod();

            // do not delete anything if the retention period specified is 0.
            if (retention.getValue() != 0) {

                BAMCalendar delLoHour = BAMCalendar.getInstance(loHour);
                BAMCalendar delHiHour = BAMCalendar.getInstance(hiHour);

                delHiHour.add(retention.getType(), -1 * retention.getValue());
                delLoHour.add(retention.getType(), -1 * retention.getValue());


                spm.deleteServerProxyServiceUserData(getServer().getId(),
                        getProxyService().getName(), getProxyService().getDirection(), delLoHour, delHiHour);
            }
        } catch (BAMException e) {
            if (log.isErrorEnabled()) {
                log.error("Error while running hourly summary generator for proxyService: " + getProxyService()
View Full Code Here

    }


    protected void summarizeDaily(BAMCalendar loDay, BAMCalendar hiDay) {
        try {
            SummaryPersistenceManager spm = SummaryPersistenceManager.getInstance();

            DayDimension dd = spm.getDayDimension(loDay);
            if (dd == null) {
                spm.addDayDimension(loDay);
                dd = spm.getDayDimension(loDay);
            }

            MediationSummaryStatistic stat = spm.getProxyServiceStatDailySummary(getServer().getId(),
                    getProxyService().getName(), getProxyService().getDirection(), loDay, hiDay);
            stat.setName(getProxyService().getName());
            stat.setTimeDimensionId(dd.getId());
            stat.setServerId(getServer().getId());
            stat.setDirection(getProxyService().getDirection());
View Full Code Here

        }
    }

    protected void summarizeMonthly(BAMCalendar loMonth, BAMCalendar hiMonth) {
        try {
            SummaryPersistenceManager spm = SummaryPersistenceManager.getInstance();

            MonthDimension md = spm.getMonthDimension(loMonth);
            if (md == null) {
                spm.addMonthDimension(loMonth);
                md = spm.getMonthDimension(loMonth);
            }

            MediationSummaryStatistic stat = spm.getProxyServiceStatMonthlySummary(getServer().getId(),
                    getProxyService().getName(), getProxyService().getDirection(), loMonth, hiMonth);
            stat.setName(getProxyService().getName());
            stat.setTimeDimensionId(md.getId());
            stat.setServerId(getServer().getId());
            stat.setDirection(getProxyService().getDirection());
View Full Code Here

        }
    }

    protected void summarizeQuarterly(BAMCalendar loQuarter, BAMCalendar hiQuarter) {
        try {
            SummaryPersistenceManager spm = SummaryPersistenceManager.getInstance();

            QuarterDimension qd = spm.getQuarterDimension(loQuarter);
            if (qd == null) {
                spm.addQuarterDimension(loQuarter);
                qd = spm.getQuarterDimension(loQuarter);
            }

            MediationSummaryStatistic stat = spm.getProxyServiceStatQuarterlySummary(getServer().getId(),
                    getProxyService().getName(), getProxyService().getDirection(), loQuarter, hiQuarter);
            stat.setName(getProxyService().getName());
            stat.setTimeDimensionId(qd.getId());
            stat.setServerId(getServer().getId());
            stat.setDirection(getProxyService().getDirection());
View Full Code Here

        }
    }

    protected void summarizeYearly(BAMCalendar loYear, BAMCalendar hiYear) {
        try {
            SummaryPersistenceManager spm = SummaryPersistenceManager.getInstance();

            YearDimension qd = spm.getYearDimension(loYear);
            if (qd == null) {
                spm.addYearDimension(loYear);
                qd = spm.getYearDimension(loYear);
            }

            MediationSummaryStatistic stat = spm.getProxyServiceStatYearlySummary(getServer().getId(),
                    getProxyService().getName(), getProxyService().getDirection(), loYear, hiYear);
            stat.setName(getProxyService().getName());
            stat.setTimeDimensionId(qd.getId());
            stat.setServerId(getServer().getId());
            stat.setDirection(getProxyService().getDirection());
View Full Code Here

        this.setServer(server);
    }

    protected void summarizeHourly(BAMCalendar loHour, BAMCalendar hiHour) {
        try {
            SummaryPersistenceManager spm = SummaryPersistenceManager.getInstance();

            HourDimension hd = spm.getHourDimension(loHour);
            if (hd == null) {
                spm.addHourDimension(loHour);
                hd = spm.getHourDimension(loHour);
            }

            MediationSummaryStatistic stat = spm.getEndpointStatHourlySummary(getServer().getId(),
                    getEndpoint().getName(), getEndpoint().getDirection(), loHour, hiHour);
            stat.setName(getEndpoint().getName());
            stat.setTimeDimensionId(hd.getId());
            stat.setServerId(getServer().getId());
            stat.setDirection(getEndpoint().getDirection());

            SummaryPersistenceManager.getInstance().addEndpointStatHourlySummary(stat);

            TimeRange retention = BAMPersistenceManager.getPersistenceManager(BAMUtil.getRegistry()).getDataRetentionPeriod();

            // do not delete anything if the retention period specified is 0.
            if (retention.getValue() != 0) {

                BAMCalendar delLoHour = BAMCalendar.getInstance(loHour);
                BAMCalendar delHiHour = BAMCalendar.getInstance(hiHour);

                delHiHour.add(retention.getType(), -1 * retention.getValue());
                delLoHour.add(retention.getType(), -1 * retention.getValue());

                spm.deleteServerEndpointUserData(getServer().getId(),
                        getEndpoint().getName(), getEndpoint().getDirection(), delLoHour, delHiHour);
            }
        } catch (BAMException e) {
            if (log.isErrorEnabled()) {
                log.error("Error while running hourly summary generator for endpoint: " + getEndpoint()
View Full Code Here

    }


    protected void summarizeDaily(BAMCalendar loDay, BAMCalendar hiDay) {
        try {
            SummaryPersistenceManager spm = SummaryPersistenceManager.getInstance();

            DayDimension dd = spm.getDayDimension(loDay);
            if (dd == null) {
                spm.addDayDimension(loDay);
                dd = spm.getDayDimension(loDay);
            }

            MediationSummaryStatistic stat = spm.getEndpointStatDailySummary(getServer().getId(),
                    getEndpoint().getName(), getEndpoint().getDirection(), loDay, hiDay);
            stat.setName(getEndpoint().getName());
            stat.setTimeDimensionId(dd.getId());
            stat.setServerId(getServer().getId());
            stat.setDirection(getEndpoint().getDirection());
View Full Code Here

        }
    }

    protected void summarizeMonthly(BAMCalendar loMonth, BAMCalendar hiMonth) {
        try {
            SummaryPersistenceManager spm = SummaryPersistenceManager.getInstance();

            MonthDimension md = spm.getMonthDimension(loMonth);
            if (md == null) {
                spm.addMonthDimension(loMonth);
                md = spm.getMonthDimension(loMonth);
            }

            MediationSummaryStatistic stat = spm.getEndpointStatMonthlySummary(getServer().getId(),
                    getEndpoint().getName(), getEndpoint().getDirection(), loMonth, hiMonth);
            stat.setName(getEndpoint().getName());
            stat.setTimeDimensionId(md.getId());
            stat.setServerId(getServer().getId());
            stat.setDirection(getEndpoint().getDirection());
View Full Code Here

        }
    }

    protected void summarizeQuarterly(BAMCalendar loQuarter, BAMCalendar hiQuarter) {
        try {
            SummaryPersistenceManager spm = SummaryPersistenceManager.getInstance();

            QuarterDimension qd = spm.getQuarterDimension(loQuarter);
            if (qd == null) {
                spm.addQuarterDimension(loQuarter);
                qd = spm.getQuarterDimension(loQuarter);
            }

            MediationSummaryStatistic stat = spm.getEndpointStatQuarterlySummary(getServer().getId(),
                    getEndpoint().getName(), getEndpoint().getDirection(), loQuarter, hiQuarter);
            stat.setName(getEndpoint().getName());
            stat.setTimeDimensionId(qd.getId());
            stat.setServerId(getServer().getId());
            stat.setDirection(getEndpoint().getDirection());
View Full Code Here

TOP

Related Classes of org.wso2.carbon.bam.core.summary.SummaryPersistenceManager

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.