/** * {@inheritDoc} */ @Override @SuppressWarnings("unchecked") public int compareTo(AbstractStorageLabel<?> other) { int typeCompare = storageLabelType.compareTo(other.getStorageLabelType()); if (0 != typeCompare) { return typeCompare; } else { if (!ObjectStorageLabel.class.isAssignableFrom(other.getClass())) { return super.compareTo(other); } else { ObjectStorageLabel<T> otherLabel = (ObjectStorageLabel<T>) other; return value.compareTo(otherLabel.getValue()); } } } }
/** * {@inheritDoc} */ @Override public synchronized void finalizeWrite() { try { writeAgentData(); writeBusinessContextData(); } catch (IOException e) { log.error("Exception trying to write agent data to disk.", e); } super.finalizeWrite(); if ((newestDataTimestamp.get() > 0) && (oldestDataTimestamp.get() < Long.MAX_VALUE)) { TimeFrame timeFrame = new TimeFrame(new Date(oldestDataTimestamp.get()), new Date(newestDataTimestamp.get())); ObjectStorageLabel<TimeFrame> timeframeLabel = new ObjectStorageLabel<>(timeFrame, new DataTimeFrameLabelType()); getStorageData().addLabel(timeframeLabel, true); } }