| Modifier and Type | Class and Description |
|---|---|
protected class |
SQLiteHistorian.DBLockClosable |
protected class |
SQLiteHistorian.Query |
protected class |
SQLiteHistorian.SQLiteStorageSession |
protected static class |
SQLiteHistorian.Tables |
protected static class |
SQLiteHistorian.Tag |
QUALITY_NOT_FOUND| Constructor and Description |
|---|
SQLiteHistorian() |
SQLiteHistorian(java.time.Clock clock) |
SQLiteHistorian(java.time.Clock clock,
java.lang.String filePath) |
| Modifier and Type | Method and Description |
|---|---|
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.
|
StorageSession |
createStorageSession()
Used to store values to the historian.
|
protected SQLiteHistorian.Tag |
createTag(java.lang.String tagPath) |
void |
delete(java.util.List<java.lang.String> paths)
Deletes the tags and all data for the specified paths.
|
void |
executeMaintenance() |
protected java.sql.Connection |
getConnection() |
<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.
|
protected int |
getStorageSyncId(java.lang.String tagPath,
long timestamp) |
int |
getSyncableData(long syncId)
Returns the number of data points that could be synchronized from the given point.
|
long |
getSyncIdTimestamp(long syncId)
Returns the timestamp of the start of the sync group.
|
protected long |
getTotalDataCount() |
boolean |
hasSyncableData(long syncId)
Returns whether there is data available to sync based on the provided id.
|
void |
initDriver() |
void |
initialize(PropertySet properties) |
protected void |
initializeSync() |
protected SQLiteHistorian.DBLockClosable |
lockDB() |
protected void |
newSyncId() |
protected boolean |
propertiesDiffer(PropertySet a,
PropertySet b) |
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 tagPath,
PropertySet properties)
Provides information about a path.
|
protected static java.lang.Object |
runPrepScalarQuery(java.sql.Connection c,
java.lang.String query,
java.lang.Object... args) |
protected static int |
runPrepUpdateQuery(java.sql.Connection c,
java.lang.String query,
java.lang.Object... args) |
protected static java.lang.Object |
runScalarQuery(java.sql.Connection c,
java.lang.String query) |
protected static int |
runUpdateQuery(java.sql.Connection c,
java.lang.String query) |
void |
shutdown() |
SyncQueryResults |
sync(long syncId)
This returns a set of data- it's up to the implementation to decide what makes sense.
|
public SQLiteHistorian()
public SQLiteHistorian(java.time.Clock clock)
public SQLiteHistorian(java.time.Clock clock,
java.lang.String filePath)
public <T> T getProperty(Property<T> prop)
HistoriangetProperty in interface Historianprotected SQLiteHistorian.DBLockClosable lockDB()
protected long getTotalDataCount()
public Status getQueryStatus()
HistoriangetQueryStatus in interface Historianpublic Status getStorageStatus()
HistoriangetStorageStatus in interface Historianprotected java.sql.Connection getConnection()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void initDriver()
throws java.lang.Exception
java.lang.Exceptionpublic void initialize(PropertySet properties) throws java.lang.Exception
initialize in interface Historianjava.lang.Exceptionprotected boolean propertiesDiffer(PropertySet a, PropertySet b)
public void register(java.lang.String tagPath,
PropertySet properties)
throws java.lang.Exception
Historianprotected SQLiteHistorian.Tag createTag(java.lang.String tagPath) throws java.lang.Exception
java.lang.Exceptionpublic StorageSession createStorageSession() throws java.lang.Exception
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 Historianjava.lang.Exceptionpublic 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)
Historianpublic void executeMaintenance()
protected static int runUpdateQuery(java.sql.Connection c,
java.lang.String query)
throws java.sql.SQLException
java.sql.SQLExceptionprotected static int runPrepUpdateQuery(java.sql.Connection c,
java.lang.String query,
java.lang.Object... args)
throws java.sql.SQLException
java.sql.SQLExceptionprotected static java.lang.Object runScalarQuery(java.sql.Connection c,
java.lang.String query)
throws java.sql.SQLException
java.sql.SQLExceptionprotected static java.lang.Object runPrepScalarQuery(java.sql.Connection c,
java.lang.String query,
java.lang.Object... args)
throws java.sql.SQLException
java.sql.SQLExceptionprotected void initializeSync()
throws java.lang.Exception
java.lang.Exceptionpublic boolean hasSyncableData(long syncId)
SyncablehasSyncableData in interface Syncablepublic SyncQueryResults sync(long syncId)
Syncableprotected void newSyncId()
protected int getStorageSyncId(java.lang.String tagPath,
long timestamp)
public int getSyncableData(long syncId)
SyncablegetSyncableData in interface Syncablepublic long getSyncIdTimestamp(long syncId)
SyncablegetSyncIdTimestamp in interface Syncable