KEY - ENTRY - MAP - REGISTRY - public class FileSynchronizedRegistryImpl<KEY,ENTRY extends Identifiable<KEY>,MAP extends Map<KEY,ENTRY>,REGISTRY extends FileSynchronizedRegistry<KEY,ENTRY>> extends AbstractRegistry<KEY,ENTRY,MAP,REGISTRY,FileRegistryPlugin<KEY,ENTRY,REGISTRY>> implements FileSynchronizedRegistry<KEY,ENTRY>
| Modifier and Type | Class and Description |
|---|---|
static class |
FileSynchronizedRegistryImpl.DatabaseState |
Shutdownable.ShutdownDeamonconsistent, logger, pluginPool, sandboxlatestValueHash, observers, unchangedValueFilterTYPE_FIELD_NAME| Constructor and Description |
|---|
FileSynchronizedRegistryImpl(MAP entryMap,
File databaseDirectory,
FileProcessor<ENTRY> fileProcessor,
FileProvider<Identifiable<KEY>> fileProvider) |
FileSynchronizedRegistryImpl(MAP entryMap,
File databaseDirectory,
FileProcessor<ENTRY> fileProcessor,
FileProvider<Identifiable<KEY>> fileProvider,
FileRegistryPluginPool<KEY,ENTRY,FileRegistryPlugin<KEY,ENTRY,REGISTRY>,REGISTRY> filePluginPool) |
| Modifier and Type | Method and Description |
|---|---|
void |
activateVersionControl(String entryType,
Package converterPackage)
This method activates the version control unit of the underlying registry
db.
|
protected void |
afterConsistencyCheck()
Can be overwritten for further registry actions scheduled after consistency checks.
|
void |
checkWriteAccess() |
void |
clear() |
File |
getDatabaseDirectory() |
String |
getDatabaseName() |
FileSynchronizedRegistryImpl.DatabaseState |
getDatabaseState() |
Integer |
getDBVersion() |
boolean |
isConsistent() |
boolean |
isOutdated() |
void |
loadRegistry() |
ENTRY |
register(ENTRY entry)
Method registers the given entry.
|
ENTRY |
remove(ENTRY entry) |
void |
saveRegistry() |
void |
shutdown() |
ENTRY |
update(ENTRY entry) |
addDependencyObserver, checkConsistency, contains, contains, finishTransaction, get, getEntries, getEntryMap, getEntryMapClass, getName, info, isBusy, isBusyByCurrentThread, isDependingOnConsistentRegistries, isEmpty, isReadOnly, isReady, isSandbox, isWriteLockedByCurrentThread, load, lock, log, log, log, notifyObservers, recursiveTryLockRegistry, registerConsistencyHandler, registerDependency, registerPlugin, remove, removeAllDependencies, removeConsistencyHandler, removeDependency, removeDependencyObserver, replaceInternalMap, replaceInternalMap, setName, setupSandbox, size, superRemove, toString, tryLockRegistry, unlock, unlockRegistry, verifyID, verifyIDapplyValueUpdate, getValue, getValueFuture, isValueAvailable, waitForValueaddObserver, isNotificationInProgess, notifyObservers, notifyObservers, removeObserver, setExecutorService, setHashGenerator, waitUntilNotificationIsFinishedclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddDependencyObserver, contains, contains, get, get, getEntries, getEntryMap, getName, isEmpty, isEmtpy, isReadOnly, isReady, isSandbox, recursiveTryLockRegistry, remove, removeDependencyObserver, size, tryLockRegistry, unlockRegistryisWritableaddObserver, getLatestValue, getValue, getValueFuture, isValueAvailable, removeObserver, waitForValue, waitForValueregisterShutdownHook, registerShutdownHookpublic FileSynchronizedRegistryImpl(MAP entryMap, File databaseDirectory, FileProcessor<ENTRY> fileProcessor, FileProvider<Identifiable<KEY>> fileProvider) throws InstantiationException, InterruptedException
public FileSynchronizedRegistryImpl(MAP entryMap, File databaseDirectory, FileProcessor<ENTRY> fileProcessor, FileProvider<Identifiable<KEY>> fileProvider, FileRegistryPluginPool<KEY,ENTRY,FileRegistryPlugin<KEY,ENTRY,REGISTRY>,REGISTRY> filePluginPool) throws InstantiationException, InterruptedException
public String getDatabaseName()
public void activateVersionControl(String entryType, Package converterPackage) throws CouldNotPerformException
Activate version control before loading the registry. Please provide within the converter package only converter with the naming structure [$(EntryType)_$(VersionN)_To_$(VersionN+1)_DBConverter].
Example:
converter package myproject.db.converter containing the converter pipeline
myproject.db.converter.DeviceConfig_0_To_1_DBConverter.class myproject.db.converter.DeviceConfig_1_To_2_DBConverter.class myproject.db.converter.DeviceConfig_2_To_3_DBConverter.class
Would support the db upgrade from version 0 till the latest db version 3.
entryType - converterPackage - the package containing all converter which
provides db entry updates from the first to the latest db version.CouldNotPerformException - in case of an invalid converter pipeline
or initialization issues.public ENTRY register(ENTRY entry) throws CouldNotPerformException
AbstractRegistryregister in interface Registry<KEY,ENTRY extends Identifiable<KEY>>register in class AbstractRegistry<KEY,ENTRY extends Identifiable<KEY>,MAP extends Map<KEY,ENTRY>,REGISTRY extends FileSynchronizedRegistry<KEY,ENTRY>,FileRegistryPlugin<KEY,ENTRY extends Identifiable<KEY>,REGISTRY extends FileSynchronizedRegistry<KEY,ENTRY>>>entry - the new entry to register which is not yet included in the registryCouldNotPerformException - is thrown if the given entry is not valid, already registered or something else went wrong during the registration.public ENTRY update(ENTRY entry) throws CouldNotPerformException
AbstractRegistryupdate in interface Registry<KEY,ENTRY extends Identifiable<KEY>>update in class AbstractRegistry<KEY,ENTRY extends Identifiable<KEY>,MAP extends Map<KEY,ENTRY>,REGISTRY extends FileSynchronizedRegistry<KEY,ENTRY>,FileRegistryPlugin<KEY,ENTRY extends Identifiable<KEY>,REGISTRY extends FileSynchronizedRegistry<KEY,ENTRY>>>entry - CouldNotPerformExceptionpublic ENTRY remove(ENTRY entry) throws CouldNotPerformException
AbstractRegistryremove in interface Registry<KEY,ENTRY extends Identifiable<KEY>>remove in class AbstractRegistry<KEY,ENTRY extends Identifiable<KEY>,MAP extends Map<KEY,ENTRY>,REGISTRY extends FileSynchronizedRegistry<KEY,ENTRY>,FileRegistryPlugin<KEY,ENTRY extends Identifiable<KEY>,REGISTRY extends FileSynchronizedRegistry<KEY,ENTRY>>>entry - CouldNotPerformExceptionpublic void clear()
throws CouldNotPerformException
AbstractRegistryclear in interface Registry<KEY,ENTRY extends Identifiable<KEY>>clear in class AbstractRegistry<KEY,ENTRY extends Identifiable<KEY>,MAP extends Map<KEY,ENTRY>,REGISTRY extends FileSynchronizedRegistry<KEY,ENTRY>,FileRegistryPlugin<KEY,ENTRY extends Identifiable<KEY>,REGISTRY extends FileSynchronizedRegistry<KEY,ENTRY>>>CouldNotPerformExceptionprotected void afterConsistencyCheck()
throws CouldNotPerformException
AbstractRegistryDon't forgett to pass-througt the call to the super class. (super.afterConsistencyCheck())
afterConsistencyCheck in class AbstractRegistry<KEY,ENTRY extends Identifiable<KEY>,MAP extends Map<KEY,ENTRY>,REGISTRY extends FileSynchronizedRegistry<KEY,ENTRY>,FileRegistryPlugin<KEY,ENTRY extends Identifiable<KEY>,REGISTRY extends FileSynchronizedRegistry<KEY,ENTRY>>>CouldNotPerformException - is thrown if any plugin afterConsistencyCheck fails.public void loadRegistry()
throws CouldNotPerformException
loadRegistry in interface FileSynchronizedRegistry<KEY,ENTRY extends Identifiable<KEY>>CouldNotPerformExceptionpublic void saveRegistry()
throws MultiException
saveRegistry in interface FileSynchronizedRegistry<KEY,ENTRY extends Identifiable<KEY>>MultiExceptionpublic void checkWriteAccess()
throws RejectedException
AbstractRegistrycheckWriteAccess in interface WritablecheckWriteAccess in class AbstractRegistry<KEY,ENTRY extends Identifiable<KEY>,MAP extends Map<KEY,ENTRY>,REGISTRY extends FileSynchronizedRegistry<KEY,ENTRY>,FileRegistryPlugin<KEY,ENTRY extends Identifiable<KEY>,REGISTRY extends FileSynchronizedRegistry<KEY,ENTRY>>>RejectedExceptionpublic void shutdown()
AbstractRegistryshutdown in interface Shutdownableshutdown in class AbstractRegistry<KEY,ENTRY extends Identifiable<KEY>,MAP extends Map<KEY,ENTRY>,REGISTRY extends FileSynchronizedRegistry<KEY,ENTRY>,FileRegistryPlugin<KEY,ENTRY extends Identifiable<KEY>,REGISTRY extends FileSynchronizedRegistry<KEY,ENTRY>>>public File getDatabaseDirectory()
getDatabaseDirectory in interface FileSynchronizedRegistry<KEY,ENTRY extends Identifiable<KEY>>public Integer getDBVersion()
getDBVersion in interface FileSynchronizedRegistry<KEY,ENTRY extends Identifiable<KEY>>public boolean isConsistent()
AbstractRegistryisConsistent in interface Registry<KEY,ENTRY extends Identifiable<KEY>>isConsistent in class AbstractRegistry<KEY,ENTRY extends Identifiable<KEY>,MAP extends Map<KEY,ENTRY>,REGISTRY extends FileSynchronizedRegistry<KEY,ENTRY>,FileRegistryPlugin<KEY,ENTRY extends Identifiable<KEY>,REGISTRY extends FileSynchronizedRegistry<KEY,ENTRY>>>public boolean isOutdated()
public FileSynchronizedRegistryImpl.DatabaseState getDatabaseState()
Copyright © 2015–2018 openbase.org. All rights reserved.