Package org.wso2.carbon.bam.util

Examples of org.wso2.carbon.bam.util.BAMCalendar


  public void addYearDimension(BAMCalendar startTime) throws BAMException {
        SummaryDimensionDSClient summaryDimension = null;
    try {
      summaryDimension = BAMUtil.getSummaryDimensionDSClient();
      BAMCalendar yearStartTime = BAMCalendar.getYear(startTime);
      summaryDimension.addYearDimension(yearStartTime);
    } catch (Exception e) {
      throw new BAMException("Adding year dimension failed: " + startTime.getBAMTimestamp(), e);
    } finally {
      if (summaryDimension != null) {
View Full Code Here


            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.deleteServiceData(getService().getId(), delLoHour, delHiHour);
            }
View Full Code Here

        BAMServiceSummaryDSClient serviceSummaryDSClient = null;
    try {
            serviceSummaryDSClient = BAMUtil.getBAMServiceSummaryDSClient();
            SummaryStatistic stat = serviceSummaryDSClient.getOperationStatHourlySummary(opId, startTime, endTime);

            BAMCalendar prevHourStartTime = BAMCalendar.getInstance(startTime);
            prevHourStartTime.add(BAMCalendar.HOUR_OF_DAY, -24);
            BAMCalendar prevHourEndTime = BAMCalendar.getInstance(endTime);
            prevHourEndTime.add(BAMCalendar.HOUR_OF_DAY, -1);

            SummaryStatistic maxStatThisHour = serviceSummaryDSClient.getOperationMaxCounts(opId, startTime, endTime);
            SummaryStatistic maxStatPrevHour = serviceSummaryDSClient.getOperationMaxCounts(opId, prevHourStartTime, prevHourEndTime);

            int val;
View Full Code Here

//      endpointString = createMediationKeyString(ENDPOINT, direction, FAULT_COUNT, endpoint);
//      ints = client.getMediationStatHourlySummaryInt(serverId, endpointString, startTime, endTime);
//      intVal = BAMMath.max(ints) - BAMMath.min(ints);
//      statistic.setFaultCount(intVal);

      BAMCalendar prevStartTime = BAMCalendar.getInstance(startTime);
      prevStartTime.add(BAMCalendar.HOUR, -24);
            BAMCalendar prevEndTime = BAMCalendar.getInstance(endTime);
            prevEndTime.add(BAMCalendar.HOUR, -1);

      endpointString = createMediationKeyString(ENDPOINT, direction, CUMULATIVE_COUNT, endpoint);
            intsThisHour = client.getDataForMediationMaxCount(serverId, endpointString, startTime, endTime);
            intsPrevHour = client.getDataForMediationMaxCount(serverId, endpointString, prevStartTime, prevEndTime);
View Full Code Here

//      proxyServiceString = PROXY_SERVICE + direction + FAULT_COUNT + "-" + proxyService;
//      ints = client.getMediationStatHourlySummaryInt(serverId, proxyServiceString, startTime, endTime);
//      intVal = BAMMath.max(ints) - BAMMath.min(ints);
//      statistic.setFaultCount(intVal);

      BAMCalendar prevStartTime = BAMCalendar.getInstance(startTime);
      prevStartTime.add(BAMCalendar.HOUR, -24);
            BAMCalendar prevEndTime = BAMCalendar.getInstance(endTime);
            prevEndTime.add(BAMCalendar.HOUR, -1);

            proxyServiceString = createMediationKeyString(PROXY_SERVICE, direction, CUMULATIVE_COUNT, proxyService);
            intsThisHour = client.getDataForMediationMaxCount(serverId, proxyServiceString, startTime, endTime);
            intsPrevHour = client.getDataForMediationMaxCount(serverId, proxyServiceString, prevStartTime, prevEndTime);
View Full Code Here

//      sequenceString = SEQUENCE + direction + FAULT_COUNT + "-" + sequence;
//      ints = client.getMediationStatHourlySummaryInt(serverId, sequenceString, startTime, endTime);
//      intVal = BAMMath.max(ints) - BAMMath.min(ints);
//      statistic.setFaultCount(intVal);

      BAMCalendar prevStartTime = BAMCalendar.getInstance(startTime);
      prevStartTime.add(BAMCalendar.HOUR, -24);
      BAMCalendar prevEndTime = BAMCalendar.getInstance(endTime);
            prevEndTime.add(BAMCalendar.HOUR, -1);

            sequenceString = createMediationKeyString(SEQUENCE, direction, CUMULATIVE_COUNT, sequence);
            intsThisHour = client.getDataForMediationMaxCount(serverId, sequenceString, startTime, endTime);
            intsPrevHour = client.getDataForMediationMaxCount(serverId, sequenceString, prevStartTime, prevEndTime);
View Full Code Here

            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.deleteServerSequenceUserData(getServer().getId(),
                        getSequence().getName(), getSequence().getDirection(), delLoHour, delHiHour);
View Full Code Here

            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.deleteServerData(getServer().getId(), delLoHour, delHiHour);
            }
View Full Code Here

            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.deleteOperationData(getOperation().getOperationID(), delLoHour, delHiHour);
            }
        } catch (BAMException e) {
View Full Code Here

            if (log.isDebugEnabled()) {
                log.debug("[" + this.getClass().getSimpleName() + " | " + getTimeString() + "] "
                        + "Generating summary for:" + BAMCalendar.getInstance(itrTime).getBAMTimestamp());
            }

            BAMCalendar loTime = BAMCalendar.getInstance(itrTime);
            BAMCalendar hiTime = (BAMCalendar) loTime.clone();
            addTime(hiTime, 1);

            summarize(loTime, hiTime);

            addTime(itrTime, 1);
View Full Code Here

TOP

Related Classes of org.wso2.carbon.bam.util.BAMCalendar

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.