Source:
<code>public void onTimer(String serverId, String volumeId, String snapshotNamePrefix, String description, boolean force) { final GlusterVolumeEntity volume = getGlusterVolumeDao().getById(new Guid(volumeId)); if (volume == null) { log.error("Error while creating volume snapshot. Volume is null."); return; } final GlusterVolumeSnapshotEntity snapshot = new GlusterVolumeSnapshotEntity(); snapshot.setClusterId(volume.getClusterId()); snapshot.setVolumeId(volume.getId()); snapshot.setSnapshotName(snapshotNamePrefix); snapshot.setDescription(description); VdcReturnValueBase returnValue = getBackend().runInternalAction(VdcActionType.CreateGlusterVolumeSnapshot, new CreateGlusterVolumeSnapshotParameters(snapshot, force)); if (!returnValue.getSucceeded()) { log.error("Error while creating snapshot for volume '{}': {}", volume.getName(), returnValue.getExecuteFailedMessages().toString()); logUtil.logAuditMessage(volume.getClusterId(), volume, null, AuditLogType.GLUSTER_VOLUME_SNAPSHOT_CREATE_FAILED, new HashMap<String, String>() { { put(GlusterConstants.VOLUME_SNAPSHOT_NAME, snapshot.getSnapshotName()); put(GlusterConstants.VOLUME_NAME, volume.getName()); } }); } GlusterVolumeSnapshotSchedule schedule = getGlusterVolumeSnapshotScheduleDao().getByVolumeId(volume.getId()); Date endDate = GlusterUtil.getInstance().convertDate(schedule.getEndByDate(), schedule.getTimeZone()); if <START> (endDate.compareTo(new <END> Date()) < 0) { getGlusterVolumeSnapshotScheduleDao().removeByVolumeId(volume.getId()); logUtil.logAuditMessage(volume.getClusterId(), volume, null, AuditLogType.GLUSTER_VOLUME_SNAPSHOT_SCHEDULE_DELETED, new HashMap<String, String>() { { put(GlusterConstants.VOLUME_NAME, volume.getName()); } }); } }</code><technical_language>endDate.before</technical_language>

Target:
public void onTimer(String serverId, String volumeId, String snapshotNamePrefix, String description, boolean force) { final GlusterVolumeEntity volume = getGlusterVolumeDao().getById(new Guid(volumeId)); if (volume == null) { log.error("Error while creating volume snapshot. Volume is null."); return; } final GlusterVolumeSnapshotEntity snapshot = new GlusterVolumeSnapshotEntity(); snapshot.setClusterId(volume.getClusterId()); snapshot.setVolumeId(volume.getId()); snapshot.setSnapshotName(snapshotNamePrefix); snapshot.setDescription(description); VdcReturnValueBase returnValue = getBackend().runInternalAction(VdcActionType.CreateGlusterVolumeSnapshot, new CreateGlusterVolumeSnapshotParameters(snapshot, force)); if (!returnValue.getSucceeded()) { log.error("Error while creating snapshot for volume '{}': {}", volume.getName(), returnValue.getExecuteFailedMessages().toString()); logUtil.logAuditMessage(volume.getClusterId(), volume, null, AuditLogType.GLUSTER_VOLUME_SNAPSHOT_CREATE_FAILED, new HashMap<String, String>() { { put(GlusterConstants.VOLUME_SNAPSHOT_NAME, snapshot.getSnapshotName()); put(GlusterConstants.VOLUME_NAME, volume.getName()); } }); } GlusterVolumeSnapshotSchedule schedule = getGlusterVolumeSnapshotScheduleDao().getByVolumeId(volume.getId()); Date endDate = GlusterUtil.getInstance().convertDate(schedule.getEndByDate(), schedule.getTimeZone()); if (endDate.before(new Date())) { getGlusterVolumeSnapshotScheduleDao().removeByVolumeId(volume.getId()); logUtil.logAuditMessage(volume.getClusterId(), volume, null, AuditLogType.GLUSTER_VOLUME_SNAPSHOT_SCHEDULE_DELETED, new HashMap<String, String>() { { put(GlusterConstants.VOLUME_NAME, volume.getName()); } }); } }