Class AggregatedQueryOptions.Builder
java.lang.Object
com.inductiveautomation.historian.common.model.options.AbstractQueryOptions.BaseBuilder<AggregatedQueryKey, DataPointType, AggregatedQueryOptions.Builder>
com.inductiveautomation.historian.common.model.options.DataPointQueryOptions.DataQueryBuilder<AggregatedQueryKey, AggregatedQueryOptions.Builder>
com.inductiveautomation.historian.common.model.options.AggregatedQueryOptions.Builder
- Enclosing class:
AggregatedQueryOptions
public static class AggregatedQueryOptions.Builder
extends DataPointQueryOptions.DataQueryBuilder<AggregatedQueryKey, AggregatedQueryOptions.Builder>
Builder for
AggregatedQueryOptions; adds the time window and aggregation settings to
the common query settings.-
Field Summary
Fields inherited from class DataPointQueryOptions.DataQueryBuilder
bounding, excludeObservations, levelBuilderFields inherited from class AbstractQueryOptions.BaseBuilder
queryKeys, returnSize -
Method Summary
Modifier and TypeMethodDescriptionalignToEngineGrid(boolean align) Lets the pipeline snap the grid to the engine's lattice; defaultfalse.bounding(BoundingOptions bounding) Sets the bounding-value configuration; defaultBoundingOptions.NONE.build()Builds the options.defaultAggregateId(@Nullable AggregateId defaultAggregateId) Sets the aggregate a key inherits when it names none; default none.interpolation(@Nullable Interpolation interpolation) Sets the interpolation a key with none of its own takes;nullresets toInterpolation.AUTO.protected AggregatedQueryOptions.Builderself()strictFillWords(boolean strict) Rejects a key's own fill that does not apply instead of answering as Auto; defaultfalse.strictInterpolation(boolean strict) Rejects a key's own interpolation the aggregate does not offer instead of answering with the aggregate's default; defaultfalse.withDayWindows(long days) Uses day windows.withHourWindows(long hours) Uses hour windows.withMinuteWindows(long minutes) Uses minute windows.withMonthWindows(long months) Uses month windows.withTimeWindow(TimeWindow window) Sets the aggregation time window.withWeekWindows(long weeks) Uses week windows.withWindowSize(long size, ChronoUnit unit) Sets the time window size and unit.withYearWindows(long years) Uses year windows.Methods inherited from class DataPointQueryOptions.DataQueryBuilder
addQualityLevel, applyQualityLevelMask, excludeObservations, includeAllQuality, includeBadQuality, includeErrorQuality, includeGoodQuality, includeUncertainQuality, qualityLevelFilter, setQualityLevelMaskMethods inherited from class AbstractQueryOptions.BaseBuilder
addPropertyValue, addPropertyValues, addQueryKey, addQueryKeys, calculateTimeRange, clearQueryKeys, endTime, endTime, excludeBounds, includeBounds, rangeHours, rangeMinutes, rangeSeconds, returnSize, startTime, startTime
-
Method Details
-
bounding
Sets the bounding-value configuration; defaultBoundingOptions.NONE.Left unset, the pipeline reads both sides (
BoundingMode.BOTH);BoundingOptions.NONEreads none. An engine queried directly reads none.- Overrides:
boundingin classDataPointQueryOptions.DataQueryBuilder<AggregatedQueryKey, AggregatedQueryOptions.Builder>- Parameters:
bounding- the bounding options; useBoundingOptions.NONEto disable.- Returns:
- this builder.
-
alignToEngineGrid
Lets the pipeline snap the grid to the engine's lattice; defaultfalse.build()rejects it with a MONTHS or YEARS window, which has no fixed width. -
interpolation
Sets the interpolation a key with none of its own takes;nullresets toInterpolation.AUTO. -
strictInterpolation
Rejects a key's own interpolation the aggregate does not offer instead of answering with the aggregate's default; defaultfalse. -
strictFillWords
Rejects a key's own fill that does not apply instead of answering as Auto; defaultfalse. -
defaultAggregateId
Sets the aggregate a key inherits when it names none; default none. SeeAggregatedQueryOptions.getDefaultAggregateId(). -
withTimeWindow
Sets the aggregation time window.- Parameters:
window- the window.- Returns:
- this builder.
-
withWindowSize
Sets the time window size and unit.- Parameters:
size- the window size.unit- the unit ofsize.- Returns:
- this builder.
-
withHourWindows
Uses hour windows.- Parameters:
hours- the hours per window.- Returns:
- this builder.
-
withMinuteWindows
Uses minute windows.- Parameters:
minutes- the minutes per window.- Returns:
- this builder.
-
withDayWindows
Uses day windows.- Parameters:
days- the days per window.- Returns:
- this builder.
-
withWeekWindows
Uses week windows.- Parameters:
weeks- the weeks per window.- Returns:
- this builder.
-
withMonthWindows
Uses month windows. A month is the average duration (30.436875 days), not a calendar month; usewithDayWindows(long)for windows that line up with daily rollup cells.- Parameters:
months- the months per window.- Returns:
- this builder.
-
withYearWindows
Uses year windows. A year is the average duration (365.2425 days), not a calendar year; usewithDayWindows(long)for windows that line up with daily rollup cells.- Parameters:
years- the years per window.- Returns:
- this builder.
-
self
- Specified by:
selfin classAbstractQueryOptions.BaseBuilder<AggregatedQueryKey, DataPointType, AggregatedQueryOptions.Builder>
-
build
Builds the options. With no explicit time window, one is derived from the time range and return size. An unset quality filter admits Good only.- Specified by:
buildin classAbstractQueryOptions.BaseBuilder<AggregatedQueryKey, DataPointType, AggregatedQueryOptions.Builder>- Returns:
- the new options.
- Throws:
IllegalStateException- if the time range is not set.IllegalArgumentException- if neither a time window nor a positive return size was supplied, or the quality filter accepts no level.
-