public class SimpleMemoryStorage extends Object implements DataStorage
DataStorage
first implementation which handles only memory.Constructor and Description |
---|
SimpleMemoryStorage() |
Modifier and Type | Method and Description |
---|---|
void |
addListener(DataStorageListener listener)
Adds a
DataStorageListener to be notified when data is lost. |
SortedSet<Data> |
getAvailableData(org.epics.util.time.TimeInterval interval)
Returns all available
Data within the requested
TimeInterval . |
DataChunk |
getData(String channelName,
org.epics.util.time.Timestamp from)
Read samples from source ordered by
Timestamp and starting with
the specified one. |
boolean |
hasAvailableData(org.epics.util.time.TimeInterval interval)
Returns
true if some data is available within the requested
interval, false otherwise. |
void |
removeListener(DataStorageListener listener)
Removes a
DataStorageListener . |
SortedSet<Data> |
storeData(DataChunk chunk)
|
public DataChunk getData(String channelName, org.epics.util.time.Timestamp from)
Timestamp
and starting with
the specified one. Polled by DataRequestThread
.getData
in interface DataSource
channelName
- channel to read.from
- lowest Timestamp
of the first returned sample.DataChunk
a chunk of ordered samples with all
Timestamp
superior to the specified argument.public SortedSet<Data> getAvailableData(org.epics.util.time.TimeInterval interval)
Data
within the requested
TimeInterval
.getAvailableData
in interface DataStorage
public boolean hasAvailableData(org.epics.util.time.TimeInterval interval)
true
if some data is available within the requested
interval, false
otherwise.hasAvailableData
in interface DataStorage
public SortedSet<Data> storeData(DataChunk chunk)
Data
of the specified DataChunk
and returns
the corresponding set of Data
ordered by Timestamp
.storeData
in interface DataStorage
chunk
- to store.Data
ordered by Timestamp
.public void addListener(DataStorageListener listener)
DataStorageListener
to be notified when data is lost.addListener
in interface DataStorage
listener
- to be added.public void removeListener(DataStorageListener listener)
DataStorageListener
.removeListener
in interface DataStorage
listener
- to be removedCopyright © 2010–2015. All rights reserved.