public abstract class DataAdapter<T,A extends Decoder<T>>
extends java.lang.Object
implements java.lang.AutoCloseable
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
closed |
| Constructor and Description |
|---|
DataAdapter() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
java.util.Map<TimeSeriesInfo<T>,TimeSeriesProcessor<T>> |
fetchDecodedData(java.lang.String path,
java.time.Instant begin,
java.time.Instant end,
java.util.List<TimeSeriesInfo<T>> seriesInfo,
boolean bypassCache)
Gets decoded data from the source as a map of
TimeSeriesProcessor, for the time interval and TimeSeriesInfo specified. |
abstract java.io.InputStream |
fetchRawData(java.lang.String path,
java.time.Instant begin,
java.time.Instant end,
boolean bypassCache)
Gets raw data from the source as an output stream, for the time interval specified.
|
abstract javafx.scene.control.TreeItem<TimeSeriesBinding<T>> |
getBindingTree()
Return a hierarchical view of all the individual bindings exposed by the underlying source.
|
abstract A |
getDecoder()
Gets the
Decoder used to produce TimeSeriesProcessor from the source. |
abstract java.lang.String |
getEncoding()
Gets the encoding used to decode textual data sent by the source.
|
java.util.UUID |
getId()
Gets the unique id for the adapter
|
abstract java.util.Map<java.lang.String,java.lang.String> |
getParams()
Returns a map of all parameters required to establish a connection to the underlying data source
|
abstract java.lang.String |
getSourceName()
Gets the name of the source.
|
abstract java.time.ZoneId |
getTimeZoneId()
Gets the id of the time zone used to record dates in the source.
|
boolean |
isClosed() |
abstract void |
loadParams(java.util.Map<java.lang.String,java.lang.String> params)
Sets the parameters required to establish a connection to the underlying data source
|
void |
onStart()
An api hook that is executed once, after parameters have been loaded and before any other call to the
DataAdapter is made. |
abstract boolean |
ping()
Pings the data source
|
void |
setId(java.util.UUID id)
Sets the unique id for the adapter
|
java.lang.String |
toString() |
protected <R> R |
validateParameter(java.util.Map<java.lang.String,java.lang.String> params,
java.lang.String paramName,
CheckedFunction<java.lang.String,R,InvalidAdapterParameterException> validator) |
protected java.lang.String |
validateParameterNullity(java.util.Map<java.lang.String,java.lang.String> params,
java.lang.String paramName) |
public abstract javafx.scene.control.TreeItem<TimeSeriesBinding<T>> getBindingTree() throws DataAdapterException
DataAdapterException - if an error occurs while retrieving bindings.public abstract java.io.InputStream fetchRawData(java.lang.String path,
java.time.Instant begin,
java.time.Instant end,
boolean bypassCache)
throws DataAdapterException
path - the path of the data in the sourcebegin - the start of the time interval.end - the end of the time interval.*bypassCache - true if adapter cache should be bypassed, false otherwise. This parameter is ignored if adapter does not support cachingDataAdapterException - if an error occurs while retrieving data from the source.public java.util.Map<TimeSeriesInfo<T>,TimeSeriesProcessor<T>> fetchDecodedData(java.lang.String path, java.time.Instant begin, java.time.Instant end, java.util.List<TimeSeriesInfo<T>> seriesInfo, boolean bypassCache) throws DataAdapterException
TimeSeriesProcessor, for the time interval and TimeSeriesInfo specified.path - the path of the data in the sourcebegin - the start of the time interval.end - the end of the time interval.seriesInfo - the series to get data from.bypassCache - true if adapter cache should be bypassed, false otherwise. This parameter is ignored if adapter does not support cachingDataAdapterException - if an error occurs while retrieving data from the source.public abstract java.lang.String getEncoding()
public abstract java.time.ZoneId getTimeZoneId()
public abstract A getDecoder()
Decoder used to produce TimeSeriesProcessor from the source.Decoder used to produce TimeSeriesProcessor from the source.public abstract java.lang.String getSourceName()
public abstract java.util.Map<java.lang.String,java.lang.String> getParams()
public abstract void loadParams(java.util.Map<java.lang.String,java.lang.String> params)
throws DataAdapterException
params - the parameters required to establish a connection to the underlying data sourceDataAdapterExceptionpublic void onStart()
throws DataAdapterException
DataAdapter is made.
Used to initialize resources and start-up external components.
The default implementation does nothing.
DataAdapterExceptionpublic abstract boolean ping()
public java.util.UUID getId()
public void setId(java.util.UUID id)
id - the unique id for the adapterprotected java.lang.String validateParameterNullity(java.util.Map<java.lang.String,java.lang.String> params,
java.lang.String paramName)
throws InvalidAdapterParameterException
InvalidAdapterParameterExceptionprotected <R> R validateParameter(java.util.Map<java.lang.String,java.lang.String> params,
java.lang.String paramName,
CheckedFunction<java.lang.String,R,InvalidAdapterParameterException> validator)
throws InvalidAdapterParameterException
InvalidAdapterParameterExceptionpublic void close()
close in interface java.lang.AutoCloseablepublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean isClosed()
Copyright © 2018 Frederic Thevenet. All rights reserved.