public synchronized void registerDataSetDef(DataSetDef newDef) { registerDataSetDef(newDef, "system", "register(" + newDef.getUUID() + ")"); }
public synchronized DataSetDef removeDataSetDef(String uuid) { return removeDataSetDef(uuid, "system", "remove(" + uuid + ")"); }
public synchronized void registerDataSetDef(DataSetDef newDef, String subjectId, String message) { // Register the new entry DataSetDefEntry oldEntry = _removeDataSetDef(newDef.getUUID()); dataSetDefMap.put(newDef.getUUID(), new DataSetDefEntry(newDef)); DataSetDefEntry newEntry = dataSetDefMap.get(newDef.getUUID()); // Notify the proper event if (oldEntry != null) { onDataSetDefModified(oldEntry.def, newDef); } else { onDataSetDefRegistered(newDef); } // Register the data set into the scheduler newEntry.schedule(); }
public synchronized DataSetDef removeDataSetDef(String uuid, String subjectId, String message) { DataSetDefEntry oldEntry = _removeDataSetDef(uuid); if (oldEntry == null) { return null; } // Notify about the removal onDataSetDefRemoved(oldEntry.def); return oldEntry.def; }
public void stale() { lastRefreshTime = System.currentTimeMillis(); onDataSetDefStale(def); }
public boolean isStale() { if (refreshInMillis == -1) { return false; } if (!def.isRefreshAlways()) { DataSetProvider provider = resolveProvider(def); return provider.isDataSetOutdated(def); } return System.currentTimeMillis() >= lastRefreshTime + refreshInMillis; }
public DataSetDefRegistry getDataSetDefRegistry() { if (dataSetDefRegistry == null) { dataSetDefRegistry = new DataSetDefRegistryImpl( checkNotNull(getDataSetProviderRegistry(), "DataSetProviderRegistry"), checkNotNull(getScheduler(), "Scheduler")); } return dataSetDefRegistry; }
saveCSVFile((CSVDataSetDef) def); super.registerDataSetDef(def, subjectId, message);
public DataSetDef removeDataSetDef(DataSetDef def, String subjectId, String message) { Path defPath = resolveNioPath(def); if (ioService.exists(defPath)) { if (subjectId == null || message == null) { ioService.startBatch(fileSystem); } else { ioService.startBatch(fileSystem, new CommentedOption(subjectId, message)); } try { ioService.deleteIfExists(defPath, StandardDeleteOption.NON_EMPTY_DIRECTORIES); // CSV specific if (def instanceof CSVDataSetDef) { deleteCSVFile((CSVDataSetDef) def); } } finally { ioService.endBatch(); } } return super.removeDataSetDef(def.getUUID(), subjectId, message); }
saveCSVFile((CSVDataSetDef) def); super.registerDataSetDef(def, subjectId, message);
public DataSetDef removeDataSetDef(DataSetDef def, String subjectId, String message) { Path defPath = resolveNioPath(def); if (ioService.exists(defPath)) { if (subjectId == null || message == null) { ioService.startBatch(fileSystem); } else { ioService.startBatch(fileSystem, new CommentedOption(subjectId, message)); } try { ioService.deleteIfExists(defPath, StandardDeleteOption.NON_EMPTY_DIRECTORIES); // CSV specific if (def instanceof CSVDataSetDef) { deleteCSVFile((CSVDataSetDef) def); } } finally { ioService.endBatch(); } } return super.removeDataSetDef(def.getUUID(), subjectId, message); }
defJson); super.registerDataSetDef(clone, subjectId, message);
defJson); super.registerDataSetDef(clone, subjectId, message);