D - data typepublic class FileSynchronizer<D>
extends org.openbase.jul.pattern.ObservableImpl<D>
| Modifier and Type | Class and Description |
|---|---|
static class |
FileSynchronizer.InitMode |
Shutdownable.ShutdownDeamon| Modifier and Type | Field and Description |
|---|---|
protected org.slf4j.Logger |
logger |
| Constructor and Description |
|---|
FileSynchronizer(D data,
File file,
FileSynchronizer.InitMode initMode,
FileProcessor<D> fileProcessor) |
FileSynchronizer(File file,
FileProcessor<D> fileProcessor)
Creates a new file with the given data and starts the synchronization.
|
| Modifier and Type | Method and Description |
|---|---|
void |
delete() |
D |
getData() |
File |
getFile() |
D |
load() |
File |
save() |
File |
save(D data) |
applyValueUpdate, getValue, getValueFuture, isValueAvailable, waitForValueaddObserver, isNotificationInProgess, notifyObservers, notifyObservers, removeObserver, setExecutorService, setHashGenerator, shutdown, toString, waitUntilNotificationIsFinishedclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitregisterShutdownHook, registerShutdownHookpublic FileSynchronizer(File file, FileProcessor<D> fileProcessor) throws InstantiationException
file - fileProcessor - InstantiationExceptionpublic FileSynchronizer(D data, File file, FileSynchronizer.InitMode initMode, FileProcessor<D> fileProcessor) throws InstantiationException
InstantiationExceptionpublic final D load() throws CouldNotPerformException
CouldNotPerformExceptionpublic final File save(D data) throws CouldNotPerformException
CouldNotPerformExceptionpublic final File save() throws CouldNotPerformException
CouldNotPerformExceptionpublic void delete()
throws CouldNotPerformException
CouldNotPerformExceptionpublic D getData() throws NotAvailableException
NotAvailableExceptionpublic File getFile()
Copyright © 2015–2018 openbase.org. All rights reserved.