public final void createAllCRIndexJobs() {
//use ConcurrentSkipListMap for alphabetical ordered IndexJob Creation
ConcurrentSkipListMap<String, CRConfigUtil> configs = new ConcurrentSkipListMap<String, CRConfigUtil>(getCRMap());
for (Entry<String, CRConfigUtil> e : configs.entrySet()) {
CRConfigUtil indexJobConfiguration = e.getValue();
String partName = indexJobConfiguration.getName();
AbstractUpdateCheckerJob currentJob = queue.getCurrentJob();
int partInterval = getInterval(partName);
boolean createJob = true;
if (currentJob != null && currentJob.identifyer.equals(partName)) {
log.debug("skipping creation of " + partName + " because its already running.");
createJob = false;
} else if (partInterval != -1) {
long now = new Date().getTime();
if (indexJobCreationTimes.containsKey(partName)) {
long lastRun = indexJobCreationTimes.get(partName).getTime();
long intervalMilliseconds = (partInterval * Constants.MILLISECONDS_IN_A_SECOND);
if (now - lastRun < intervalMilliseconds) {
createJob = false;
}
}
}
if (createJob) {
createCRIndexJob(new CRConfigUtil(indexJobConfiguration, partName), new ConcurrentHashMap<String, CRConfigUtil>(configs));
}
}
}