public class MemoryBackedHistorian extends java.lang.Object implements Historian, StorageSession
| Modifier and Type | Class and Description |
|---|---|
protected class |
MemoryBackedHistorian.Tag |
QUALITY_NOT_FOUND| Constructor and Description |
|---|
MemoryBackedHistorian() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addNode(MemoryBackedHistorian.Tag node) |
java.util.List<java.lang.String> |
browse(java.util.Optional<java.lang.String> filter)
Returns a list of paths with data stored, optionally matching a filter.
|
void |
close() |
StorageSession |
createStorageSession()
Used to store values to the historian.
|
void |
delete(java.util.List<java.lang.String> paths)
Deletes the tags and all data for the specified paths.
|
<T> T |
getProperty(Property<T> prop)
Returns the configured or status property requested,
or the default value if no further info is available.
|
Status |
getQueryStatus()
Returns the status of the storage system.
|
Status |
getStorageStatus()
Returns the status of the storage system.
|
java.lang.Long |
getTotalDataCount() |
void |
initialize(PropertySet properties) |
protected void |
performTimePruning(boolean force) |
QueryResult |
query(java.util.List<java.lang.String> tags,
long startTime,
long endTime,
boolean includeBounding)
Queries the values for the given paths over the specified span of time.
|
void |
register(java.lang.String tag,
PropertySet properties)
Provides information about a path.
|
void |
shutdown() |
void |
store(java.lang.String tag,
java.lang.Object value,
int quality,
long timestamp)
Stores a value for the given tag path.
|
public void initialize(PropertySet properties) throws java.lang.Exception
initialize in interface Historianjava.lang.Exceptionpublic <T> T getProperty(Property<T> prop)
HistoriangetProperty in interface Historianpublic java.lang.Long getTotalDataCount()
public void register(java.lang.String tag,
PropertySet properties)
Historianpublic void store(java.lang.String tag,
java.lang.Object value,
int quality,
long timestamp)
throws java.lang.Exception
StorageSessionstore in interface StorageSessionjava.lang.Exceptionprotected void performTimePruning(boolean force)
public java.util.List<java.lang.String> browse(java.util.Optional<java.lang.String> filter)
Historianpublic void delete(java.util.List<java.lang.String> paths)
Historianpublic QueryResult query(java.util.List<java.lang.String> tags, long startTime, long endTime, boolean includeBounding)
Historianprotected void addNode(MemoryBackedHistorian.Tag node)
public Status getStorageStatus()
HistoriangetStorageStatus in interface Historianpublic Status getQueryStatus()
HistoriangetQueryStatus in interface Historianpublic StorageSession createStorageSession()
Historian
It implements AutoClosable, and should often be used in a try-with-resources block, such as:
try(StorageSession s = historian.createStorageSession()){
s.store...
}
Important: Not every historian will support storage, some are read-only. This can be checked by calling getStorageStatus() and checking the return for "NotSupported".
createStorageSession in interface Historianpublic void close()
throws java.io.IOException
close in interface java.lang.AutoCloseablejava.io.IOException