Class PersistenceExtensions
java.lang.Object
org.openhab.core.persistence.extensions.PersistenceExtensions
This class provides static methods that can be used in automation rules
for using persistence services
- Author:
- Kai Kreuzer - Initial contribution, Thomas Eichstaedt-Engelen - Initial contribution, Chris Jackson - Initial contribution, Gaƫl L'hopital - Add deltaSince, lastUpdate, evolutionRate, Jan N. Klug - Added sumSince, John Cocula - Added sumSince, Jan N. Klug - Added interval methods and refactoring, Mark Herwege - Changed return types to State for some interval methods to also return unit, Mark Herwege - Extended for future dates, Mark Herwege - lastChange and nextChange methods, Mark Herwege - handle persisted GroupItem with QuantityType, Mark Herwege - add median methods, Mark Herwege - use item lastChange and lastUpdate methods if not in peristence, Mark Herwege - add Riemann sum methods
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionPersistenceExtensions(PersistenceServiceRegistry registry, PersistenceServiceConfigurationRegistry configRegistry, TimeZoneProvider timeZoneProvider) -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable StateaverageBetween(Item item, ZonedDateTime begin, ZonedDateTime end) Gets the average value of the state of a givenItembetween two certain points in time.static @Nullable StateaverageBetween(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable String serviceId) Gets the average value of the state of a givenItembetween two certain points in time.static @Nullable StateaverageBetween(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable PersistenceExtensions.RiemannType type) Gets the average value of the state of a givenItembetween two certain points in time.static @Nullable StateaverageBetween(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable PersistenceExtensions.RiemannType type, @Nullable String serviceId) Gets the average value of the state of a givenItembetween two certain points in time.static @Nullable StateaverageSince(Item item, ZonedDateTime timestamp) Gets the average value of the state of a givenItemsince a certain point in time.static @Nullable StateaverageSince(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the average value of the state of a givenItemsince a certain point in time.static @Nullable StateaverageSince(Item item, ZonedDateTime timestamp, @Nullable PersistenceExtensions.RiemannType type) Gets the average value of the state of a givenItemsince a certain point in time.static @Nullable StateaverageSince(Item item, ZonedDateTime timestamp, @Nullable PersistenceExtensions.RiemannType type, @Nullable String serviceId) Gets the average value of the state of a givenItemsince a certain point in time.static @Nullable StateaverageUntil(Item item, ZonedDateTime timestamp) Gets the average value of the state of a givenItemuntil a certain point in time.static @Nullable StateaverageUntil(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the average value of the state of a givenItemuntil a certain point in time.static @Nullable StateaverageUntil(Item item, ZonedDateTime timestamp, @Nullable PersistenceExtensions.RiemannType type) Gets the average value of the state of a givenItemuntil a certain point in time.static @Nullable StateaverageUntil(Item item, ZonedDateTime timestamp, @Nullable PersistenceExtensions.RiemannType type, @Nullable String serviceId) Gets the average value of the state of a givenItemuntil a certain point in time.static @Nullable BooleanchangedBetween(Item item, ZonedDateTime begin, ZonedDateTime end) Checks if the state of a givenitemchanges between two points in time.static @Nullable BooleanchangedBetween(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable String serviceId) Checks if the state of a givenitemchanges between two points in time.static @Nullable BooleanchangedSince(Item item, ZonedDateTime timestamp) Checks if the state of a givenitemhas changed since a certain point in time.static @Nullable BooleanchangedSince(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Checks if the state of a givenitemhas changed since a certain point in time.static @Nullable BooleanchangedUntil(Item item, ZonedDateTime timestamp) Checks if the state of a givenitemwill change by a certain point in time.static @Nullable BooleanchangedUntil(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Checks if the state of a givenitemwill change by a certain point in time.static @Nullable LongcountBetween(Item item, ZonedDateTime begin, ZonedDateTime end) Gets the number of available data points of a givenItembetween two points in time.static @Nullable LongcountBetween(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable String serviceId) Gets the number of available data points of a givenItembetween two points in time.static @Nullable LongcountSince(Item item, ZonedDateTime timestamp) Gets the number of available historic data points of a givenItemfrom a point in time until now.static @Nullable LongcountSince(Item item, ZonedDateTime begin, @Nullable String serviceId) Gets the number of available historic data points of a givenItemfrom a point in time until now.static @Nullable LongcountStateChangesBetween(Item item, ZonedDateTime begin, ZonedDateTime end) Gets the number of changes in data points of a givenItembetween two points in time.static @Nullable LongcountStateChangesBetween(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable String serviceId) Gets the number of changes in data points of a givenItembetween two points in time.static @Nullable LongcountStateChangesSince(Item item, ZonedDateTime timestamp) Gets the number of changes in historic data points of a givenItemfrom a point in time until now.static @Nullable LongcountStateChangesSince(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the number of changes in historic data points of a givenItemfrom a point in time until now.static @Nullable LongcountStateChangesUntil(Item item, ZonedDateTime timestamp) Gets the number of changes in data points of a givenItemfrom now until a point in time.static @Nullable LongcountStateChangesUntil(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the number of changes in data points of a givenItemfrom now until a point in time.static @Nullable LongcountUntil(Item item, ZonedDateTime timestamp) Gets the number of available data points of a givenItemfrom now to a point in time.static @Nullable LongcountUntil(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the number of available data points of a givenItemfrom now to a point in time.static @Nullable StatedeltaBetween(Item item, ZonedDateTime begin, ZonedDateTime end) Gets the difference value of the state of a givenitembetween two points in time.static @Nullable StatedeltaBetween(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable String serviceId) Gets the difference value of the state of a givenitembetween two points in time.static @Nullable StatedeltaSince(Item item, ZonedDateTime timestamp) Gets the difference value of the state of a givenitemsince a certain point in time.static @Nullable StatedeltaSince(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the difference value of the state of a givenitemsince a certain point in time.static @Nullable StatedeltaUntil(Item item, ZonedDateTime timestamp) Gets the difference value of the state of a givenitemuntil a certain point in time.static @Nullable StatedeltaUntil(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the difference value of the state of a givenitemuntil a certain point in time.static @Nullable StatedeviationBetween(Item item, ZonedDateTime begin, ZonedDateTime end) Gets the standard deviation of the state of the givenItembetween two points in time.static @Nullable StatedeviationBetween(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable String serviceId) Gets the standard deviation of the state of the givenItembetween two points in time.static @Nullable StatedeviationBetween(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable PersistenceExtensions.RiemannType type) Gets the standard deviation of the state of the givenItembetween two points in time.static @Nullable StatedeviationBetween(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable PersistenceExtensions.RiemannType type, @Nullable String serviceId) Gets the standard deviation of the state of the givenItembetween two points in time.static @Nullable StatedeviationSince(Item item, ZonedDateTime timestamp) Gets the standard deviation of the state of the givenItemsince a certain point in time.static @Nullable StatedeviationSince(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the standard deviation of the state of the givenItemsince a certain point in time.static @Nullable StatedeviationSince(Item item, ZonedDateTime timestamp, @Nullable PersistenceExtensions.RiemannType type) Gets the standard deviation of the state of the givenItemsince a certain point in time.static @Nullable StatedeviationSince(Item item, ZonedDateTime timestamp, @Nullable PersistenceExtensions.RiemannType type, @Nullable String serviceId) Gets the standard deviation of the state of the givenItemsince a certain point in time.static @Nullable StatedeviationUntil(Item item, ZonedDateTime timestamp) Gets the standard deviation of the state of the givenItemuntil a certain point in time.static @Nullable StatedeviationUntil(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the standard deviation of the state of the givenItemuntil a certain point in time.static @Nullable StatedeviationUntil(Item item, ZonedDateTime timestamp, @Nullable PersistenceExtensions.RiemannType type) Gets the standard deviation of the state of the givenItemuntil a certain point in time.static @Nullable StatedeviationUntil(Item item, ZonedDateTime timestamp, @Nullable PersistenceExtensions.RiemannType type, @Nullable String serviceId) Gets the standard deviation of the state of the givenItemuntil a certain point in time.static @Nullable DecimalTypeevolutionRate(Item item, ZonedDateTime timestamp) Deprecated.static @Nullable DecimalTypeevolutionRate(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Deprecated.static @Nullable DecimalTypeevolutionRate(Item item, ZonedDateTime begin, ZonedDateTime end) Deprecated.static @Nullable DecimalTypeevolutionRate(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable String serviceId) Deprecated.static @Nullable DecimalTypeevolutionRateBetween(Item item, ZonedDateTime begin, ZonedDateTime end) Gets the evolution rate of the state of a givenItembetween two points in time.static @Nullable DecimalTypeevolutionRateBetween(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable String serviceId) Gets the evolution rate of the state of a givenItembetween two points in time.static @Nullable DecimalTypeevolutionRateSince(Item item, ZonedDateTime timestamp) Gets the evolution rate of the state of a givenItemsince a certain point in time.static @Nullable DecimalTypeevolutionRateSince(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the evolution rate of the state of a givenItemsince a certain point in time.static @Nullable DecimalTypeevolutionRateUntil(Item item, ZonedDateTime timestamp) Gets the evolution rate of the state of a givenItemuntil a certain point in time.static @Nullable DecimalTypeevolutionRateUntil(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the evolution rate of the state of a givenItemuntil a certain point in time.static @Nullable Iterable<HistoricItem> getAllStatesBetween(Item item, ZonedDateTime begin, ZonedDateTime end) Retrieves the historic items for a givenitembetween two points in time.static @Nullable Iterable<HistoricItem> getAllStatesBetween(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable String serviceId) Retrieves the historic items for a givenitembetween two points in time through aPersistenceServiceidentified by theserviceId.static @Nullable Iterable<HistoricItem> getAllStatesSince(Item item, ZonedDateTime timestamp) Retrieves the historic items for a givenitemsince a certain point in time.static @Nullable Iterable<HistoricItem> getAllStatesSince(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Retrieves the historic items for a givenitemsince a certain point in time through aPersistenceServiceidentified by theserviceId.static @Nullable Iterable<HistoricItem> getAllStatesUntil(Item item, ZonedDateTime timestamp) Retrieves the future items for a givenitemuntil a certain point in time.static @Nullable Iterable<HistoricItem> getAllStatesUntil(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Retrieves the future items for a givenitemuntil a certain point in time through aPersistenceServiceidentified by theserviceId.static @Nullable HistoricItemhistoricState(Item item, ZonedDateTime timestamp) Deprecated.static @Nullable HistoricItemhistoricState(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Deprecated.static @Nullable ZonedDateTimelastChange(Item item) Query the last historic change time of a givenitem.static @Nullable ZonedDateTimelastChange(Item item, @Nullable String serviceId) Query for the last historic change time of a givenitem.static @Nullable ZonedDateTimelastUpdate(Item item) Query the last historic update time of a givenitem.static @Nullable ZonedDateTimelastUpdate(Item item, @Nullable String serviceId) Query for the last historic update time of a givenitem.static @Nullable HistoricItemmaximumBetween(Item item, ZonedDateTime begin, ZonedDateTime end) Gets the historic item with the maximum value of the state of a givenitembetween two points in time.static @Nullable HistoricItemmaximumBetween(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable String serviceId) Gets the historic item with the maximum value of the state of a givenitembetween two points in time.static @Nullable HistoricItemmaximumSince(Item item, ZonedDateTime timestamp) Gets the historic item with the maximum value of the state of a givenitemsince a certain point in time.static @Nullable HistoricItemmaximumSince(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the historic item with the maximum value of the state of a givenitemsince a certain point in time.static @Nullable HistoricItemmaximumUntil(Item item, ZonedDateTime timestamp) Gets the historic item with the maximum value of the state of a givenitemuntil a certain point in time.static @Nullable HistoricItemmaximumUntil(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the historic item with the maximum value of the state of a givenitemuntil a certain point in time.static @Nullable StatemedianBetween(Item item, ZonedDateTime begin, ZonedDateTime end) Gets the median value of the state of a givenItembetween two certain points in time.static @Nullable StatemedianBetween(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable String serviceId) Gets the median value of the state of a givenItembetween two certain points in time.static @Nullable StatemedianSince(Item item, ZonedDateTime timestamp) Gets the median value of the state of a givenItemsince a certain point in time.static @Nullable StatemedianSince(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the median value of the state of a givenItemsince a certain point in time.static @Nullable StatemedianUntil(Item item, ZonedDateTime timestamp) Gets the median value of the state of a givenItemuntil a certain point in time.static @Nullable StatemedianUntil(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the median value of the state of a givenItemuntil a certain point in time.static @Nullable HistoricItemminimumBetween(Item item, ZonedDateTime begin, ZonedDateTime end) Gets the historic item with the minimum value of the state of a givenitembetween two certain points in time.static @Nullable HistoricItemminimumBetween(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable String serviceId) Gets the historic item with the minimum value of the state of a givenitembetween two certain points in time.static @Nullable HistoricItemminimumSince(Item item, ZonedDateTime timestamp) Gets the historic item with the minimum value of the state of a givenitemsince a certain point in time.static @Nullable HistoricItemminimumSince(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the historic item with the minimum value of the state of a givenitemsince a certain point in time.static @Nullable HistoricItemminimumUntil(Item item, ZonedDateTime timestamp) Gets the historic item with the minimum value of the state of a givenitemuntil a certain point in time.static @Nullable HistoricItemminimumUntil(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the historic item with the minimum value of the state of a givenitemuntil a certain point in time.static @Nullable ZonedDateTimenextChange(Item item) Query the first future change time of a givenitem.static @Nullable ZonedDateTimenextChange(Item item, @Nullable String serviceId) Query for the first future change time of a givenitem.static @Nullable HistoricItemReturns the next state of a givenitem.static @Nullable HistoricItemReturns the next state of a givenitem.static @Nullable HistoricItemReturns the next state of a givenitem.static @Nullable HistoricItemReturns the next state of a givenitem.static @Nullable ZonedDateTimenextUpdate(Item item) Query the first future update time of a givenitem.static @Nullable ZonedDateTimenextUpdate(Item item, @Nullable String serviceId) Query for the first future update time of a givenitem.static voidPersists the state of a givenitemthrough the default persistence service.static voidstatic voidpersist(Item item, ZonedDateTime timestamp, String stateString) Persists astateat a giventimestampof anitemthrough the default persistence service.static voidpersist(Item item, ZonedDateTime timestamp, String stateString, @Nullable String serviceId) Persists astateat a giventimestampof anitemthrough aPersistenceServiceidentified by theserviceId.static voidpersist(Item item, ZonedDateTime timestamp, State state) Persists astateat a giventimestampof anitemthrough the default persistence service.static voidpersist(Item item, ZonedDateTime timestamp, State state, @Nullable String serviceId) Persists astateat a giventimestampof anitemthrough aPersistenceServiceidentified by theserviceId.static voidpersist(Item item, TimeSeries timeSeries) Persists atimeSeriesof anitemthrough the default persistence service.static voidpersist(Item item, TimeSeries timeSeries, @Nullable String serviceId) static @Nullable HistoricItempersistedState(Item item, ZonedDateTime timestamp) Retrieves the persisted item for a givenitemat a certain point in time through the default persistence service.static @Nullable HistoricItempersistedState(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Retrieves the persisted item for a givenitemat a certain point in time through aPersistenceServiceidentified by theserviceId.static @Nullable HistoricItempreviousState(Item item) Returns the previous state of a givenitem.static @Nullable HistoricItempreviousState(Item item, boolean skipEqual) Returns the previous state of a givenitem.static @Nullable HistoricItempreviousState(Item item, boolean skipEqual, @Nullable String serviceId) Returns the previous state of a givenitem.static @Nullable HistoricItempreviousState(Item item, @Nullable String serviceId) Returns the previous state of a givenitem.static voidremoveAllStatesBetween(Item item, ZonedDateTime begin, ZonedDateTime end) Removes from persistence the historic items for a givenitembetween two points in time.static voidremoveAllStatesBetween(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable String serviceId) Removes from persistence the historic items for a givenitembeetween two points in time through aPersistenceServiceidentified by theserviceId.static voidremoveAllStatesSince(Item item, ZonedDateTime timestamp) Removes from persistence the historic items for a givenitemsince a certain point in time.static voidremoveAllStatesSince(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Removes from persistence the historic items for a givenitemsince a certain point in time through aPersistenceServiceidentified by theserviceId.static voidremoveAllStatesUntil(Item item, ZonedDateTime timestamp) Removes from persistence the future items for a givenitemuntil a certain point in time.static voidremoveAllStatesUntil(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Removes from persistence the future items for a givenitemuntil a certain point in time through aPersistenceServiceidentified by theserviceId.static @Nullable StateriemannSumBetween(Item item, ZonedDateTime begin, ZonedDateTime end) Gets the Riemann sum of the states of a givenItembetween two certain points in time.static @Nullable StateriemannSumBetween(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable String serviceId) Gets the Riemann sum of the states of a givenItembetween two certain points in time.static @Nullable StateriemannSumBetween(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable PersistenceExtensions.RiemannType type) Gets the Riemann sum of the states of a givenItembetween two certain points in time.static @Nullable StateriemannSumBetween(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable PersistenceExtensions.RiemannType type, @Nullable String serviceId) Gets the Riemann sum of the states of a givenItembetween two certain points in time.static @Nullable StateriemannSumSince(Item item, ZonedDateTime timestamp) Gets the Riemann sum of the states of a givenItemsince a certain point in time.static @Nullable StateriemannSumSince(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the Riemann sum of the states of a givenItemsince a certain point in time.static @Nullable StateriemannSumSince(Item item, ZonedDateTime timestamp, @Nullable PersistenceExtensions.RiemannType type) Gets the Riemann sum of the states of a givenItemsince a certain point in time.static @Nullable StateriemannSumSince(Item item, ZonedDateTime timestamp, @Nullable PersistenceExtensions.RiemannType type, @Nullable String serviceId) Gets the Riemann sum of the states of a givenItemsince a certain point in time.static @Nullable StateriemannSumUntil(Item item, ZonedDateTime timestamp) Gets the Riemann sum of the states of a givenItemuntil a certain point in time.static @Nullable StateriemannSumUntil(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the Riemann sum of the states of a givenItemuntil a certain point in time.static @Nullable StateriemannSumUntil(Item item, ZonedDateTime timestamp, @Nullable PersistenceExtensions.RiemannType type) Gets the Riemann sum of the states of a givenItemuntil a certain point in time.static @Nullable StateriemannSumUntil(Item item, ZonedDateTime timestamp, @Nullable PersistenceExtensions.RiemannType type, @Nullable String serviceId) Gets the Riemann sum of the states of a givenItemuntil a certain point in time.static @Nullable StatesumBetween(Item item, ZonedDateTime begin, ZonedDateTime end) Gets the sum of the state of a givenitembetween two certain points in time.static @Nullable StatesumBetween(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable String serviceId) Gets the sum of the state of a givenitembetween two certain points in time.static @Nullable StatesumSince(Item item, ZonedDateTime timestamp) Gets the sum of the state of a givenitemsince a certain point in time.static @Nullable StatesumSince(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the sum of the state of a givenitemsince a certain point in time.static @Nullable StatesumUntil(Item item, ZonedDateTime timestamp) Gets the sum of the state of a givenitemuntil a certain point in time.static @Nullable StatesumUntil(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the sum of the state of a givenitemuntil a certain point in time.static @Nullable BooleanupdatedBetween(Item item, ZonedDateTime begin, ZonedDateTime end) Checks if the state of a givenitemhas been updated between two points in time.static @Nullable BooleanupdatedBetween(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable String serviceId) Checks if the state of a givenitemis updated between two points in time.static @Nullable BooleanupdatedSince(Item item, ZonedDateTime timestamp) Checks if the state of a givenitemhas been updated since a certain point in time.static @Nullable BooleanupdatedSince(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Checks if the state of a givenitemhas been updated since a certain point in time.static @Nullable BooleanupdatedUntil(Item item, ZonedDateTime timestamp) Checks if the state of a givenitemwill be updated until a certain point in time.static @Nullable BooleanupdatedUntil(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Checks if the state of a givenitemwill be updated until a certain point in time.static @Nullable StatevarianceBetween(Item item, ZonedDateTime begin, ZonedDateTime end) Gets the variance of the state of the givenItembetween two certain point in time.static @Nullable StatevarianceBetween(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable String serviceId) Gets the variance of the state of the givenItembetween two points in time.static @Nullable StatevarianceBetween(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable PersistenceExtensions.RiemannType type) Gets the variance of the state of the givenItembetween two certain point in time.static @Nullable StatevarianceBetween(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable PersistenceExtensions.RiemannType type, @Nullable String serviceId) Gets the variance of the state of the givenItembetween two points in time.static @Nullable StatevarianceSince(Item item, ZonedDateTime timestamp) Gets the variance of the state of the givenItemsince a certain point in time.static @Nullable StatevarianceSince(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the variance of the state of the givenItemsince a certain point in time.static @Nullable StatevarianceSince(Item item, ZonedDateTime timestamp, @Nullable PersistenceExtensions.RiemannType type) Gets the variance of the state of the givenItemsince a certain point in time.static @Nullable StatevarianceSince(Item item, ZonedDateTime timestamp, @Nullable PersistenceExtensions.RiemannType type, @Nullable String serviceId) Gets the variance of the state of the givenItemsince a certain point in time.static @Nullable StatevarianceUntil(Item item, ZonedDateTime timestamp) Gets the variance of the state of the givenItemuntil a certain point in time.static @Nullable StatevarianceUntil(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the variance of the state of the givenItemuntil a certain point in time.static @Nullable StatevarianceUntil(Item item, ZonedDateTime timestamp, @Nullable PersistenceExtensions.RiemannType type) Gets the variance of the state of the givenItemuntil a certain point in time.static @Nullable StatevarianceUntil(Item item, ZonedDateTime timestamp, @Nullable PersistenceExtensions.RiemannType type, @Nullable String serviceId) Gets the variance of the state of the givenItemuntil a certain point in time.
-
Constructor Details
-
PersistenceExtensions
public PersistenceExtensions(PersistenceServiceRegistry registry, PersistenceServiceConfigurationRegistry configRegistry, TimeZoneProvider timeZoneProvider)
-
-
Method Details
-
persist
Persists the state of a givenitemthrough the default persistence service.- Parameters:
item- the item to store
-
persist
- Parameters:
item- the item to storeserviceId- the name of thePersistenceServiceto use
-
persist
Persists astateat a giventimestampof anitemthrough the default persistence service.- Parameters:
item- the item to storetimestamp- the date for the item state to be storedstate- the state to be stored
-
persist
public static void persist(Item item, ZonedDateTime timestamp, State state, @Nullable String serviceId) Persists astateat a giventimestampof anitemthrough aPersistenceServiceidentified by theserviceId.- Parameters:
item- the itemtimestamp- the date for the item state to be storedstate- the state to be storedserviceId- the name of thePersistenceServiceto use
-
persist
Persists astateat a giventimestampof anitemthrough the default persistence service.- Parameters:
item- the item to storetimestamp- the date for the item state to be storedstateString- the state to be stored
-
persist
public static void persist(Item item, ZonedDateTime timestamp, String stateString, @Nullable String serviceId) Persists astateat a giventimestampof anitemthrough aPersistenceServiceidentified by theserviceId.- Parameters:
item- the itemtimestamp- the date for the item state to be storedstateString- the state to be storedserviceId- the name of thePersistenceServiceto use
-
persist
Persists atimeSeriesof anitemthrough the default persistence service.- Parameters:
item- the item to storetimeSeries- the timeSeries of states to be stored
-
persist
- Parameters:
item- the itemtimeSeries- the timeSeries of states to be storedserviceId- the name of thePersistenceServiceto use
-
historicState
Deprecated.Retrieves the historic item for a givenitemat a certain point in time through the default persistence service. This method has been deprecated andpersistedState(Item, ZonedDateTime)should be used instead.- Parameters:
item- the item for which to retrieve the historic itemtimestamp- the point in time for which the historic item should be retrieved- Returns:
- the historic item at the given point in time, or
nullif no historic item could be found, the default persistence service is not available or does not refer to aQueryablePersistenceService
-
historicState
@Deprecated public static @Nullable HistoricItem historicState(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Deprecated.Retrieves the historic item for a givenitemat a certain point in time through aPersistenceServiceidentified by theserviceId. This method has been deprecated andpersistedState(Item, ZonedDateTime, String)should be used instead.- Parameters:
item- the item for which to retrieve the historic itemtimestamp- the point in time for which the historic item should be retrievedserviceId- the name of thePersistenceServiceto use- Returns:
- the historic item at the given point in time, or
nullif no historic item could be found or if the providedserviceIddoes not refer to an availableQueryablePersistenceService
-
persistedState
Retrieves the persisted item for a givenitemat a certain point in time through the default persistence service.- Parameters:
item- the item for which to retrieve the persisted itemtimestamp- the point in time for which the persisted item should be retrieved- Returns:
- the historic item at the given point in time, or
nullif no persisted item could be found, the default persistence service is not available or does not refer to aQueryablePersistenceService
-
persistedState
public static @Nullable HistoricItem persistedState(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Retrieves the persisted item for a givenitemat a certain point in time through aPersistenceServiceidentified by theserviceId.- Parameters:
item- the item for which to retrieve the persisted itemtimestamp- the point in time for which the persisted item should be retrievedserviceId- the name of thePersistenceServiceto use- Returns:
- the persisted item at the given point in time, or
nullif no persisted item could be found or if the providedserviceIddoes not refer to an availableQueryablePersistenceService
-
lastUpdate
Query the last historic update time of a givenitem. The default persistence service is used. Note theItem.getLastStateUpdate()is generally preferred to get the last update time of an item.- Parameters:
item- the item for which the last historic update time is to be returned- Returns:
- point in time of the last historic update to
item,nullif there are no historic persisted updates, the state has changed since the last update or the default persistence service is not available or not aQueryablePersistenceService
-
lastUpdate
Query for the last historic update time of a givenitem. Note theItem.getLastStateUpdate()is generally preferred to get the last update time of an item.- Parameters:
item- the item for which the last historic update time is to be returnedserviceId- the name of thePersistenceServiceto use- Returns:
- point in time of the last historic update to
item,nullif there are no historic persisted updates, the state has changed since the last update or if persistence service given byserviceIddoes not refer to an availableQueryablePersistenceService
-
nextUpdate
Query the first future update time of a givenitem. The default persistence service is used.- Parameters:
item- the item for which the first future update time is to be returned- Returns:
- point in time of the first future update to
item, ornullif there are no future persisted updates or the default persistence service is not available or not aQueryablePersistenceService
-
nextUpdate
Query for the first future update time of a givenitem.- Parameters:
item- the item for which the first future update time is to be returnedserviceId- the name of thePersistenceServiceto use- Returns:
- point in time of the first future update to
item, ornullif there are no future persisted updates or if persistence service given byserviceIddoes not refer to an availableQueryablePersistenceService
-
lastChange
Query the last historic change time of a givenitem. The default persistence service is used. Note theItem.getLastStateChange()is generally preferred to get the last state change time of an item.- Parameters:
item- the item for which the last historic change time is to be returned- Returns:
- point in time of the last historic change to
item,nullif there are no historic persisted changes, the state has changed since the last update or the default persistence service is not available or not aQueryablePersistenceService
-
lastChange
Query for the last historic change time of a givenitem. Note theItem.getLastStateChange()is generally preferred to get the last state change time of an item.- Parameters:
item- the item for which the last historic change time is to be returnedserviceId- the name of thePersistenceServiceto use- Returns:
- point in time of the last historic change to
itemnullif there are no historic persisted changes, the state has changed since the last update or if persistence service given byserviceIddoes not refer to an availableQueryablePersistenceService
-
nextChange
Query the first future change time of a givenitem. The default persistence service is used.- Parameters:
item- the item for which the first future change time is to be returned- Returns:
- point in time of the first future change to
item, ornullif there are no future persisted changes or the default persistence service is not available or not aQueryablePersistenceService
-
nextChange
Query for the first future change time of a givenitem.- Parameters:
item- the item for which the first future change time is to be returnedserviceId- the name of thePersistenceServiceto use- Returns:
- point in time of the first future change to
item, ornullif there are no future persisted changes or if persistence service given byserviceIddoes not refer to an availableQueryablePersistenceService
-
previousState
Returns the previous state of a givenitem. Note theItem.getLastState()is generally preferred to get the previous state of an item.- Parameters:
item- the item to get the previous state value for- Returns:
- the previous state or
nullif no previous state could be found, or if the default persistence service is not configured or does not refer to aQueryablePersistenceService
-
previousState
Returns the previous state of a givenitem. Note theItem.getLastState()is generally preferred to get the previous state of an item.- Parameters:
item- the item to get the previous state value forskipEqual- if true, skips equal state values and searches the first state not equal the current state- Returns:
- the previous state or
nullif no previous state could be found, or if the default persistence service is not configured or does not refer to aQueryablePersistenceService
-
previousState
Returns the previous state of a givenitem. ThePersistenceServiceidentified by theserviceIdis used. Note theItem.getLastState()is generally preferred to get the previous state of an item.- Parameters:
item- the item to get the previous state value forserviceId- the name of thePersistenceServiceto use- Returns:
- the previous state or
nullif no previous state could be found, or if the default persistence service is not configured or does not refer to aQueryablePersistenceService
-
previousState
public static @Nullable HistoricItem previousState(Item item, boolean skipEqual, @Nullable String serviceId) Returns the previous state of a givenitem. ThePersistenceServiceidentified by theserviceIdis used. Note theItem.getLastState()is generally preferred to get the previous state of an item.- Parameters:
item- the item to get the previous state value forskipEqual- iftrue, skips equal state values and searches the first state not equal the current stateserviceId- the name of thePersistenceServiceto use- Returns:
- the previous state or
nullif no previous state could be found, or if the givenserviceIdis not available or does not refer to aQueryablePersistenceService
-
nextState
Returns the next state of a givenitem.- Parameters:
item- the item to get the next state value for- Returns:
- the next state or
nullif no next state could be found, or if the default persistence service is not configured or does not refer to aQueryablePersistenceService
-
nextState
Returns the next state of a givenitem.- Parameters:
item- the item to get the next state value forskipEqual- if true, skips equal state values and searches the first state not equal the current state- Returns:
- the next state or
nullif no next state could be found, or if the default persistence service is not configured or does not refer to aQueryablePersistenceService
-
nextState
- Parameters:
item- the item to get the next state value forserviceId- the name of thePersistenceServiceto use- Returns:
- the next state or
nullif no next state could be found, or if the default persistence service is not configured or does not refer to aQueryablePersistenceService
-
nextState
public static @Nullable HistoricItem nextState(Item item, boolean skipEqual, @Nullable String serviceId) - Parameters:
item- the item to get the next state value forskipEqual- iftrue, skips equal state values and searches the first state not equal the current stateserviceId- the name of thePersistenceServiceto use- Returns:
- the next state or
nullif no next state could be found, or if the givenserviceIdis not available or does not refer to aQueryablePersistenceService
-
changedSince
Checks if the state of a givenitemhas changed since a certain point in time. The default persistence service is used.- Parameters:
item- the item to check for state changestimestamp- the point in time to start the check- Returns:
trueif item state has changed,falseif it has not changed,nulliftimestampis in the future, if the default persistence service is not available or does not refer to aQueryablePersistenceService
-
changedUntil
Checks if the state of a givenitemwill change by a certain point in time. The default persistence service is used.- Parameters:
item- the item to check for state changestimestamp- the point in time to end the check- Returns:
trueif item state will change,falseif it will not change,nulliftimestamp>is in the past, if the default persistence service is not available or does not refer to aQueryablePersistenceService
-
changedBetween
Checks if the state of a givenitemchanges between two points in time. The default persistence service is used.- Parameters:
item- the item to check for state changes- Returns:
trueif item state changes,falseif the item does not change in the given interval,nullifbeginis afterend, if the default persistence does not refer to aQueryablePersistenceService, ornullif the default persistence service is not available
-
changedSince
public static @Nullable Boolean changedSince(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Checks if the state of a givenitemhas changed since a certain point in time. ThePersistenceServiceidentified by theserviceIdis used.- Parameters:
item- the item to check for state changestimestamp- the point in time to start the checkserviceId- the name of thePersistenceServiceto use- Returns:
trueif item state has changed, orfalseif it has not changed,nulliftimestampis in the future, if the providedserviceIddoes not refer to an availableQueryablePersistenceService
-
changedUntil
public static @Nullable Boolean changedUntil(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Checks if the state of a givenitemwill change by a certain point in time. ThePersistenceServiceidentified by theserviceIdis used.- Parameters:
item- the item to check for state changestimestamp- the point in time to end the checkserviceId- the name of thePersistenceServiceto use- Returns:
trueif item state will change, orfalseif it will not change,nulliftimestampis in the past, if the providedserviceIddoes not refer to an availableQueryablePersistenceService
-
changedBetween
public static @Nullable Boolean changedBetween(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable String serviceId) Checks if the state of a givenitemchanges between two points in time. ThePersistenceServiceidentified by theserviceIdis used.- Parameters:
item- the item to check for state changesbegin- the point in time to start the checkend- the point in time to stop the checkserviceId- the name of thePersistenceServiceto use- Returns:
trueif item state changed orfalseif the item does not change in the given interval,nullifbeginis afterend, if the givenserviceIddoes not refer to aQueryablePersistenceService
-
updatedSince
Checks if the state of a givenitemhas been updated since a certain point in time. The default persistence service is used.- Parameters:
item- the item to check for state updatestimestamp- the point in time to start the check- Returns:
trueif item state was updated,falseif the item has not been updated sincetimestamp,nulliftimestampis in the future, if the default persistence does not refer to aQueryablePersistenceService, ornullif the default persistence service is not available
-
updatedUntil
Checks if the state of a givenitemwill be updated until a certain point in time. The default persistence service is used.- Parameters:
item- the item to check for state updatestimestamp- the point in time to end the check- Returns:
trueif item state is updated,falseif the item is not updated untiltimestamp,nulliftimestampis in the past, if the default persistence does not refer to aQueryablePersistenceService, ornullif the default persistence service is not available
-
updatedBetween
Checks if the state of a givenitemhas been updated between two points in time. The default persistence service is used.- Parameters:
item- the item to check for state updatesbegin- the point in time to start the checkend- the point in time to stop the check- Returns:
trueif item state was updated,falseif the item has not been updated in the given interval,nullifbeginis afterend, if the default persistence does not refer to aQueryablePersistenceService, ornullif the default persistence service is not available
-
updatedSince
public static @Nullable Boolean updatedSince(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Checks if the state of a givenitemhas been updated since a certain point in time. ThePersistenceServiceidentified by theserviceIdis used.- Parameters:
item- the item to check for state changestimestamp- the point in time to start the checkserviceId- the name of thePersistenceServiceto use- Returns:
trueif item state was updated orfalseif the item has not been updated sincetimestamp,nulliftimestampis in the future, if the givenserviceIddoes not refer to aQueryablePersistenceService
-
updatedUntil
public static @Nullable Boolean updatedUntil(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Checks if the state of a givenitemwill be updated until a certain point in time. ThePersistenceServiceidentified by theserviceIdis used.- Parameters:
item- the item to check for state changestimestamp- the point in time to end the checkserviceId- the name of thePersistenceServiceto use- Returns:
trueif item state was updated orfalseif the item is not updated sincetimestamp,nulliftimestampis in the past, if the givenserviceIddoes not refer to aQueryablePersistenceService
-
updatedBetween
public static @Nullable Boolean updatedBetween(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable String serviceId) Checks if the state of a givenitemis updated between two points in time. ThePersistenceServiceidentified by theserviceIdis used.- Parameters:
item- the item to check for state changesbegin- the point in time to start the checkend- the point in time to stop the checkserviceId- the name of thePersistenceServiceto use- Returns:
trueif item state was updated orfalseif the item is not updated in the given interval,nullifbeginis afterend, if the givenserviceIddoes not refer to aQueryablePersistenceService
-
maximumSince
Gets the historic item with the maximum value of the state of a givenitemsince a certain point in time. The default persistence service is used.- Parameters:
item- the item to get the maximum state value fortimestamp- the point in time to start the check- Returns:
- a historic item with the maximum state value since the given point in time, a
HistoricItemconstructed from theitem's state ifitem's state is the maximum value,nulliftimestampis in the future or if the default persistence service does not refer to aQueryablePersistenceService
-
maximumUntil
Gets the historic item with the maximum value of the state of a givenitemuntil a certain point in time. The default persistence service is used.- Parameters:
item- the item to get the maximum state value fortimestamp- the point in time to end the check- Returns:
- a historic item with the maximum state value until the given point in time, a
HistoricItemconstructed from theitem's state ifitem's state is the maximum value,nulliftimestampis in the past or if the default persistence service does not refer to aQueryablePersistenceService
-
maximumBetween
public static @Nullable HistoricItem maximumBetween(Item item, ZonedDateTime begin, ZonedDateTime end) Gets the historic item with the maximum value of the state of a givenitembetween two points in time. The default persistence service is used.- Parameters:
item- the item to get the maximum state value forbegin- the point in time to start the checkend- the point in time to stop the check- Returns:
- a
HistoricItemwith the maximum state value between two points in time, aHistoricItemconstructed from theitem's state if no persisted states found, ornullifbeginis afterend or if the default persistence service does not refer to an availableQueryablePersistenceService
-
maximumSince
public static @Nullable HistoricItem maximumSince(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the historic item with the maximum value of the state of a givenitemsince a certain point in time. ThePersistenceServiceidentified by theserviceIdis used.- Parameters:
item- the item to get the maximum state value fortimestamp- the point in time to start the checkserviceId- the name of thePersistenceServiceto use- Returns:
- a
HistoricItemwith the maximum state value since the given point in time, aHistoricItemconstructed from theitem's state ifitem's state is the maximum value,nulliftimestampis in the future or if the givenserviceIddoes not refer to an availableQueryablePersistenceService
-
maximumUntil
public static @Nullable HistoricItem maximumUntil(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the historic item with the maximum value of the state of a givenitemuntil a certain point in time. ThePersistenceServiceidentified by theserviceIdis used.- Parameters:
item- the item to get the maximum state value fortimestamp- the point in time to end the checkserviceId- the name of thePersistenceServiceto use- Returns:
- a
HistoricItemwith the maximum state value until the given point in time, aHistoricItemconstructed from theitem's state ifitem's state is the maximum value,nulliftimestampis in the past or if the givenserviceIddoes not refer to an availableQueryablePersistenceService
-
maximumBetween
public static @Nullable HistoricItem maximumBetween(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable String serviceId) Gets the historic item with the maximum value of the state of a givenitembetween two points in time. ThePersistenceServiceidentified by theserviceIdis used.- Parameters:
item- the item to get the maximum state value forbegin- the point in time to start the checkend- the point in time to stop the checkserviceId- the name of thePersistenceServiceto use- Returns:
- a
HistoricItemwith the maximum state value between two points in time, aHistoricItemconstructed from theitem's state if no persisted states found, ornullifbeginis afterend or if the givenserviceIddoes not refer to an availableQueryablePersistenceService
-
minimumSince
Gets the historic item with the minimum value of the state of a givenitemsince a certain point in time. The default persistence service is used.- Parameters:
item- the item to get the minimum state value fortimestamp- the point in time from which to search for the minimum state value- Returns:
- a historic item with the minimum state value since the given point in time, a
HistoricItemconstructed from theitem's state ifitem's state is the minimum value,nulliftimestampis in the future or if the default persistence service does not refer to aQueryablePersistenceService
-
minimumUntil
Gets the historic item with the minimum value of the state of a givenitemuntil a certain point in time. The default persistence service is used.- Parameters:
item- the item to get the minimum state value fortimestamp- the point in time to which to search for the minimum state value- Returns:
- a historic item with the minimum state value until the given point in time, a
HistoricItemconstructed from theitem's state ifitem's state is the minimum value,nulliftimestampis in the past or if the default persistence service does not refer to aQueryablePersistenceService
-
minimumBetween
public static @Nullable HistoricItem minimumBetween(Item item, ZonedDateTime begin, ZonedDateTime end) Gets the historic item with the minimum value of the state of a givenitembetween two certain points in time. The default persistence service is used.- Parameters:
item- the item to get the minimum state value forbegin- the beginning point in timeend- the ending point in time to- Returns:
- a
HistoricItemwith the minimum state value between two points in time, aHistoricItemconstructed from theitem's state if no persisted states found, ornullifbeginis afterend or if the default persistence service does not refer to an availableQueryablePersistenceService
-
minimumSince
public static @Nullable HistoricItem minimumSince(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the historic item with the minimum value of the state of a givenitemsince a certain point in time. ThePersistenceServiceidentified by theserviceIdis used.- Parameters:
item- the item to get the minimum state value fortimestamp- the point in time from which to search for the minimum state valueserviceId- the name of thePersistenceServiceto use- Returns:
- a
HistoricItemwith the minimum state value since the given point in time, aHistoricItemconstructed from theitem's state ifitem's state is the minimum value,nulliftimestampis in the future or if the givenserviceIddoes not refer to an availableQueryablePersistenceService
-
minimumUntil
public static @Nullable HistoricItem minimumUntil(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the historic item with the minimum value of the state of a givenitemuntil a certain point in time. ThePersistenceServiceidentified by theserviceIdis used.- Parameters:
item- the item to get the minimum state value fortimestamp- the point in time to which to search for the minimum state valueserviceId- the name of thePersistenceServiceto use- Returns:
- a
HistoricItemwith the minimum state value until the given point in time, aHistoricItemconstructed from theitem's state ifitem's state is the minimum value,nulliftimestampis in the past or if the givenserviceIddoes not refer to an availableQueryablePersistenceService
-
minimumBetween
public static @Nullable HistoricItem minimumBetween(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable String serviceId) Gets the historic item with the minimum value of the state of a givenitembetween two certain points in time. ThePersistenceServiceidentified by theserviceIdis used.- Parameters:
item- the item to get the minimum state value forbegin- the beginning point in timeend- the end point in time toserviceId- the name of thePersistenceServiceto use- Returns:
- a
HistoricItemwith the minimum state value between two points in time, aHistoricItemconstructed from theitem's state if no persisted states found, ornullifbeginis afterend or if the givenserviceIddoes not refer to an availableQueryablePersistenceService
-
varianceSince
Gets the variance of the state of the givenItemsince a certain point in time. A left approximation type is used for the Riemann sum. The defaultPersistenceServiceis used.- Parameters:
item- theItemto get the variance fortimestamp- the point in time from which to compute the variance- Returns:
- the variance between then and now, or
nulliftimestampis in the future, if there is no default persistence service available, or it is not aQueryablePersistenceService, or if there is no persisted state for the givenitemat the giventimestamp
-
varianceSince
public static @Nullable State varianceSince(Item item, ZonedDateTime timestamp, @Nullable PersistenceExtensions.RiemannType type) Gets the variance of the state of the givenItemsince a certain point in time. The defaultPersistenceServiceis used.- Parameters:
item- theItemto get the variance fortimestamp- the point in time from which to compute the variancetype- LEFT, RIGHT, MIDPOINT or TRAPEZOIDAL representing approximation types for Riemann sums- Returns:
- the variance between then and now, or
nulliftimestampis in the future, if there is no default persistence service available, or it is not aQueryablePersistenceService, or if there is no persisted state for the givenitemat the giventimestamp
-
varianceUntil
Gets the variance of the state of the givenItemuntil a certain point in time. A left approximation type is used for the Riemann sum. The defaultPersistenceServiceis used.- Parameters:
item- theItemto get the variance fortimestamp- the point in time to which to compute the variance- Returns:
- the variance between now and then, or
nulliftimestampis in the past, if there is no default persistence service available, or it is not aQueryablePersistenceService, or if there is no persisted state for the givenitemat the giventimestamp
-
varianceUntil
public static @Nullable State varianceUntil(Item item, ZonedDateTime timestamp, @Nullable PersistenceExtensions.RiemannType type) Gets the variance of the state of the givenItemuntil a certain point in time. The defaultPersistenceServiceis used.- Parameters:
item- theItemto get the variance fortimestamp- the point in time to which to compute the variancetype- LEFT, RIGHT, MIDPOINT or TRAPEZOIDAL representing approximation types for Riemann sums- Returns:
- the variance between now and then, or
nulliftimestampis in the past, if there is no default persistence service available, or it is not aQueryablePersistenceService, or if there is no persisted state for the givenitemat the giventimestamp
-
varianceBetween
public static @Nullable State varianceBetween(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable String serviceId) Gets the variance of the state of the givenItembetween two points in time. A left approximation type is used for the Riemann sum. ThePersistenceServiceidentified by theserviceIdis used.- Parameters:
item- theItemto get the variance forbegin- the point in time from which to computeend- the end time for the computationserviceId- the name of thePersistenceServiceto use- Returns:
- the variance between both points of time, or
nullifbeginis afterend, if the persistence service given byserviceIdis not available, or it is not aQueryablePersistenceService, or it is not aQueryablePersistenceService, or if there is no persisted state for the givenitembetweenbeginandend
-
varianceBetween
public static @Nullable State varianceBetween(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable PersistenceExtensions.RiemannType type) Gets the variance of the state of the givenItembetween two certain point in time. The defaultPersistenceServiceis used.- Parameters:
item- theItemto get the variance forbegin- the point in time from which to compute the varianceend- the end time for the computationtype- LEFT, RIGHT, MIDPOINT or TRAPEZOIDAL representing approximation types for Riemann sums- Returns:
- the variance between both points of time, or
nullifbeginis afterend, if there is no default persistence service available, or it is not aQueryablePersistenceService, or if there is no persisted state for the givenitembetweenbeginandend
-
varianceSince
public static @Nullable State varianceSince(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the variance of the state of the givenItemsince a certain point in time. A left approximation type is used for the Riemann sum. ThePersistenceServiceidentified by theserviceIdis used.- Parameters:
item- theItemto get the variance fortimestamp- the point in time from which to compute the varianceserviceId- the name of thePersistenceServiceto use- Returns:
- the variance between then and now, or
nulliftimestampis in the future, if the persistence service given byserviceIdis not available, or it is not aQueryablePersistenceService, or if there is no persisted state for the givenitemat the giventimestamp
-
varianceSince
public static @Nullable State varianceSince(Item item, ZonedDateTime timestamp, @Nullable PersistenceExtensions.RiemannType type, @Nullable String serviceId) Gets the variance of the state of the givenItemsince a certain point in time. ThePersistenceServiceidentified by theserviceIdis used.- Parameters:
item- theItemto get the variance fortimestamp- the point in time from which to compute the variancetype- LEFT, RIGHT, MIDPOINT or TRAPEZOIDAL representing approximation types for Riemann sumsserviceId- the name of thePersistenceServiceto use- Returns:
- the variance between then and now, or
nulliftimestampis in the future, if the persistence service given byserviceIdis not available, or it is not aQueryablePersistenceService, or if there is no persisted state for the givenitemat the giventimestamp
-
varianceUntil
public static @Nullable State varianceUntil(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the variance of the state of the givenItemuntil a certain point in time. A left approximation type is used for the Riemann sum. ThePersistenceServiceidentified by theserviceIdis used.- Parameters:
item- theItemto get the variance fortimestamp- the point in time to which to compute the varianceserviceId- the name of thePersistenceServiceto use- Returns:
- the variance between now and then, or
nulliftimestampis in the past, if the persistence service given byserviceIdis not available, or it is not aQueryablePersistenceService, or if there is no persisted state for the givenitemat the giventimestamp
-
varianceUntil
public static @Nullable State varianceUntil(Item item, ZonedDateTime timestamp, @Nullable PersistenceExtensions.RiemannType type, @Nullable String serviceId) Gets the variance of the state of the givenItemuntil a certain point in time. ThePersistenceServiceidentified by theserviceIdis used.- Parameters:
item- theItemto get the variance fortimestamp- the point in time to which to compute the variancetype- LEFT, RIGHT, MIDPOINT or TRAPEZOIDAL representing approximation types for Riemann sumsserviceId- the name of thePersistenceServiceto use- Returns:
- the variance between now and then, or
nulliftimestampis in the past, if the persistence service given byserviceIdis not available, or it is not aQueryablePersistenceService, or if there is no persisted state for the givenitemat the giventimestamp
-
varianceBetween
Gets the variance of the state of the givenItembetween two certain point in time. A left approximation type is used for the Riemann sum. The defaultPersistenceServiceis used.- Parameters:
item- theItemto get the variance forbegin- the point in time from which to compute the varianceend- the end time for the computation- Returns:
- the variance between both points of time, or
nullifbeginis afterend, if there is no default persistence service available, or it is not aQueryablePersistenceService, or if there is no persisted state for the givenitembetweenbeginandend
-
varianceBetween
public static @Nullable State varianceBetween(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable PersistenceExtensions.RiemannType type, @Nullable String serviceId) Gets the variance of the state of the givenItembetween two points in time. ThePersistenceServiceidentified by theserviceIdis used.- Parameters:
item- theItemto get the variance forbegin- the point in time from which to computeend- the end time for the computationtype- LEFT, RIGHT, MIDPOINT or TRAPEZOIDAL representing approximation types for Riemann sumsserviceId- the name of thePersistenceServiceto use- Returns:
- the variance between both points of time, or
nullifbeginis afterend, if the persistence service given byserviceIdis not available, or it is not aQueryablePersistenceService, or it is not aQueryablePersistenceService, or if there is no persisted state for the givenitembetweenbeginandend
-
deviationSince
Gets the standard deviation of the state of the givenItemsince a certain point in time. A left approximation type is used for the Riemann sum. The defaultPersistenceServiceis used. Note: If you need variance and standard deviation at the same time do not query both as it is a costly operation. Get the variance only, it is the squared deviation.- Parameters:
item- theItemto get the standard deviation fortimestamp- the point in time from which to compute the standard deviation- Returns:
- the standard deviation between then and now, or
nulliftimestampis in the future, if there is no default persistence service available, or it is not aQueryablePersistenceService, or if there is no persisted state for the givenitemat the giventimestamp
-
deviationSince
public static @Nullable State deviationSince(Item item, ZonedDateTime timestamp, @Nullable PersistenceExtensions.RiemannType type) Gets the standard deviation of the state of the givenItemsince a certain point in time. The defaultPersistenceServiceis used. Note: If you need variance and standard deviation at the same time do not query both as it is a costly operation. Get the variance only, it is the squared deviation.- Parameters:
item- theItemto get the standard deviation fortimestamp- the point in time from which to compute the standard deviationtype- LEFT, RIGHT, MIDPOINT or TRAPEZOIDAL representing approximation types for Riemann sums- Returns:
- the standard deviation between then and now, or
nulliftimestampis in the future, if there is no default persistence service available, or it is not aQueryablePersistenceService, or if there is no persisted state for the givenitemat the giventimestamp
-
deviationUntil
Gets the standard deviation of the state of the givenItemuntil a certain point in time. A left approximation type is used for the Riemann sum. The defaultPersistenceServiceis used. Note: If you need variance and standard deviation at the same time do not query both as it is a costly operation. Get the variance only, it is the squared deviation.- Parameters:
item- theItemto get the standard deviation fortimestamp- the point in time to which to compute the standard deviation- Returns:
- the standard deviation between now and then, or
nulliftimestampis in the past, if there is no default persistence service available, or it is not aQueryablePersistenceService, or if there is no persisted state for the givenitemat the giventimestamp
-
deviationUntil
public static @Nullable State deviationUntil(Item item, ZonedDateTime timestamp, @Nullable PersistenceExtensions.RiemannType type) Gets the standard deviation of the state of the givenItemuntil a certain point in time. The defaultPersistenceServiceis used. Note: If you need variance and standard deviation at the same time do not query both as it is a costly operation. Get the variance only, it is the squared deviation.- Parameters:
item- theItemto get the standard deviation fortimestamp- the point in time to which to compute the standard deviationtype- LEFT, RIGHT, MIDPOINT or TRAPEZOIDAL representing approximation types for Riemann sums- Returns:
- the standard deviation between now and then, or
nulliftimestampis in the past, if there is no default persistence service available, or it is not aQueryablePersistenceService, or if there is no persisted state for the givenitemat the giventimestamp
-
deviationBetween
Gets the standard deviation of the state of the givenItembetween two points in time. A left approximation type is used for the Riemann sum. The defaultPersistenceServiceis used. Note: If you need variance and standard deviation at the same time do not query both as it is a costly operation. Get the variance only, it is the squared deviation.- Parameters:
item- theItemto get the standard deviation forbegin- the point in time from which to computeend- the end time for the computation- Returns:
- the standard deviation between both points of time, or
nullifbeginis afterend, if there is no default persistence service available, or it is not aQueryablePersistenceService, or if there is no persisted state for the givenitembetweenbeginandend
-
deviationBetween
public static @Nullable State deviationBetween(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable PersistenceExtensions.RiemannType type) Gets the standard deviation of the state of the givenItembetween two points in time. The defaultPersistenceServiceis used. Note: If you need variance and standard deviation at the same time do not query both as it is a costly operation. Get the variance only, it is the squared deviation.- Parameters:
item- theItemto get the standard deviation forbegin- the point in time from which to computeend- the end time for the computationtype- LEFT, RIGHT, MIDPOINT or TRAPEZOIDAL representing approximation types for Riemann sums- Returns:
- the standard deviation between both points of time, or
nullifbeginis afterend, if there is no default persistence service available, or it is not aQueryablePersistenceService, or if there is no persisted state for the givenitembetweenbeginandend
-
deviationSince
public static @Nullable State deviationSince(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the standard deviation of the state of the givenItemsince a certain point in time. A left approximation type is used for the Riemann sum. ThePersistenceServiceidentified by theserviceIdis used. Note: If you need variance and standard deviation at the same time do not query both as it is a costly operation. Get the variance only, it is the squared deviation.- Parameters:
item- theItemto get the standard deviation fortimestamp- the point in time from which to compute the standard deviationserviceId- the name of thePersistenceServiceto use- Returns:
- the standard deviation between then and now, or
nulliftimestampis in the future, if the persistence service given byserviceIdis not available, or it is not aQueryablePersistenceService, or if there is no persisted state for the givenitemat the giventimestamp
-
deviationSince
public static @Nullable State deviationSince(Item item, ZonedDateTime timestamp, @Nullable PersistenceExtensions.RiemannType type, @Nullable String serviceId) Gets the standard deviation of the state of the givenItemsince a certain point in time. ThePersistenceServiceidentified by theserviceIdis used. Note: If you need variance and standard deviation at the same time do not query both as it is a costly operation. Get the variance only, it is the squared deviation.- Parameters:
item- theItemto get the standard deviation fortimestamp- the point in time from which to compute the standard deviationtype- LEFT, RIGHT, MIDPOINT or TRAPEZOIDAL representing approximation types for Riemann sumsserviceId- the name of thePersistenceServiceto use- Returns:
- the standard deviation between then and now, or
nulliftimestampis in the future, if the persistence service given byserviceIdis not available, or it is not aQueryablePersistenceService, or if there is no persisted state for the givenitemat the giventimestamp
-
deviationUntil
public static @Nullable State deviationUntil(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the standard deviation of the state of the givenItemuntil a certain point in time. A left approximation type is used for the Riemann sum. ThePersistenceServiceidentified by theserviceIdis used. Note: If you need variance and standard deviation at the same time do not query both as it is a costly operation. Get the variance only, it is the squared deviation.- Parameters:
item- theItemto get the standard deviation fortimestamp- the point in time to which to compute the standard deviationserviceId- the name of thePersistenceServiceto use- Returns:
- the standard deviation between now and then, or
nulliftimestampis in the past, if the persistence service given byserviceIdis not available, or it is not aQueryablePersistenceService, or if there is no persisted state for the givenitemat the giventimestamp
-
deviationUntil
public static @Nullable State deviationUntil(Item item, ZonedDateTime timestamp, @Nullable PersistenceExtensions.RiemannType type, @Nullable String serviceId) Gets the standard deviation of the state of the givenItemuntil a certain point in time. ThePersistenceServiceidentified by theserviceIdis used. Note: If you need variance and standard deviation at the same time do not query both as it is a costly operation. Get the variance only, it is the squared deviation.- Parameters:
item- theItemto get the standard deviation fortimestamp- the point in time to which to compute the standard deviationtype- LEFT, RIGHT, MIDPOINT or TRAPEZOIDAL representing approximation types for Riemann sumsserviceId- the name of thePersistenceServiceto use- Returns:
- the standard deviation between now and then, or
nulliftimestampis in the past, if the persistence service given byserviceIdis not available, or it is not aQueryablePersistenceService, or if there is no persisted state for the givenitemat the giventimestamp
-
deviationBetween
public static @Nullable State deviationBetween(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable String serviceId) Gets the standard deviation of the state of the givenItembetween two points in time. A left approximation type is used for the Riemann sum. ThePersistenceServiceidentified by theserviceIdis used. Note: If you need variance and standard deviation at the same time do not query both as it is a costly operation. Get the variance only, it is the squared deviation.- Parameters:
item- theItemto get the standard deviation forbegin- the point in time from which to computeend- the end time for the computationserviceId- the name of thePersistenceServiceto use- Returns:
- the standard deviation between both points of time, or
nullifbeginis afterend, if the persistence service given byserviceIdis not available, or it is not aQueryablePersistenceService, or it is not aQueryablePersistenceService, or if there is no persisted state for the givenitembetweenbeginandend
-
deviationBetween
public static @Nullable State deviationBetween(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable PersistenceExtensions.RiemannType type, @Nullable String serviceId) Gets the standard deviation of the state of the givenItembetween two points in time. ThePersistenceServiceidentified by theserviceIdis used. Note: If you need variance and standard deviation at the same time do not query both as it is a costly operation. Get the variance only, it is the squared deviation.- Parameters:
item- theItemto get the standard deviation forbegin- the point in time from which to computeend- the end time for the computationtype- LEFT, RIGHT, MIDPOINT or TRAPEZOIDAL representing approximation types for Riemann sumsserviceId- the name of thePersistenceServiceto use- Returns:
- the standard deviation between both points of time, or
nullifbeginis afterend, if the persistence service given byserviceIdis not available, or it is not aQueryablePersistenceService, or it is not aQueryablePersistenceService, or if there is no persisted state for the givenitembetweenbeginandend
-
averageSince
Gets the average value of the state of a givenItemsince a certain point in time. A left approximation type is used for the Riemann sum. The defaultPersistenceServiceis used.- Parameters:
item- theItemto get the average value fortimestamp- the point in time from which to search for the average value- Returns:
- the average value since
timestampornullif no previous states could be found or if the default persistence service does not refer to an availableQueryablePersistenceService. The current state is included in the calculation.
-
averageSince
public static @Nullable State averageSince(Item item, ZonedDateTime timestamp, @Nullable PersistenceExtensions.RiemannType type) Gets the average value of the state of a givenItemsince a certain point in time. The defaultPersistenceServiceis used.- Parameters:
item- theItemto get the average value fortimestamp- the point in time from which to search for the average valuetype- LEFT, RIGHT, MIDPOINT or TRAPEZOIDAL representing approximation types for Riemann sums- Returns:
- the average value since
timestampornullif no previous states could be found or if the default persistence service does not refer to an availableQueryablePersistenceService. The current state is included in the calculation.
-
averageUntil
Gets the average value of the state of a givenItemuntil a certain point in time. A left approximation type is used for the Riemann sum. The defaultPersistenceServiceis used.- Parameters:
item- theItemto get the average value fortimestamp- the point in time to which to search for the average value- Returns:
- the average value until
timestampornullif no future states could be found or if the default persistence service does not refer to an availableQueryablePersistenceService. The current state is included in the calculation.
-
averageUntil
public static @Nullable State averageUntil(Item item, ZonedDateTime timestamp, @Nullable PersistenceExtensions.RiemannType type) Gets the average value of the state of a givenItemuntil a certain point in time. The defaultPersistenceServiceis used.- Parameters:
item- theItemto get the average value fortimestamp- the point in time to which to search for the average valuetype- LEFT, RIGHT, MIDPOINT or TRAPEZOIDAL representing approximation types for Riemann sums- Returns:
- the average value until
timestampornullif no future states could be found or if the default persistence service does not refer to an availableQueryablePersistenceService. The current state is included in the calculation.
-
averageBetween
Gets the average value of the state of a givenItembetween two certain points in time. A left approximation type is used for the Riemann sum. The defaultPersistenceServiceis used.- Parameters:
item- theItemto get the average value forbegin- the point in time from which to start the summationend- the point in time to which to start the summation- Returns:
- the average value between
beginandendornullif no states could be found or if the default persistence service does not refer to an availableQueryablePersistenceService.
-
averageBetween
public static @Nullable State averageBetween(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable PersistenceExtensions.RiemannType type) Gets the average value of the state of a givenItembetween two certain points in time. The defaultPersistenceServiceis used.- Parameters:
item- theItemto get the average value forbegin- the point in time from which to start the summationend- the point in time to which to start the summationtype- LEFT, RIGHT, MIDPOINT or TRAPEZOIDAL representing approximation types for Riemann sums- Returns:
- the average value between
beginandendornullif no states could be found or if the default persistence service does not refer to an availableQueryablePersistenceService.
-
averageSince
public static @Nullable State averageSince(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the average value of the state of a givenItemsince a certain point in time. A left approximation type is used for the Riemann sum. ThePersistenceServiceidentified by theserviceIdis used.- Parameters:
item- theItemto get the average value fortimestamp- the point in time from which to search for the average valueserviceId- the name of thePersistenceServiceto use- Returns:
- the average value since
timestamp, ornullif no previous states could be found or if the persistence service given byserviceIddoes not refer to an availableQueryablePersistenceService. The current state is included in the calculation.
-
averageSince
public static @Nullable State averageSince(Item item, ZonedDateTime timestamp, @Nullable PersistenceExtensions.RiemannType type, @Nullable String serviceId) Gets the average value of the state of a givenItemsince a certain point in time. ThePersistenceServiceidentified by theserviceIdis used.- Parameters:
item- theItemto get the average value fortimestamp- the point in time from which to search for the average valuetype- LEFT, RIGHT, MIDPOINT or TRAPEZOIDAL representing approximation types for Riemann sumsserviceId- the name of thePersistenceServiceto use- Returns:
- the average value since
timestamp, ornullif no previous states could be found or if the persistence service given byserviceIddoes not refer to an availableQueryablePersistenceService. The current state is included in the calculation.
-
averageUntil
public static @Nullable State averageUntil(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the average value of the state of a givenItemuntil a certain point in time. A left approximation type is used for the Riemann sum. ThePersistenceServiceidentified by theserviceIdis used.- Parameters:
item- theItemto get the average value fortimestamp- the point in time to which to search for the average valueserviceId- the name of thePersistenceServiceto use- Returns:
- the average value until
timestamp, ornullif no future states could be found or if the persistence service given byserviceIddoes not refer to an availableQueryablePersistenceService. The current state is included in the calculation.
-
averageUntil
public static @Nullable State averageUntil(Item item, ZonedDateTime timestamp, @Nullable PersistenceExtensions.RiemannType type, @Nullable String serviceId) Gets the average value of the state of a givenItemuntil a certain point in time. ThePersistenceServiceidentified by theserviceIdis used.- Parameters:
item- theItemto get the average value fortimestamp- the point in time to which to search for the average valuetype- LEFT, RIGHT, MIDPOINT or TRAPEZOIDAL representing approximation types for Riemann sumsserviceId- the name of thePersistenceServiceto use- Returns:
- the average value until
timestamp, ornullif no future states could be found or if the persistence service given byserviceIddoes not refer to an availableQueryablePersistenceService. The current state is included in the calculation.
-
averageBetween
public static @Nullable State averageBetween(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable String serviceId) Gets the average value of the state of a givenItembetween two certain points in time. A left approximation type is used for the Riemann sum. ThePersistenceServiceidentified by theserviceIdis used.- Parameters:
item- theItemto get the average value forbegin- the point in time from which to start the summationend- the point in time to which to start the summationserviceId- the name of thePersistenceServiceto use- Returns:
- the average value between
beginandend, ornullif no states could be found or if the persistence service given byserviceIddoes not refer to an availableQueryablePersistenceService
-
averageBetween
public static @Nullable State averageBetween(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable PersistenceExtensions.RiemannType type, @Nullable String serviceId) Gets the average value of the state of a givenItembetween two certain points in time. ThePersistenceServiceidentified by theserviceIdis used.- Parameters:
item- theItemto get the average value forbegin- the point in time from which to start the summationend- the point in time to which to start the summationtype- LEFT, RIGHT, MIDPOINT or TRAPEZOIDAL representing approximation types for Riemann sumsserviceId- the name of thePersistenceServiceto use- Returns:
- the average value between
beginandend, ornullif no states could be found or if the persistence service given byserviceIddoes not refer to an availableQueryablePersistenceService
-
riemannSumSince
Gets the Riemann sum of the states of a givenItemsince a certain point in time. This can be used as an approximation for integrating the curve represented by discrete values. A left approximation type is used for the Riemann sum. The time dimension in the result is in seconds, therefore if you do not use QuantityType results, you may have to multiply or divide to get the result in the expected scale. The defaultPersistenceServiceis used.- Parameters:
item- theItemto get the riemannSum value fortimestamp- the point in time from which to search for the riemannSum value- Returns:
- the Riemann sum since
timestampornullif no previous states could be found or if the default persistence service does not refer to an availableQueryablePersistenceService. The current state is included in the calculation.
-
riemannSumSince
public static @Nullable State riemannSumSince(Item item, ZonedDateTime timestamp, @Nullable PersistenceExtensions.RiemannType type) Gets the Riemann sum of the states of a givenItemsince a certain point in time. This can be used as an approximation for integrating the curve represented by discrete values. The time dimension in the result is in seconds, therefore if you do not use QuantityType results, you may have to multiply or divide to get the result in the expected scale. The defaultPersistenceServiceis used.- Parameters:
item- theItemto get the riemannSum value fortimestamp- the point in time from which to search for the riemannSum valuetype- LEFT, RIGHT, MIDPOINT or TRAPEZOIDAL representing approximation types for Riemann sums- Returns:
- the Riemann sum since
timestampornullif no previous states could be found or if the default persistence service does not refer to an availableQueryablePersistenceService. The current state is included in the calculation.
-
riemannSumUntil
Gets the Riemann sum of the states of a givenItemuntil a certain point in time. This can be used as an approximation for integrating the curve represented by discrete values. A left approximation type is used for the Riemann sum. The time dimension in the result is in seconds, therefore if you do not use QuantityType results, you may have to multiply or divide to get the result in the expected scale. The defaultPersistenceServiceis used.- Parameters:
item- theItemto get the riemannSum value fortimestamp- the point in time to which to search for the riemannSum value- Returns:
- the Riemann sum until
timestampornullif no future states could be found or if the default persistence service does not refer to an availableQueryablePersistenceService. The current state is included in the calculation.
-
riemannSumUntil
public static @Nullable State riemannSumUntil(Item item, ZonedDateTime timestamp, @Nullable PersistenceExtensions.RiemannType type) Gets the Riemann sum of the states of a givenItemuntil a certain point in time. This can be used as an approximation for integrating the curve represented by discrete values. The time dimension in the result is in seconds, therefore if you do not use QuantityType results, you may have to multiply or divide to get the result in the expected scale. The defaultPersistenceServiceis used.- Parameters:
item- theItemto get the riemannSum value fortimestamp- the point in time to which to search for the riemannSum valuetype- LEFT, RIGHT, MIDPOINT or TRAPEZOIDAL representing approximation types for Riemann sums- Returns:
- the Riemann sum until
timestampornullif no future states could be found or if the default persistence service does not refer to an availableQueryablePersistenceService. The current state is included in the calculation.
-
riemannSumBetween
Gets the Riemann sum of the states of a givenItembetween two certain points in time. This can be used as an approximation for integrating the curve represented by discrete values. A left approximation type is used for the Riemann sum. The time dimension in the result is in seconds, therefore if you do not use QuantityType results, you may have to multiply or divide to get the result in the expected scale. The defaultPersistenceServiceis used.- Parameters:
item- theItemto get the riemannSum value forbegin- the point in time from which to start the summationend- the point in time to which to start the summation- Returns:
- the Riemann sum between
beginandendornullif no states could be found or if the default persistence service does not refer to an availableQueryablePersistenceService.
-
riemannSumBetween
public static @Nullable State riemannSumBetween(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable PersistenceExtensions.RiemannType type) Gets the Riemann sum of the states of a givenItembetween two certain points in time. This can be used as an approximation for integrating the curve represented by discrete values. The time dimension in the result is in seconds, therefore if you do not use QuantityType results, you may have to multiply or divide to get the result in the expected scale. The defaultPersistenceServiceis used.- Parameters:
item- theItemto get the riemannSum value forbegin- the point in time from which to start the summationend- the point in time to which to start the summationtype- LEFT, RIGHT, MIDPOINT or TRAPEZOIDAL representing approximation types for Riemann sums- Returns:
- the Riemann sum between
beginandendornullif no states could be found or if the default persistence service does not refer to an availableQueryablePersistenceService.
-
riemannSumSince
public static @Nullable State riemannSumSince(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the Riemann sum of the states of a givenItemsince a certain point in time. This can be used as an approximation for integrating the curve represented by discrete values. A left approximation type is used for the Riemann sum. The time dimension in the result is in seconds, therefore if you do not use QuantityType results, you may have to multiply or divide to get the result in the expected scale. ThePersistenceServiceidentified by theserviceIdis used.- Parameters:
item- theItemto get the riemannSum value fortimestamp- the point in time from which to search for the riemannSum valueserviceId- the name of thePersistenceServiceto use- Returns:
- the Riemann sum since
timestamp, ornullif no previous states could be found or if the persistence service given byserviceIddoes not refer to an availableQueryablePersistenceService. The current state is included in the calculation.
-
riemannSumSince
public static @Nullable State riemannSumSince(Item item, ZonedDateTime timestamp, @Nullable PersistenceExtensions.RiemannType type, @Nullable String serviceId) Gets the Riemann sum of the states of a givenItemsince a certain point in time. This can be used as an approximation for integrating the curve represented by discrete values. The time dimension in the result is in seconds, therefore if you do not use QuantityType results, you may have to multiply or divide to get the result in the expected scale. ThePersistenceServiceidentified by theserviceIdis used.- Parameters:
item- theItemto get the riemannSum value fortimestamp- the point in time from which to search for the riemannSum valuetype- LEFT, RIGHT, MIDPOINT or TRAPEZOIDAL representing approximation types for Riemann sumsserviceId- the name of thePersistenceServiceto use- Returns:
- the Riemann sum since
timestamp, ornullif no previous states could be found or if the persistence service given byserviceIddoes not refer to an availableQueryablePersistenceService. The current state is included in the calculation.
-
riemannSumUntil
public static @Nullable State riemannSumUntil(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the Riemann sum of the states of a givenItemuntil a certain point in time. This can be used as an approximation for integrating the curve represented by discrete values. A left approximation type is used for the Riemann sum. The time dimension in the result is in seconds, therefore if you do not use QuantityType results, you may have to multiply or divide to get the result in the expected scale. ThePersistenceServiceidentified by theserviceIdis used.- Parameters:
item- theItemto get the riemannSum value fortimestamp- the point in time to which to search for the riemannSum valueserviceId- the name of thePersistenceServiceto use- Returns:
- the Riemann sum until
timestamp, ornullif no future states could be found or if the persistence service given byserviceIddoes not refer to an availableQueryablePersistenceService. The current state is included in the calculation.
-
riemannSumUntil
public static @Nullable State riemannSumUntil(Item item, ZonedDateTime timestamp, @Nullable PersistenceExtensions.RiemannType type, @Nullable String serviceId) Gets the Riemann sum of the states of a givenItemuntil a certain point in time. This can be used as an approximation for integrating the curve represented by discrete values. The time dimension in the result is in seconds, therefore if you do not use QuantityType results, you may have to multiply or divide to get the result in the expected scale. ThePersistenceServiceidentified by theserviceIdis used.- Parameters:
item- theItemto get the riemannSum value fortimestamp- the point in time to which to search for the riemannSum valuetype- LEFT, RIGHT, MIDPOINT or TRAPEZOIDAL representing approximation types for Riemann sumsserviceId- the name of thePersistenceServiceto use- Returns:
- the Riemann sum until
timestamp, ornullif no future states could be found or if the persistence service given byserviceIddoes not refer to an availableQueryablePersistenceService. The current state is included in the calculation.
-
riemannSumBetween
public static @Nullable State riemannSumBetween(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable String serviceId) Gets the Riemann sum of the states of a givenItembetween two certain points in time. This can be used as an approximation for integrating the curve represented by discrete values. A left approximation type is used for the Riemann sum. The time dimension in the result is in seconds, therefore if you do not use QuantityType results, you may have to multiply or divide to get the result in the expected scale. ThePersistenceServiceidentified by theserviceIdis used.- Parameters:
item- theItemto get the riemannSum value forbegin- the point in time from which to start the summationend- the point in time to which to start the summationserviceId- the name of thePersistenceServiceto use- Returns:
- the Riemann sum between
beginandend, ornullif no states could be found or if the persistence service given byserviceIddoes not refer to an availableQueryablePersistenceService
-
riemannSumBetween
public static @Nullable State riemannSumBetween(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable PersistenceExtensions.RiemannType type, @Nullable String serviceId) Gets the Riemann sum of the states of a givenItembetween two certain points in time. This can be used as an approximation for integrating the curve represented by discrete values. The time dimension in the result is in seconds, therefore if you do not use QuantityType results, you may have to multiply or divide to get the result in the expected scale. ThePersistenceServiceidentified by theserviceIdis used.- Parameters:
item- theItemto get the riemannSum value forbegin- the point in time from which to start the summationend- the point in time to which to start the summationtype- LEFT, RIGHT, MIDPOINT or TRAPEZOIDAL representing approximation types for Riemann sumsserviceId- the name of thePersistenceServiceto use- Returns:
- the Riemann sum between
beginandend, ornullif no states could be found or if the persistence service given byserviceIddoes not refer to an availableQueryablePersistenceService
-
medianSince
Gets the median value of the state of a givenItemsince a certain point in time. The defaultPersistenceServiceis used.- Parameters:
item- theItemto get the median value fortimestamp- the point in time from which to search for the median value- Returns:
- the median value since
timestampornullif no previous states could be found or if the default persistence service does not refer to an availableQueryablePersistenceService. The current state is included in the calculation.
-
medianUntil
Gets the median value of the state of a givenItemuntil a certain point in time. The defaultPersistenceServiceis used.- Parameters:
item- theItemto get the median value fortimestamp- the point in time to which to search for the median value- Returns:
- the median value until
timestampornullif no future states could be found or if the default persistence service does not refer to an availableQueryablePersistenceService. The current state is included in the calculation.
-
medianBetween
Gets the median value of the state of a givenItembetween two certain points in time. The defaultPersistenceServiceis used.- Parameters:
item- theItemto get the median value forbegin- the point in time from which to start the summationend- the point in time to which to start the summation- Returns:
- the median value between
beginandendornullif no states could be found or if the default persistence service does not refer to an availableQueryablePersistenceService.
-
medianSince
public static @Nullable State medianSince(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the median value of the state of a givenItemsince a certain point in time. ThePersistenceServiceidentified by theserviceIdis used.- Parameters:
item- theItemto get the median value fortimestamp- the point in time from which to search for the median valueserviceId- the name of thePersistenceServiceto use- Returns:
- the median value since
timestamp, ornullif no previous states could be found or if the persistence service given byserviceIddoes not refer to an availableQueryablePersistenceService. The current state is included in the calculation.
-
medianUntil
public static @Nullable State medianUntil(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the median value of the state of a givenItemuntil a certain point in time. ThePersistenceServiceidentified by theserviceIdis used.- Parameters:
item- theItemto get the median value fortimestamp- the point in time to which to search for the median valueserviceId- the name of thePersistenceServiceto use- Returns:
- the median value until
timestamp, ornullif no future states could be found or if the persistence service given byserviceIddoes not refer to an availableQueryablePersistenceService. The current state is included in the calculation.
-
medianBetween
public static @Nullable State medianBetween(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable String serviceId) Gets the median value of the state of a givenItembetween two certain points in time. ThePersistenceServiceidentified by theserviceIdis used.- Parameters:
item- theItemto get the median value forbegin- the point in time from which to start the summationend- the point in time to which to start the summationserviceId- the name of thePersistenceServiceto use- Returns:
- the median value between
beginandend, ornullif no states could be found or if the persistence service given byserviceIddoes not refer to an availableQueryablePersistenceService
-
sumSince
Gets the sum of the state of a givenitemsince a certain point in time. This method does not calculate a Riemann sum and therefore cannot be used as an approximation for the integral value. The default persistence service is used.- Parameters:
item- the item for which we will sum its persisted state values sincetimestamptimestamp- the point in time from which to start the summation- Returns:
- the sum of the state values since
timestamp, or null iftimestampis in the future or the default persistence service does not refer to aQueryablePersistenceService
-
sumUntil
Gets the sum of the state of a givenitemuntil a certain point in time. This method does not calculate a Riemann sum and therefore cannot be used as an approximation for the integral value. The default persistence service is used.- Parameters:
item- the item for which we will sum its persisted state values totimestamptimestamp- the point in time to which to start the summation- Returns:
- the sum of the state values until
timestamp, or null iftimestampis in the past or the default persistence service does not refer to aQueryablePersistenceService
-
sumBetween
Gets the sum of the state of a givenitembetween two certain points in time. This method does not calculate a Riemann sum and therefore cannot be used as an approximation for the integral value. The default persistence service is used.- Parameters:
item- the item for which we will sum its persisted state values betweenbeginandendbegin- the point in time from which to start the summationend- the point in time to which to start the summation- Returns:
- the sum of the state values between the given points in time, or null if
beginis afterendor if the default persistence service does not refer to aQueryablePersistenceService
-
sumSince
public static @Nullable State sumSince(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the sum of the state of a givenitemsince a certain point in time. This method does not calculate a Riemann sum and therefore cannot be used as an approximation for the integral value. ThePersistenceServiceidentified by theserviceIdis used.- Parameters:
item- the item for which we will sum its persisted state values sincetimestamptimestamp- the point in time from which to start the summationserviceId- the name of thePersistenceServiceto use- Returns:
- the sum of the state values since
timestamp, or null iftimestampis in the future orserviceIddoes not refer to aQueryablePersistenceService
-
sumUntil
public static @Nullable State sumUntil(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the sum of the state of a givenitemuntil a certain point in time. This method does not calculate a Riemann sum and therefore cannot be used as an approximation for the integral value. ThePersistenceServiceidentified by theserviceIdis used.- Parameters:
item- the item for which we will sum its persisted state values totimestamptimestamp- the point in time to which to start the summationserviceId- the name of thePersistenceServiceto use- Returns:
- the sum of the state values until
timestamp, or null iftimestampis in the past orserviceIddoes not refer to aQueryablePersistenceService
-
sumBetween
public static @Nullable State sumBetween(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable String serviceId) Gets the sum of the state of a givenitembetween two certain points in time. This method does not calculate a Riemann sum and therefore cannot be used as an approximation for the integral value. ThePersistenceServiceidentified by theserviceIdis used.- Parameters:
item- the item for which we will sum its persisted state values betweenbeginandendbegin- the point in time from which to start the summationend- the point in time to which to start the summationserviceId- the name of thePersistenceServiceto use- Returns:
- the sum of the state values between the given points in time, or null if
beginis afterendorserviceIddoes not refer to aQueryablePersistenceService
-
deltaSince
Gets the difference value of the state of a givenitemsince a certain point in time. The default persistence service is used.- Parameters:
item- the item to get the delta state value fortimestamp- the point in time from which to compute the delta- Returns:
- the difference between now and then, or
nullif there is no default persistence service available, the default persistence service is not aQueryablePersistenceService, or if there is no persisted state for the givenitemat the giventimestampavailable in the default persistence service
-
deltaUntil
Gets the difference value of the state of a givenitemuntil a certain point in time. The default persistence service is used.- Parameters:
item- the item to get the delta state value fortimestamp- the point in time to which to compute the delta- Returns:
- the difference between then and now, or
nullif there is no default persistence service available, the default persistence service is not aQueryablePersistenceService, or if there is no persisted state for the givenitemat the giventimestampavailable in the default persistence service
-
deltaBetween
Gets the difference value of the state of a givenitembetween two points in time. The default persistence service is used.- Parameters:
item- the item to get the delta forbegin- the beginning point in timeend- the end point in time- Returns:
- the difference between end and begin, or
nullif the default persistence service does not refer to an availableQueryablePersistenceService, or if there is no persisted state for the givenitemfor the given points in time
-
deltaSince
public static @Nullable State deltaSince(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the difference value of the state of a givenitemsince a certain point in time. ThePersistenceServiceidentified by theserviceIdis used.- Parameters:
item- the item to get the delta fortimestamp- the point in time from which to compute the deltaserviceId- the name of thePersistenceServiceto use- Returns:
- the difference between now and then, or
nullif the given serviceId does not refer to an availableQueryablePersistenceService, or if there is no persisted state for the givenitemat the giventimestampusing the persistence service namedserviceId
-
deltaUntil
public static @Nullable State deltaUntil(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the difference value of the state of a givenitemuntil a certain point in time. ThePersistenceServiceidentified by theserviceIdis used.- Parameters:
item- the item to get the delta fortimestamp- the point in time to which to compute the deltaserviceId- the name of thePersistenceServiceto use- Returns:
- the difference between then and now, or
nullif the given serviceId does not refer to an availableQueryablePersistenceService, or if there is no persisted state for the givenitemat the giventimestampusing the persistence service namedserviceId
-
deltaBetween
public static @Nullable State deltaBetween(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable String serviceId) Gets the difference value of the state of a givenitembetween two points in time. ThePersistenceServiceidentified by theserviceIdis used.- Parameters:
item- the item to get the delta forbegin- the beginning point in timeend- the end point in timeserviceId- the name of thePersistenceServiceto use- Returns:
- the difference between end and begin, or
nullif the given serviceId does not refer to an availableQueryablePersistenceService, or if there is no persisted state for the givenitemat the given points in time
-
evolutionRate
Deprecated.Gets the evolution rate of the state of a givenItemsince a certain point in time. The defaultPersistenceServiceis used. This method has been deprecated andevolutionRateSince(Item, ZonedDateTime)should be used instead.- Parameters:
item- the item to get the evolution rate value fortimestamp- the point in time from which to compute the evolution rate- Returns:
- the evolution rate in percent (positive and negative) between now and then, or
nullif there is no default persistence service available, the default persistence service is not aQueryablePersistenceService, or if there is no persisted state for the givenitemat the giventimestamp, or if there is a state but it is zero (which would cause a divide-by-zero error)
-
evolutionRateSince
Gets the evolution rate of the state of a givenItemsince a certain point in time. The defaultPersistenceServiceis used.- Parameters:
item- the item to get the evolution rate value fortimestamp- the point in time from which to compute the evolution rate- Returns:
- the evolution rate in percent (positive and negative) between now and then, or
nullif there is no default persistence service available, the default persistence service is not aQueryablePersistenceService, or if there is no persisted state for the givenitemat the giventimestamp, or if there is a state but it is zero (which would cause a divide-by-zero error)
-
evolutionRateUntil
Gets the evolution rate of the state of a givenItemuntil a certain point in time. The defaultPersistenceServiceis used.- Parameters:
item- the item to get the evolution rate value fortimestamp- the point in time to which to compute the evolution rate- Returns:
- the evolution rate in percent (positive and negative) between then and now, or
nullif there is no default persistence service available, the default persistence service is not aQueryablePersistenceService, or if there is no persisted state for the givenitemat the giventimestamp, or if there is a state but it is zero (which would cause a divide-by-zero error)
-
evolutionRate
@Deprecated public static @Nullable DecimalType evolutionRate(Item item, ZonedDateTime begin, ZonedDateTime end) Deprecated.Gets the evolution rate of the state of a givenItembetween two points in time. The defaultPersistenceServiceis used. This method has been deprecated andevolutionRateBetween(Item, ZonedDateTime, ZonedDateTime)should be used instead.- Parameters:
item- the item to get the evolution rate value forbegin- the beginning point in timeend- the end point in time- Returns:
- the evolution rate in percent (positive and negative) in the given interval, or
nullif there is no default persistence service available, the default persistence service is not aQueryablePersistenceService, or if there are no persisted state for the givenitemat the given interval, or if there is a state but it is zero (which would cause a divide-by-zero error)
-
evolutionRateBetween
public static @Nullable DecimalType evolutionRateBetween(Item item, ZonedDateTime begin, ZonedDateTime end) Gets the evolution rate of the state of a givenItembetween two points in time. The defaultPersistenceServiceis used.- Parameters:
item- the item to get the evolution rate value forbegin- the beginning point in timeend- the end point in time- Returns:
- the evolution rate in percent (positive and negative) in the given interval, or
nullif there is no default persistence service available, the default persistence service is not aQueryablePersistenceService, or if there are no persisted state for the givenitemat the given interval, or if there is a state but it is zero (which would cause a divide-by-zero error)
-
evolutionRate
@Deprecated public static @Nullable DecimalType evolutionRate(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Deprecated.Gets the evolution rate of the state of a givenItemsince a certain point in time. ThePersistenceServiceidentified by theserviceIdis used. This method has been deprecated andevolutionRateSince(Item, ZonedDateTime, String)should be used instead.- Parameters:
item- theItemto get the evolution rate value fortimestamp- the point in time from which to compute the evolution rateserviceId- the name of thePersistenceServiceto use- Returns:
- the evolution rate in percent (positive and negative) between now and then, or
nullif the persistence service given byserviceIdis not available or is not aQueryablePersistenceService, or if there is no persisted state for the givenitemat the giventimestampusing the persistence service given byserviceId, or if there is a state but it is zero (which would cause a divide-by-zero error)
-
evolutionRateSince
public static @Nullable DecimalType evolutionRateSince(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the evolution rate of the state of a givenItemsince a certain point in time. ThePersistenceServiceidentified by theserviceIdis used.- Parameters:
item- theItemto get the evolution rate value fortimestamp- the point in time from which to compute the evolution rateserviceId- the name of thePersistenceServiceto use- Returns:
- the evolution rate in percent (positive and negative) between now and then, or
nullif the persistence service given byserviceIdis not available or is not aQueryablePersistenceService, or if there is no persisted state for the givenitemat the giventimestampusing the persistence service given byserviceId, or if there is a state but it is zero (which would cause a divide-by-zero error)
-
evolutionRateUntil
public static @Nullable DecimalType evolutionRateUntil(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the evolution rate of the state of a givenItemuntil a certain point in time. ThePersistenceServiceidentified by theserviceIdis used.- Parameters:
item- theItemto get the evolution rate value fortimestamp- the point in time to which to compute the evolution rateserviceId- the name of thePersistenceServiceto use- Returns:
- the evolution rate in percent (positive and negative) between then and now, or
nullif the persistence service given byserviceIdis not available or is not aQueryablePersistenceService, or if there is no persisted state for the givenitemat the giventimestampusing the persistence service given byserviceId, or if there is a state but it is zero (which would cause a divide-by-zero error)
-
evolutionRate
@Deprecated public static @Nullable DecimalType evolutionRate(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable String serviceId) Deprecated.Gets the evolution rate of the state of a givenItembetween two points in time. ThePersistenceServiceidentified by theserviceIdis used. This method has been deprecated andevolutionRateBetween(Item, ZonedDateTime, ZonedDateTime, String)should be used instead.- Parameters:
item- theItemto get the evolution rate value forbegin- the beginning point in timeend- the end point in timeserviceId- the name of thePersistenceServiceto use- Returns:
- the evolution rate in percent (positive and negative) in the given interval, or
nullif the persistence service given byserviceIdis not available or is not aQueryablePersistenceService, or if there is no persisted state for the givenitemat the givenbeginandendusing the persistence service given byserviceId, or if there is a state but it is zero (which would cause a divide-by-zero error)
-
evolutionRateBetween
public static @Nullable DecimalType evolutionRateBetween(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable String serviceId) Gets the evolution rate of the state of a givenItembetween two points in time. ThePersistenceServiceidentified by theserviceIdis used.- Parameters:
item- theItemto get the evolution rate value forbegin- the beginning point in timeend- the end point in timeserviceId- the name of thePersistenceServiceto use- Returns:
- the evolution rate in percent (positive and negative) in the given interval, or
nullif the persistence service given byserviceIdis not available or is not aQueryablePersistenceService, or if there is no persisted state for the givenitemat the givenbeginandendusing the persistence service given byserviceId, or if there is a state but it is zero (which would cause a divide-by-zero error)
-
countSince
Gets the number of available historic data points of a givenItemfrom a point in time until now. The defaultPersistenceServiceis used.- Parameters:
item- theItemto querytimestamp- the beginning point in time- Returns:
- the number of values persisted for this item,
nulliftimestampis in the future, if the default persistence service is not available or does not refer to aQueryablePersistenceService
-
countUntil
Gets the number of available data points of a givenItemfrom now to a point in time. The defaultPersistenceServiceis used.- Parameters:
item- theItemto querytimestamp- the ending point in time- Returns:
- the number of values persisted for this item,
nulliftimestampis in the past, if the default persistence service is not available or does not refer to aQueryablePersistenceService
-
countBetween
Gets the number of available data points of a givenItembetween two points in time. The defaultPersistenceServiceis used.- Parameters:
item- theItemto querybegin- the beginning point in timeend- the end point in time- Returns:
- the number of values persisted for this item,
nullifbeginis afterend, if the default persistence service is not available or does not refer to aQueryablePersistenceService
-
countSince
Gets the number of available historic data points of a givenItemfrom a point in time until now. ThePersistenceServiceidentified by theserviceIdis used.- Parameters:
item- theItemto querybegin- the beginning point in timeserviceId- the name of thePersistenceServiceto use- Returns:
- the number of values persisted for this item,
nulliftimestampis in the future, if the persistence service is not available or does not refer to aQueryablePersistenceService
-
countUntil
public static @Nullable Long countUntil(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the number of available data points of a givenItemfrom now to a point in time. ThePersistenceServiceidentified by theserviceIdis used.- Parameters:
item- theItemto querytimestamp- the ending point in timeserviceId- the name of thePersistenceServiceto use- Returns:
- the number of values persisted for this item,
nulliftimestampis in the past, if the persistence service is not available or does not refer to aQueryablePersistenceService
-
countBetween
public static @Nullable Long countBetween(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable String serviceId) Gets the number of available data points of a givenItembetween two points in time. ThePersistenceServiceidentified by theserviceIdis used.- Parameters:
item- theItemto querybegin- the beginning point in timeend- the end point in timeserviceId- the name of thePersistenceServiceto use- Returns:
- the number of values persisted for this item,
nullifbeginis afterend, if the persistence service is not available or does not refer to aQueryablePersistenceService
-
countStateChangesSince
Gets the number of changes in historic data points of a givenItemfrom a point in time until now. The defaultPersistenceServiceis used.- Parameters:
item- theItemto querytimestamp- the beginning point in time- Returns:
- the number of state changes for this item,
nullif the default persistence service is not available or does not refer to aQueryablePersistenceService
-
countStateChangesUntil
Gets the number of changes in data points of a givenItemfrom now until a point in time. The defaultPersistenceServiceis used.- Parameters:
item- theItemto querytimestamp- the ending point in time- Returns:
- the number of state changes for this item,
nullif the default persistence service is not available or does not refer to aQueryablePersistenceService
-
countStateChangesBetween
public static @Nullable Long countStateChangesBetween(Item item, ZonedDateTime begin, ZonedDateTime end) Gets the number of changes in data points of a givenItembetween two points in time. The defaultPersistenceServiceis used.- Parameters:
item- theItemto querybegin- the beginning point in timeend- the end point in time- Returns:
- the number of state changes for this item,
nullif the default persistence service is not available or does not refer to aQueryablePersistenceService
-
countStateChangesSince
public static @Nullable Long countStateChangesSince(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the number of changes in historic data points of a givenItemfrom a point in time until now. ThePersistenceServiceidentified by theserviceIdis used.- Parameters:
item- theItemto querytimestamp- the beginning point in timeserviceId- the name of thePersistenceServiceto use- Returns:
- the number of state changes for this item,
nullif the persistence service is not available or does not refer to aQueryablePersistenceService
-
countStateChangesUntil
public static @Nullable Long countStateChangesUntil(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the number of changes in data points of a givenItemfrom now until a point in time. ThePersistenceServiceidentified by theserviceIdis used.- Parameters:
item- theItemto querytimestamp- the ending point in timeserviceId- the name of thePersistenceServiceto use- Returns:
- the number of state changes for this item,
nullif the persistence service is not available or does not refer to aQueryablePersistenceService
-
countStateChangesBetween
public static @Nullable Long countStateChangesBetween(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable String serviceId) Gets the number of changes in data points of a givenItembetween two points in time. ThePersistenceServiceidentified by theserviceIdis used.- Parameters:
item- theItemto querybegin- the beginning point in timeend- the end point in timeserviceId- the name of thePersistenceServiceto use- Returns:
- the number of state changes for this item,
nullif the persistence service is not available or does not refer to aQueryablePersistenceService
-
getAllStatesSince
public static @Nullable Iterable<HistoricItem> getAllStatesSince(Item item, ZonedDateTime timestamp) Retrieves the historic items for a givenitemsince a certain point in time. The default persistence service is used.- Parameters:
item- the item for which to retrieve the historic itemtimestamp- the point in time from which to retrieve the states- Returns:
- the historic items since the given point in time, or
nullif the default persistence service is not available or does not refer to aQueryablePersistenceService
-
getAllStatesUntil
public static @Nullable Iterable<HistoricItem> getAllStatesUntil(Item item, ZonedDateTime timestamp) Retrieves the future items for a givenitemuntil a certain point in time. The default persistence service is used.- Parameters:
item- the item for which to retrieve the future itemtimestamp- the point in time to which to retrieve the states- Returns:
- the future items to the given point in time, or
nullif the default persistence service is not available or does not refer to aQueryablePersistenceService
-
getAllStatesBetween
public static @Nullable Iterable<HistoricItem> getAllStatesBetween(Item item, ZonedDateTime begin, ZonedDateTime end) Retrieves the historic items for a givenitembetween two points in time. The default persistence service is used.- Parameters:
item- the item for which to retrieve the historic itembegin- the point in time from which to retrieve the statesend- the point in time to which to retrieve the states- Returns:
- the historic items between the given points in time, or
nullif the default persistence service is not available or does not refer to aQueryablePersistenceService
-
getAllStatesSince
public static @Nullable Iterable<HistoricItem> getAllStatesSince(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Retrieves the historic items for a givenitemsince a certain point in time through aPersistenceServiceidentified by theserviceId.- Parameters:
item- the item for which to retrieve the historic itemtimestamp- the point in time from which to retrieve the statesserviceId- the name of thePersistenceServiceto use- Returns:
- the historic items since the given point in time, or
nullif the providedserviceIddoes not refer to an availableQueryablePersistenceService
-
getAllStatesUntil
public static @Nullable Iterable<HistoricItem> getAllStatesUntil(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Retrieves the future items for a givenitemuntil a certain point in time through aPersistenceServiceidentified by theserviceId.- Parameters:
item- the item for which to retrieve the future itemtimestamp- the point in time to which to retrieve the statesserviceId- the name of thePersistenceServiceto use- Returns:
- the future items to the given point in time, or
nullif the providedserviceIddoes not refer to an availableQueryablePersistenceService
-
getAllStatesBetween
public static @Nullable Iterable<HistoricItem> getAllStatesBetween(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable String serviceId) Retrieves the historic items for a givenitembetween two points in time through aPersistenceServiceidentified by theserviceId.- Parameters:
item- the item for which to retrieve the historic itembegin- the point in time from which to retrieve the statesend- the point in time to which to retrieve the statesserviceId- the name of thePersistenceServiceto use- Returns:
- the historic items between the given points in time, or
nullif the providedserviceIddoes not refer to an availableQueryablePersistenceService
-
removeAllStatesSince
Removes from persistence the historic items for a givenitemsince a certain point in time. The default persistence service is used. This will only have effect if the pPersistenceServiceis aModifiablePersistenceService.- Parameters:
item- the item for which to remove the historic itemtimestamp- the point in time from which to remove the states
-
removeAllStatesUntil
Removes from persistence the future items for a givenitemuntil a certain point in time. The default persistence service is used. This will only have effect if the pPersistenceServiceis aModifiablePersistenceService.- Parameters:
item- the item for which to remove the future itemtimestamp- the point in time to which to remove the states
-
removeAllStatesBetween
Removes from persistence the historic items for a givenitembetween two points in time. The default persistence service is used. This will only have effect if the pPersistenceServiceis aModifiablePersistenceService.- Parameters:
item- the item for which to remove the historic itembegin- the point in time from which to remove the statesend- the point in time to which to remove the states
-
removeAllStatesSince
public static void removeAllStatesSince(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Removes from persistence the historic items for a givenitemsince a certain point in time through aPersistenceServiceidentified by theserviceId. This will only have effect if the pPersistenceServiceis aModifiablePersistenceService.- Parameters:
item- the item for which to remove the historic itemtimestamp- the point in time from which to remove the statesserviceId- the name of thePersistenceServiceto use
-
removeAllStatesUntil
public static void removeAllStatesUntil(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Removes from persistence the future items for a givenitemuntil a certain point in time through aPersistenceServiceidentified by theserviceId. This will only have effect if the pPersistenceServiceis aModifiablePersistenceService.- Parameters:
item- the item for which to remove the future itemtimestamp- the point in time to which to remove the statesserviceId- the name of thePersistenceServiceto use
-
removeAllStatesBetween
public static void removeAllStatesBetween(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable String serviceId) Removes from persistence the historic items for a givenitembeetween two points in time through aPersistenceServiceidentified by theserviceId. This will only have effect if the pPersistenceServiceis aModifiablePersistenceService.- Parameters:
item- the item for which to remove the historic itembegin- the point in time from which to remove the statesend- the point in time to which to remove the statesserviceId- the name of thePersistenceServiceto use
-