Package com.seeq.link.sdk.interfaces
Class GetSamplesParameters
java.lang.Object
com.seeq.link.sdk.interfaces.GetSamplesParameters
-
Constructor Summary
ConstructorsConstructorDescriptionGetSamplesParameters
(SignalConnectionMessages.SignalRequestMessage signalRequestMessage, Consumer<TimeInstant> cursorCallback) GetSamplesParameters
(String dataId, TimeInstant startTime, TimeInstant endTime, long maxInterpolation, int sampleLimit, Consumer<TimeInstant> cursorCallback, String valueUom) -
Method Summary
Modifier and TypeMethodDescriptionA connector-defined string that identifies the signal to retrieve data for.The end time for the requested data.The end time for the requested data plus the "maximum interpolation" for the signal.The start time for the requested data minus the "maximum interpolation" for the signal.long
int
The maximum samples that can be returned as part of this request.The start time for the requested data.boolean
Iftrue
, you can specify a time instant tosetLastCertainKey(TimeInstant)
to indicate to Seeq that any samples after a time instant are uncertain.void
IfisLastCertainKeyRequested()
returnstrue
, you can invoke this method to indicate to Seeq that any samples after a time instant are uncertain.
-
Constructor Details
-
GetSamplesParameters
public GetSamplesParameters(SignalConnectionMessages.SignalRequestMessage signalRequestMessage, Consumer<TimeInstant> cursorCallback) -
GetSamplesParameters
public GetSamplesParameters(String dataId, TimeInstant startTime, TimeInstant endTime, long maxInterpolation, int sampleLimit, Consumer<TimeInstant> cursorCallback, String valueUom)
-
-
Method Details
-
getDataId
A connector-defined string that identifies the signal to retrieve data for.- Returns:
- connector-defined string that identifies the signal to retrieve data for.
-
getStartTime
The start time for the requested data. Note: This function must return "boundary values" as well, which are the nearest values immediately outside the requested interval. If your datasource does not return such "boundary values" efficiently, use thegetExpandedStartTime()
field for your datasource query.- Returns:
- start time for the requested data
-
getExpandedStartTime
The start time for the requested data minus the "maximum interpolation" for the signal. This value represents the earliest possible time that a sample may be relevant for a given request. This is useful when the datasource does not have a facility for efficiently returning a sample that is "on or before" the start time. You can just use the ExpandedStartTime/ExpandedEndTime fields instead and return all the samples within the expanded range. Seeq Server will ignore the values it doesn't need.- Returns:
- expanded start time for the requested data
-
getEndTime
The end time for the requested data. Note: This function must return "boundary values" as well, which are the nearest values immediately outside the requested interval.- Returns:
- end time for the requested data
-
getExpandedEndTime
The end time for the requested data plus the "maximum interpolation" for the signal. This value represents the latest possible time that a sample may be relevant for a given request. This is useful when the datasource does not have a facility for efficiently returning a sample that is "on or after" the end time. You can just use the ExpandedStartTime/ExpandedEndTime fields instead and return all the samples within the expanded range. Seeq Server will ignore the values it doesn't need.- Returns:
- expanded end time for the requested data
-
getMaxInterpolation
public long getMaxInterpolation()- Returns:
- the maximum interpolation for the requested signal in nanoseconds.
-
getSampleLimit
public int getSampleLimit()The maximum samples that can be returned as part of this request. Note that the connection need not enforce this limit, as no more samples than the limit will be read from the sample stream that is returned from this method. This limit is provided for informational purposes to enable optimization where possible.- Returns:
- sample limit for this request
-
isLastCertainKeyRequested
public boolean isLastCertainKeyRequested()Iftrue
, you can specify a time instant tosetLastCertainKey(TimeInstant)
to indicate to Seeq that any samples after a time instant are uncertain. Iffalse
, you cannot make such a method call (and should not try to calculate a time) because Seeq will not use the value. -
getValueUom
-
setLastCertainKey
IfisLastCertainKeyRequested()
returnstrue
, you can invoke this method to indicate to Seeq that any samples after a time instant are uncertain. There does not need to be a sample present at the key specified; for instance, if a historian guarantees that all data is recorded within three hours, and the most recent sample is two weeks ago, this value may benow - three hours
. Any samples after this key will be treated as uncertain by Seeq, and any samples before or at the key will be treated as certain.If this method is not invoked, Seeq will assume that all samples returned are certain, and that no new samples will change or appear at or before the latest sample key seen. This inference carries no performance penalty, so for a datasource where no historical changes are expected, not invoking this method is a reasonable default.
If you supply null for the key, it will clear any key set by a previous call.
You can invoke this method anytime after
SignalPullDatasourceConnection.getSamples(GetSamplesParameters)
is entered, and you may invoke it multiple times. If you do, the last invocation takes precedence.
-