/**
* Performs the extraction process.
*/
private void extractCommand() {
Configuration configuration;
DatabaseTimeLoader timeLoader;
boolean fullHistory;
TimestampTracker timestampTracker;
TimestampTracker dataTimestampSetter;
long extractTime;
long maximumExtractTime;
long nextExtractTime;
configuration = getConfiguration();
timeLoader = new DatabaseTimeLoader(configuration.getDatabaseLoginCredentials());
fullHistory = configuration.getReadFullHistory();
timestampTracker = getTimestampTracker();
dataTimestampSetter = getDataTimestampSetter();
// Determine the last extraction time.
extractTime = timestampTracker.getTime().getTime();
while (true) {
Date intervalBegin;
Date intervalEnd;
IntervalExtractor extractor;
nextExtractTime = extractTime + configuration.getIntervalLength();
// Determine the maximum extraction time. It is the current time minus the lag length.
maximumExtractTime = timeLoader.getDatabaseTime().getTime() - configuration.getLagLength();
// Stop when the maximum extraction time is passed.
if (nextExtractTime > maximumExtractTime) {
break;
}