Examples of BAMArchiverDSClient


Examples of org.wso2.carbon.bam.core.clients.BAMArchiverDSClient

        if (log.isDebugEnabled()) {
            log.debug("[" + this.getClass().getSimpleName() + " | " + getTimeString() + "] " + "Time Now:"
                      + BAMCalendar.getInstance(nowTime).getBAMTimestamp());
        }

        BAMArchiverDSClient client = BAMUtil.getArchiverDSClient();

        Calendar lastTime = client.getLatestArchiveTimeStamp();
        if (lastTime == null) {
            lastTime = createEpochCalendar();
        }

        //Calendar zeroLastTime = getCalendarWithZeroTimeFields(lastTime);

        if (log.isDebugEnabled()) {
            log.debug("[" + this.getClass().getSimpleName() + " | " + getTimeString() + "] " + "Archive last ran at:"
                      + BAMCalendar.getInstance(lastTime).getBAMTimestamp());
        }

        TimeRange archival = BAMPersistenceManager.getPersistenceManager(BAMUtil.getRegistry()).getDataArchivalPeriod();

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

            nowTime.add(archival.getType(), -1 * archival.getValue());
            lastTime.add(archival.getType(), -1 * archival.getValue());

            MessageDataDO[] datas = client.getMessageArchiveData(lastTime, nowTime);

            for (MessageDataDO data : datas) {
              //  client.archiveMessageData(data);
            }

            client.removePrimaryMessageData(lastTime, nowTime);

        }

    }
View Full Code Here

Examples of org.wso2.carbon.bam.core.clients.BAMArchiverDSClient

        return new BAMDataCollectionDSClient(BAMConstants.LOCAL_TRANSPORT,
                                             getConfigurationContextService().getClientConfigContext());
    }

    public static BAMArchiverDSClient getArchiverDSClient() throws BAMException {
        return new BAMArchiverDSClient(BAMConstants.LOCAL_TRANSPORT,
                                       getConfigurationContextService().getClientConfigContext());
    }
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.