All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.viadee.camunda.kafka.pollingclient.service.lastpolled.PollingTimeslice Maven / Gradle / Ivy

package de.viadee.camunda.kafka.pollingclient.service.lastpolled;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Defines the time slice to perform polling for.
 *
 * The slice is defined by the interval to poll data starting with {@link #startTime} and ending with {@link #endTime}.
 * To prevent polling incomplete process data, an initial cutoff timestamp {@link #cutoffTime} is provided. All data
 * polled must be after this cutoff time. This means, a process started before this cutoff time, must not be polled at
 * all.
 *
 * Following rules apply:
 * 
    *
  1. {@link #cutoffTime} < {@link #startTime}
  2. *
  3. {@link #startTime} < {@link #endTime}
  4. *
  5. {@link #cutoffTime} is inclusive
  6. *
  7. {@link #startTime} is inclusive
  8. *
  9. {@link #endTime} is exclusive
  10. *
* * @author viadee * @version $Id: $Id */ public class PollingTimeslice { private final SimpleDateFormat timeFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); /** * First polling slice start. No data should be polled before this point. */ private final Date cutoffTime; /** * Start of polling slice */ private final Date startTime; /** * End of polling slice */ private final Date endTime; public PollingTimeslice(final Date cutoffTime, final Date startTime, final Date endTime) { this.cutoffTime = cutoffTime; this.startTime = startTime; this.endTime = endTime; } /** * First polling slice start. No data should be polled before this point. */ public Date getCutoffTime() { return this.cutoffTime; } /** * Start of polling slice */ public Date getStartTime() { return this.startTime; } /** * End of polling slice */ public Date getEndTime() { return this.endTime; } @Override public java.lang.String toString() { return "PollingTimeslice(cutoffTime=" + timeFormat.format(cutoffTime) + ", startTime=" + timeFormat .format(startTime) + ", endTime=" + timeFormat.format(endTime) + ")"; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy