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);
}
}