public abstract class AbstractStorageImpl extends Object implements HistoricalItem, ValueSourceManager
Modifier and Type | Class and Description |
---|---|
protected static interface |
AbstractStorageImpl.QueryRunnable |
Modifier and Type | Field and Description |
---|---|
protected String |
id |
protected DataStoreAccesor |
nativeLevel |
protected Lock |
readLock |
protected ReadWriteLock |
rwLock |
protected Lock |
writeLock |
Constructor and Description |
---|
AbstractStorageImpl(File file,
DataFilePool pool,
ScheduledExecutorService queryExecutor,
ScheduledExecutorService eventExecutor) |
Modifier and Type | Method and Description |
---|---|
protected void |
addJob(FutureTask<Void> task) |
Query |
createQuery(QueryParameters parameters,
QueryListener listener,
boolean updateData)
Create a new query
|
void |
dispose() |
HistoricalItemInformation |
getInformation()
Get the item information
|
StorageInformation |
getStorageInformation() |
protected void |
handleStoreChanged(Date start,
Date end) |
protected void |
notifyData(double value,
Date timestamp,
boolean error,
boolean manual) |
void |
queryClosed(QueryImpl query) |
protected void |
removeJob(Future<Void> future) |
protected void |
runOnQuery(AbstractStorageImpl.QueryRunnable runnable) |
boolean |
visit(QueryParameters parameters,
ValueVisitor visitor)
Visit values
|
protected final String id
protected final DataStoreAccesor nativeLevel
protected final ReadWriteLock rwLock
protected final Lock writeLock
protected final Lock readLock
public AbstractStorageImpl(File file, DataFilePool pool, ScheduledExecutorService queryExecutor, ScheduledExecutorService eventExecutor) throws Exception
Exception
protected void addJob(FutureTask<Void> task)
public StorageInformation getStorageInformation()
public HistoricalItemInformation getInformation()
HistoricalItem
getInformation
in interface HistoricalItem
protected void runOnQuery(AbstractStorageImpl.QueryRunnable runnable)
protected void notifyData(double value, Date timestamp, boolean error, boolean manual)
public Query createQuery(QueryParameters parameters, QueryListener listener, boolean updateData)
HistoricalItem
createQuery
in interface HistoricalItem
parameters
- the initial query parameterslistener
- the query listenerupdateData
- if true
then additional updates will be made by
the query when
data changes although the query is QueryState.COMPLETE
null
if the query could be be
createdpublic void queryClosed(QueryImpl query)
queryClosed
in interface ValueSourceManager
public boolean visit(QueryParameters parameters, ValueVisitor visitor)
ValueSourceManager
visit
in interface ValueSourceManager
parameters
- the parameters to visitvisitor
- the visitortrue
if the run was complete, false
if
is was aborted by the visitorpublic void dispose()