public class JsonConfiguration extends Object implements Destroyable, Producer<com.fasterxml.jackson.databind.node.ObjectNode>, FileSettingsConfiguration
| Constructor and Description |
|---|
JsonConfiguration() |
| Modifier and Type | Method and Description |
|---|---|
void |
delete()
Deletes the configuration file if it exists.
|
void |
destroy()
Destroys this configuration by executing any pending write.
|
com.fasterxml.jackson.databind.node.ObjectNode |
get()
Gets the (possibly empty) configuration JSON node.
|
Path |
getPath() |
void |
init()
Initializes this configuration by initializing a
Debouncer for writes and reading the configuration file. |
Lock |
readLock()
Gets the read lock for this configuration.
|
void |
refresh()
Refreshes the configuration from disk.
|
void |
scheduleWrite()
Schedule a write.
|
void |
set(com.fasterxml.jackson.databind.node.ObjectNode configuration)
Set the configuration
|
void |
setConfigLocationProvider(ConfigLocationProvider configLocationProvider)
Sets the configuration location provider.
|
void |
setFileName(String fileName)
Sets the file name of this configuration.
|
void |
setWriteTimeout(int writeTimeout)
Sets the time to wait for additional changes before the configuration is persisted.
|
String |
toString() |
Lock |
writeLock()
Gets the write lock for this configuration.
|
void |
writeNow()
Do not wait, but persist the settings right now.
|
public void init()
Debouncer for writes and reading the configuration file.public void refresh()
refresh in interface FileSettingsConfigurationpublic void destroy()
destroy in interface DestroyableDebouncer.finish()public void delete()
public com.fasterxml.jackson.databind.node.ObjectNode get()
get in interface Supplier<com.fasterxml.jackson.databind.node.ObjectNode>get in interface javax.inject.Provider<com.fasterxml.jackson.databind.node.ObjectNode>get in interface Producer<com.fasterxml.jackson.databind.node.ObjectNode>null)public void set(com.fasterxml.jackson.databind.node.ObjectNode configuration)
configuration - the configurationpublic void setWriteTimeout(int writeTimeout)
writeTimeout - the time out in millisecondspublic void setFileName(String fileName)
fileName - the file namepublic void setConfigLocationProvider(ConfigLocationProvider configLocationProvider)
configLocationProvider - the providerpublic Lock readLock()
public Lock writeLock()
public void scheduleWrite()
timeout if no further
writes are scheduled, else it will postponed until their are no further requests for timeout
milliseconds.Debouncer.call()public void writeNow()
public Path getPath()
getPath in interface FileSettingsConfigurationCopyright © 2015–2021 52North Initiative for Geospatial Open Source Software GmbH. All rights reserved.