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
-
Constructor Summary
ConstructorDescriptionPersistenceExtensions
(PersistenceServiceRegistry registry, TimeZoneProvider timeZoneProvider) -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable State
averageBetween
(Item item, ZonedDateTime begin, ZonedDateTime end) Gets the average value of the state of a givenItem
between two certain points in time.static @Nullable State
averageBetween
(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable String serviceId) Gets the average value of the state of a givenItem
between two certain points in time.static @Nullable State
averageSince
(Item item, ZonedDateTime timestamp) Gets the average value of the state of a givenItem
since a certain point in time.static @Nullable State
averageSince
(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the average value of the state of a givenItem
since a certain point in time.static @Nullable State
averageUntil
(Item item, ZonedDateTime timestamp) Gets the average value of the state of a givenItem
until a certain point in time.static @Nullable State
averageUntil
(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the average value of the state of a givenItem
until a certain point in time.static @Nullable Boolean
changedBetween
(Item item, ZonedDateTime begin, ZonedDateTime end) Checks if the state of a givenitem
changes between two points in time.static @Nullable Boolean
changedBetween
(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable String serviceId) Checks if the state of a givenitem
changes between two points in time.static @Nullable Boolean
changedSince
(Item item, ZonedDateTime timestamp) Checks if the state of a givenitem
has changed since a certain point in time.static @Nullable Boolean
changedSince
(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Checks if the state of a givenitem
has changed since a certain point in time.static @Nullable Boolean
changedUntil
(Item item, ZonedDateTime timestamp) Checks if the state of a givenitem
will change by a certain point in time.static @Nullable Boolean
changedUntil
(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Checks if the state of a givenitem
will change by a certain point in time.static @Nullable Long
countBetween
(Item item, ZonedDateTime begin, ZonedDateTime end) Gets the number of available data points of a givenItem
between two points in time.static @Nullable Long
countBetween
(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable String serviceId) Gets the number of available data points of a givenItem
between two points in time.static @Nullable Long
countSince
(Item item, ZonedDateTime timestamp) Gets the number of available historic data points of a givenItem
from a point in time until now.static @Nullable Long
countSince
(Item item, ZonedDateTime begin, @Nullable String serviceId) Gets the number of available historic data points of a givenItem
from a point in time until now.static @Nullable Long
countStateChangesBetween
(Item item, ZonedDateTime begin, ZonedDateTime end) Gets the number of changes in data points of a givenItem
between two points in time.static @Nullable Long
countStateChangesBetween
(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable String serviceId) Gets the number of changes in data points of a givenItem
between two points in time.static @Nullable Long
countStateChangesSince
(Item item, ZonedDateTime timestamp) Gets the number of changes in historic data points of a givenItem
from a point in time until now.static @Nullable Long
countStateChangesSince
(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the number of changes in historic data points of a givenItem
from a point in time until now.static @Nullable Long
countStateChangesUntil
(Item item, ZonedDateTime timestamp) Gets the number of changes in data points of a givenItem
from now until a point in time.static @Nullable Long
countStateChangesUntil
(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the number of changes in data points of a givenItem
from now until a point in time.static @Nullable Long
countUntil
(Item item, ZonedDateTime timestamp) Gets the number of available data points of a givenItem
from now to a point in time.static @Nullable Long
countUntil
(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the number of available data points of a givenItem
from now to a point in time.static @Nullable State
deltaBetween
(Item item, ZonedDateTime begin, ZonedDateTime end) Gets the difference value of the state of a givenitem
between two points in time.static @Nullable State
deltaBetween
(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable String serviceId) Gets the difference value of the state of a givenitem
between two points in time.static @Nullable State
deltaSince
(Item item, ZonedDateTime timestamp) Gets the difference value of the state of a givenitem
since a certain point in time.static @Nullable State
deltaSince
(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the difference value of the state of a givenitem
since a certain point in time.static @Nullable State
deltaUntil
(Item item, ZonedDateTime timestamp) Gets the difference value of the state of a givenitem
until a certain point in time.static @Nullable State
deltaUntil
(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the difference value of the state of a givenitem
until a certain point in time.static @Nullable State
deviationBetween
(Item item, ZonedDateTime begin, ZonedDateTime end) Gets the standard deviation of the state of the givenItem
between two points in time.static @Nullable State
deviationBetween
(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable String serviceId) Gets the standard deviation of the state of the givenItem
between two points in time.static @Nullable State
deviationSince
(Item item, ZonedDateTime timestamp) Gets the standard deviation of the state of the givenItem
since a certain point in time.static @Nullable State
deviationSince
(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the standard deviation of the state of the givenItem
since a certain point in time.static @Nullable State
deviationUntil
(Item item, ZonedDateTime timestamp) Gets the standard deviation of the state of the givenItem
until a certain point in time.static @Nullable State
deviationUntil
(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the standard deviation of the state of the givenItem
until a certain point in time.static @Nullable DecimalType
evolutionRate
(Item item, ZonedDateTime timestamp) Deprecated.static @Nullable DecimalType
evolutionRate
(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Deprecated.static @Nullable DecimalType
evolutionRate
(Item item, ZonedDateTime begin, ZonedDateTime end) Deprecated.static @Nullable DecimalType
evolutionRate
(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable String serviceId) Deprecated.static @Nullable DecimalType
evolutionRateBetween
(Item item, ZonedDateTime begin, ZonedDateTime end) Gets the evolution rate of the state of a givenItem
between two points in time.static @Nullable DecimalType
evolutionRateBetween
(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable String serviceId) Gets the evolution rate of the state of a givenItem
between two points in time.static @Nullable DecimalType
evolutionRateSince
(Item item, ZonedDateTime timestamp) Gets the evolution rate of the state of a givenItem
since a certain point in time.static @Nullable DecimalType
evolutionRateSince
(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the evolution rate of the state of a givenItem
since a certain point in time.static @Nullable DecimalType
evolutionRateUntil
(Item item, ZonedDateTime timestamp) Gets the evolution rate of the state of a givenItem
until a certain point in time.static @Nullable DecimalType
evolutionRateUntil
(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the evolution rate of the state of a givenItem
until a certain point in time.static @Nullable Iterable
<HistoricItem> getAllStatesBetween
(Item item, ZonedDateTime begin, ZonedDateTime end) Retrieves the historic items for a givenitem
between two points in time.static @Nullable Iterable
<HistoricItem> getAllStatesBetween
(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable String serviceId) Retrieves the historic items for a givenitem
between two points in time through aPersistenceService
identified by theserviceId
.static @Nullable Iterable
<HistoricItem> getAllStatesSince
(Item item, ZonedDateTime timestamp) Retrieves the historic items for a givenitem
since a certain point in time.static @Nullable Iterable
<HistoricItem> getAllStatesSince
(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Retrieves the historic items for a givenitem
since a certain point in time through aPersistenceService
identified by theserviceId
.static @Nullable Iterable
<HistoricItem> getAllStatesUntil
(Item item, ZonedDateTime timestamp) Retrieves the future items for a givenitem
until a certain point in time.static @Nullable Iterable
<HistoricItem> getAllStatesUntil
(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Retrieves the future items for a givenitem
until a certain point in time through aPersistenceService
identified by theserviceId
.static @Nullable HistoricItem
historicState
(Item item, ZonedDateTime timestamp) Deprecated.static @Nullable HistoricItem
historicState
(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Deprecated.static @Nullable ZonedDateTime
lastChange
(Item item) Query the last historic change time of a givenitem
.static @Nullable ZonedDateTime
lastChange
(Item item, @Nullable String serviceId) Query for the last historic change time of a givenitem
.static @Nullable ZonedDateTime
lastUpdate
(Item item) Query the last historic update time of a givenitem
.static @Nullable ZonedDateTime
lastUpdate
(Item item, @Nullable String serviceId) Query for the last historic update time of a givenitem
.static @Nullable HistoricItem
maximumBetween
(Item item, ZonedDateTime begin, ZonedDateTime end) Gets the historic item with the maximum value of the state of a givenitem
between two points in time.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 givenitem
between two points in time.static @Nullable HistoricItem
maximumSince
(Item item, ZonedDateTime timestamp) Gets the historic item with the maximum value of the state of a givenitem
since a certain point in time.static @Nullable HistoricItem
maximumSince
(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the historic item with the maximum value of the state of a givenitem
since a certain point in time.static @Nullable HistoricItem
maximumUntil
(Item item, ZonedDateTime timestamp) Gets the historic item with the maximum value of the state of a givenitem
until a certain point in time.static @Nullable HistoricItem
maximumUntil
(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the historic item with the maximum value of the state of a givenitem
until a certain point in time.static @Nullable State
medianBetween
(Item item, ZonedDateTime begin, ZonedDateTime end) Gets the median value of the state of a givenItem
between two certain points in time.static @Nullable State
medianBetween
(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable String serviceId) Gets the median value of the state of a givenItem
between two certain points in time.static @Nullable State
medianSince
(Item item, ZonedDateTime timestamp) Gets the median value of the state of a givenItem
since a certain point in time.static @Nullable State
medianSince
(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the median value of the state of a givenItem
since a certain point in time.static @Nullable State
medianUntil
(Item item, ZonedDateTime timestamp) Gets the median value of the state of a givenItem
until a certain point in time.static @Nullable State
medianUntil
(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the median value of the state of a givenItem
until a certain point in time.static @Nullable HistoricItem
minimumBetween
(Item item, ZonedDateTime begin, ZonedDateTime end) Gets the historic item with the minimum value of the state of a givenitem
between two certain points in time.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 givenitem
between two certain points in time.static @Nullable HistoricItem
minimumSince
(Item item, ZonedDateTime timestamp) Gets the historic item with the minimum value of the state of a givenitem
since a certain point in time.static @Nullable HistoricItem
minimumSince
(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the historic item with the minimum value of the state of a givenitem
since a certain point in time.static @Nullable HistoricItem
minimumUntil
(Item item, ZonedDateTime timestamp) Gets the historic item with the minimum value of the state of a givenitem
until a certain point in time.static @Nullable HistoricItem
minimumUntil
(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the historic item with the minimum value of the state of a givenitem
until a certain point in time.static @Nullable ZonedDateTime
nextChange
(Item item) Query the first future change time of a givenitem
.static @Nullable ZonedDateTime
nextChange
(Item item, @Nullable String serviceId) Query for the first future change time of a givenitem
.static @Nullable HistoricItem
Returns the next state of a givenitem
.static @Nullable HistoricItem
Returns the next state of a givenitem
.static @Nullable HistoricItem
Returns the next state of a givenitem
.static @Nullable HistoricItem
Returns the next state of a givenitem
.static @Nullable ZonedDateTime
nextUpdate
(Item item) Query the first future update time of a givenitem
.static @Nullable ZonedDateTime
nextUpdate
(Item item, @Nullable String serviceId) Query for the first future update time of a givenitem
.static void
Persists the state of a givenitem
through the default persistence service.static void
static void
persist
(Item item, ZonedDateTime timestamp, String stateString) Persists astate
at a giventimestamp
of anitem
through the default persistence service.static void
persist
(Item item, ZonedDateTime timestamp, String stateString, @Nullable String serviceId) Persists astate
at a giventimestamp
of anitem
through aPersistenceService
identified by theserviceId
.static void
persist
(Item item, ZonedDateTime timestamp, State state) Persists astate
at a giventimestamp
of anitem
through the default persistence service.static void
persist
(Item item, ZonedDateTime timestamp, State state, @Nullable String serviceId) Persists astate
at a giventimestamp
of anitem
through aPersistenceService
identified by theserviceId
.static void
persist
(Item item, TimeSeries timeSeries) Persists atimeSeries
of anitem
through the default persistence service.static void
persist
(Item item, TimeSeries timeSeries, @Nullable String serviceId) static @Nullable HistoricItem
persistedState
(Item item, ZonedDateTime timestamp) Retrieves the persisted item for a givenitem
at a certain point in time through the default persistence service.static @Nullable HistoricItem
persistedState
(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Retrieves the persisted item for a givenitem
at a certain point in time through aPersistenceService
identified by theserviceId
.static @Nullable HistoricItem
previousState
(Item item) Returns the previous state of a givenitem
.static @Nullable HistoricItem
previousState
(Item item, boolean skipEqual) Returns the previous state of a givenitem
.static @Nullable HistoricItem
previousState
(Item item, boolean skipEqual, @Nullable String serviceId) Returns the previous state of a givenitem
.static @Nullable HistoricItem
previousState
(Item item, @Nullable String serviceId) Returns the previous state of a givenitem
.static void
removeAllStatesBetween
(Item item, ZonedDateTime begin, ZonedDateTime end) Removes from persistence the historic items for a givenitem
between two points in time.static void
removeAllStatesBetween
(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable String serviceId) Removes from persistence the historic items for a givenitem
beetween two points in time through aPersistenceService
identified by theserviceId
.static void
removeAllStatesSince
(Item item, ZonedDateTime timestamp) Removes from persistence the historic items for a givenitem
since a certain point in time.static void
removeAllStatesSince
(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Removes from persistence the historic items for a givenitem
since a certain point in time through aPersistenceService
identified by theserviceId
.static void
removeAllStatesUntil
(Item item, ZonedDateTime timestamp) Removes from persistence the future items for a givenitem
until a certain point in time.static void
removeAllStatesUntil
(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Removes from persistence the future items for a givenitem
until a certain point in time through aPersistenceService
identified by theserviceId
.static @Nullable State
sumBetween
(Item item, ZonedDateTime begin, ZonedDateTime end) Gets the sum of the state of a givenitem
between two certain points in time.static @Nullable State
sumBetween
(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable String serviceId) Gets the sum of the state of a givenitem
between two certain points in time.static @Nullable State
sumSince
(Item item, ZonedDateTime timestamp) Gets the sum of the state of a givenitem
since a certain point in time.static @Nullable State
sumSince
(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the sum of the state of a givenitem
since a certain point in time.static @Nullable State
sumUntil
(Item item, ZonedDateTime timestamp) Gets the sum of the state of a givenitem
until a certain point in time.static @Nullable State
sumUntil
(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the sum of the state of a givenitem
until a certain point in time.static @Nullable Boolean
updatedBetween
(Item item, ZonedDateTime begin, ZonedDateTime end) Checks if the state of a givenitem
has been updated between two points in time.static @Nullable Boolean
updatedBetween
(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable String serviceId) Checks if the state of a givenitem
is updated between two points in time.static @Nullable Boolean
updatedSince
(Item item, ZonedDateTime timestamp) Checks if the state of a givenitem
has been updated since a certain point in time.static @Nullable Boolean
updatedSince
(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Checks if the state of a givenitem
has been updated since a certain point in time.static @Nullable Boolean
updatedUntil
(Item item, ZonedDateTime timestamp) Checks if the state of a givenitem
will be updated until a certain point in time.static @Nullable Boolean
updatedUntil
(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Checks if the state of a givenitem
will be updated until a certain point in time.static @Nullable State
varianceBetween
(Item item, ZonedDateTime begin, ZonedDateTime end) Gets the variance of the state of the givenItem
between two certain point in time.static @Nullable State
varianceBetween
(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable String serviceId) Gets the variance of the state of the givenItem
between two points in time.static @Nullable State
varianceSince
(Item item, ZonedDateTime timestamp) Gets the variance of the state of the givenItem
since a certain point in time.static @Nullable State
varianceSince
(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the variance of the state of the givenItem
since a certain point in time.static @Nullable State
varianceUntil
(Item item, ZonedDateTime timestamp) Gets the variance of the state of the givenItem
until a certain point in time.static @Nullable State
varianceUntil
(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the variance of the state of the givenItem
until a certain point in time.
-
Constructor Details
-
PersistenceExtensions
public PersistenceExtensions(PersistenceServiceRegistry registry, TimeZoneProvider timeZoneProvider)
-
-
Method Details
-
persist
Persists the state of a givenitem
through the default persistence service.- Parameters:
item
- the item to store
-
persist
- Parameters:
item
- the item to storeserviceId
- the name of thePersistenceService
to use
-
persist
Persists astate
at a giventimestamp
of anitem
through 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 astate
at a giventimestamp
of anitem
through aPersistenceService
identified by theserviceId
.- Parameters:
item
- the itemtimestamp
- the date for the item state to be storedstate
- the state to be storedserviceId
- the name of thePersistenceService
to use
-
persist
Persists astate
at a giventimestamp
of anitem
through 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 astate
at a giventimestamp
of anitem
through aPersistenceService
identified by theserviceId
.- Parameters:
item
- the itemtimestamp
- the date for the item state to be storedstateString
- the state to be storedserviceId
- the name of thePersistenceService
to use
-
persist
Persists atimeSeries
of anitem
through 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 thePersistenceService
to use
-
historicState
Deprecated.Retrieves the historic item for a givenitem
at 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
null
if 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 givenitem
at a certain point in time through aPersistenceService
identified 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 thePersistenceService
to use- Returns:
- the historic item at the given point in time, or
null
if no historic item could be found or if the providedserviceId
does not refer to an availableQueryablePersistenceService
-
persistedState
Retrieves the persisted item for a givenitem
at 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
null
if 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 givenitem
at a certain point in time through aPersistenceService
identified 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 thePersistenceService
to use- Returns:
- the persisted item at the given point in time, or
null
if no persisted item could be found or if the providedserviceId
does not refer to an availableQueryablePersistenceService
-
lastUpdate
Query the last historic update time of a givenitem
. The default persistence service is used.- 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
,null
if 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
.- Parameters:
item
- the item for which the last historic update time is to be returnedserviceId
- the name of thePersistenceService
to use- Returns:
- point in time of the last historic update to
item
,null
if there are no historic persisted updates, the state has changed since the last update or if persistence service given byserviceId
does 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
, ornull
if 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 thePersistenceService
to use- Returns:
- point in time of the first future update to
item
, ornull
if there are no future persisted updates or if persistence service given byserviceId
does not refer to an availableQueryablePersistenceService
-
lastChange
Query the last historic change time of a givenitem
. The default persistence service is used.- 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
,null
if 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
.- Parameters:
item
- the item for which the last historic change time is to be returnedserviceId
- the name of thePersistenceService
to use- Returns:
- point in time of the last historic change to
item
null
if there are no historic persisted changes, the state has changed since the last update or if persistence service given byserviceId
does 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
, ornull
if 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 thePersistenceService
to use- Returns:
- point in time of the first future change to
item
, ornull
if there are no future persisted changes or if persistence service given byserviceId
does not refer to an availableQueryablePersistenceService
-
previousState
Returns the previous state of a givenitem
.- Parameters:
item
- the item to get the previous state value for- Returns:
- the previous state or
null
if 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
.- 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
null
if 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
. ThePersistenceService
identified by theserviceId
is used.- Parameters:
item
- the item to get the previous state value forserviceId
- the name of thePersistenceService
to use- Returns:
- the previous state or
null
if 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
. ThePersistenceService
identified by theserviceId
is used.- 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 thePersistenceService
to use- Returns:
- the previous state or
null
if no previous state could be found, or if the givenserviceId
is 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
null
if 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
null
if 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 thePersistenceService
to use- Returns:
- the next state or
null
if 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 thePersistenceService
to use- Returns:
- the next state or
null
if no next state could be found, or if the givenserviceId
is not available or does not refer to aQueryablePersistenceService
-
changedSince
Checks if the state of a givenitem
has 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:
true
if item state has changed,false
if it has not changed,null
iftimestamp
is in the future, if the default persistence service is not available or does not refer to aQueryablePersistenceService
-
changedUntil
Checks if the state of a givenitem
will 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:
true
if item state will change,false
if it will not change,null
iftimestamp>
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 givenitem
changes between two points in time. The default persistence service is used.- Parameters:
item
- the item to check for state changes- Returns:
true
if item state changes,false
if the item does not change in the given interval,null
ifbegin
is afterend
, if the default persistence does not refer to aQueryablePersistenceService
, ornull
if 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 givenitem
has changed since a certain point in time. ThePersistenceService
identified by theserviceId
is used.- Parameters:
item
- the item to check for state changestimestamp
- the point in time to start the checkserviceId
- the name of thePersistenceService
to use- Returns:
true
if item state has changed, orfalse
if it has not changed,null
iftimestamp
is in the future, if the providedserviceId
does not refer to an availableQueryablePersistenceService
-
changedUntil
public static @Nullable Boolean changedUntil(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Checks if the state of a givenitem
will change by a certain point in time. ThePersistenceService
identified by theserviceId
is used.- Parameters:
item
- the item to check for state changestimestamp
- the point in time to end the checkserviceId
- the name of thePersistenceService
to use- Returns:
true
if item state will change, orfalse
if it will not change,null
iftimestamp
is in the past, if the providedserviceId
does 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 givenitem
changes between two points in time. ThePersistenceService
identified by theserviceId
is 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 thePersistenceService
to use- Returns:
true
if item state changed orfalse
if the item does not change in the given interval,null
ifbegin
is afterend
, if the givenserviceId
does not refer to aQueryablePersistenceService
-
updatedSince
Checks if the state of a givenitem
has 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:
true
if item state was updated,false
if the item has not been updated sincetimestamp
,null
iftimestamp
is in the future, if the default persistence does not refer to aQueryablePersistenceService
, ornull
if the default persistence service is not available
-
updatedUntil
Checks if the state of a givenitem
will 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:
true
if item state is updated,false
if the item is not updated untiltimestamp
,null
iftimestamp
is in the past, if the default persistence does not refer to aQueryablePersistenceService
, ornull
if the default persistence service is not available
-
updatedBetween
Checks if the state of a givenitem
has 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:
true
if item state was updated,false
if the item has not been updated in the given interval,null
ifbegin
is afterend
, if the default persistence does not refer to aQueryablePersistenceService
, ornull
if 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 givenitem
has been updated since a certain point in time. ThePersistenceService
identified by theserviceId
is used.- Parameters:
item
- the item to check for state changestimestamp
- the point in time to start the checkserviceId
- the name of thePersistenceService
to use- Returns:
true
if item state was updated orfalse
if the item has not been updated sincetimestamp
,null
iftimestamp
is in the future, if the givenserviceId
does not refer to aQueryablePersistenceService
-
updatedUntil
public static @Nullable Boolean updatedUntil(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Checks if the state of a givenitem
will be updated until a certain point in time. ThePersistenceService
identified by theserviceId
is used.- Parameters:
item
- the item to check for state changestimestamp
- the point in time to end the checkserviceId
- the name of thePersistenceService
to use- Returns:
true
if item state was updated orfalse
if the item is not updated sincetimestamp
,null
iftimestamp
is in the past, if the givenserviceId
does 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 givenitem
is updated between two points in time. ThePersistenceService
identified by theserviceId
is 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 thePersistenceService
to use- Returns:
true
if item state was updated orfalse
if the item is not updated in the given interval,null
ifbegin
is afterend
, if the givenserviceId
does not refer to aQueryablePersistenceService
-
maximumSince
Gets the historic item with the maximum value of the state of a givenitem
since 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
HistoricItem
constructed from theitem
's state ifitem
's state is the maximum value,null
iftimestamp
is 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 givenitem
until 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
HistoricItem
constructed from theitem
's state ifitem
's state is the maximum value,null
iftimestamp
is 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 givenitem
between 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
HistoricItem
with the maximum state value between two points in time, aHistoricItem
constructed from theitem
's state if no persisted states found, ornull
ifbegin
is afterend or if the default persistence service does not refer to an available
QueryablePersistenceService
-
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 givenitem
since a certain point in time. ThePersistenceService
identified by theserviceId
is used.- Parameters:
item
- the item to get the maximum state value fortimestamp
- the point in time to start the checkserviceId
- the name of thePersistenceService
to use- Returns:
- a
HistoricItem
with the maximum state value since the given point in time, aHistoricItem
constructed from theitem
's state ifitem
's state is the maximum value,null
iftimestamp
is in the future or if the givenserviceId
does 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 givenitem
until a certain point in time. ThePersistenceService
identified by theserviceId
is used.- Parameters:
item
- the item to get the maximum state value fortimestamp
- the point in time to end the checkserviceId
- the name of thePersistenceService
to use- Returns:
- a
HistoricItem
with the maximum state value until the given point in time, aHistoricItem
constructed from theitem
's state ifitem
's state is the maximum value,null
iftimestamp
is in the past or if the givenserviceId
does 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 givenitem
between two points in time. ThePersistenceService
identified by theserviceId
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 checkserviceId
- the name of thePersistenceService
to use- Returns:
- a
HistoricItem
with the maximum state value between two points in time, aHistoricItem
constructed from theitem
's state if no persisted states found, ornull
ifbegin
is afterend or if the given
serviceId
does not refer to an availableQueryablePersistenceService
-
minimumSince
Gets the historic item with the minimum value of the state of a givenitem
since 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
HistoricItem
constructed from theitem
's state ifitem
's state is the minimum value,null
iftimestamp
is 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 givenitem
until 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
HistoricItem
constructed from theitem
's state ifitem
's state is the minimum value,null
iftimestamp
is 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 givenitem
between 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
HistoricItem
with the minimum state value between two points in time, aHistoricItem
constructed from theitem
's state if no persisted states found, ornull
ifbegin
is afterend or if the default persistence service does not refer to an available
QueryablePersistenceService
-
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 givenitem
since a certain point in time. ThePersistenceService
identified by theserviceId
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 valueserviceId
- the name of thePersistenceService
to use- Returns:
- a
HistoricItem
with the minimum state value since the given point in time, aHistoricItem
constructed from theitem
's state ifitem
's state is the minimum value,null
iftimestamp
is in the future or if the givenserviceId
does 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 givenitem
until a certain point in time. ThePersistenceService
identified by theserviceId
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 valueserviceId
- the name of thePersistenceService
to use- Returns:
- a
HistoricItem
with the minimum state value until the given point in time, aHistoricItem
constructed from theitem
's state ifitem
's state is the minimum value,null
iftimestamp
is in the past or if the givenserviceId
does 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 givenitem
between two certain points in time. ThePersistenceService
identified by theserviceId
is 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 thePersistenceService
to use- Returns:
- a
HistoricItem
with the minimum state value between two points in time, aHistoricItem
constructed from theitem
's state if no persisted states found, ornull
ifbegin
is afterend or if the given
serviceId
does not refer to an availableQueryablePersistenceService
-
varianceSince
Gets the variance of the state of the givenItem
since a certain point in time. The defaultPersistenceService
is used.- Parameters:
item
- theItem
to get the variance fortimestamp
- the point in time from which to compute the variance- Returns:
- the variance between then and now, or
null
iftimestamp
is 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 givenitem
at the giventimestamp
-
varianceUntil
Gets the variance of the state of the givenItem
until a certain point in time. The defaultPersistenceService
is used.- Parameters:
item
- theItem
to get the variance fortimestamp
- the point in time to which to compute the variance- Returns:
- the variance between now and then, or
null
iftimestamp
is 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 givenitem
at the giventimestamp
-
varianceBetween
Gets the variance of the state of the givenItem
between two certain point in time. The defaultPersistenceService
is used.- Parameters:
item
- theItem
to 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
null
ifbegin
is afterend
, if there is no default persistence service available, or it is not aQueryablePersistenceService
, or if there is no persisted state for the givenitem
betweenbegin
andend
-
varianceSince
public static @Nullable State varianceSince(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the variance of the state of the givenItem
since a certain point in time. ThePersistenceService
identified by theserviceId
is used.- Parameters:
item
- theItem
to get the variance fortimestamp
- the point in time from which to compute the varianceserviceId
- the name of thePersistenceService
to use- Returns:
- the variance between then and now, or
null
iftimestamp
is in the future, if the persistence service given byserviceId
is not available, or it is not aQueryablePersistenceService
, or if there is no persisted state for the givenitem
at the giventimestamp
-
varianceUntil
public static @Nullable State varianceUntil(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the variance of the state of the givenItem
until a certain point in time. ThePersistenceService
identified by theserviceId
is used.- Parameters:
item
- theItem
to get the variance fortimestamp
- the point in time to which to compute the varianceserviceId
- the name of thePersistenceService
to use- Returns:
- the variance between now and then, or
null
iftimestamp
is in the past, if the persistence service given byserviceId
is not available, or it is not aQueryablePersistenceService
, or if there is no persisted state for the givenitem
at 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 givenItem
between two points in time. ThePersistenceService
identified by theserviceId
is used.- Parameters:
item
- theItem
to get the variance forbegin
- the point in time from which to computeend
- the end time for the computationserviceId
- the name of thePersistenceService
to use- Returns:
- the variance between both points of time, or
null
ifbegin
is afterend
, if the persistence service given byserviceId
is not available, or it is not aQueryablePersistenceService
, or it is not aQueryablePersistenceService
, or if there is no persisted state for the givenitem
betweenbegin
andend
-
deviationSince
Gets the standard deviation of the state of the givenItem
since a certain point in time. The defaultPersistenceService
is 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
- theItem
to 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
null
iftimestamp
is 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 givenitem
at the giventimestamp
-
deviationUntil
Gets the standard deviation of the state of the givenItem
until a certain point in time. The defaultPersistenceService
is 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
- theItem
to 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
null
iftimestamp
is 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 givenitem
at the giventimestamp
-
deviationBetween
Gets the standard deviation of the state of the givenItem
between two points in time. The defaultPersistenceService
is 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
- theItem
to 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
null
ifbegin
is afterend
, if there is no default persistence service available, or it is not aQueryablePersistenceService
, or if there is no persisted state for the givenitem
betweenbegin
andend
-
deviationSince
public static @Nullable State deviationSince(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the standard deviation of the state of the givenItem
since a certain point in time. ThePersistenceService
identified by theserviceId
is 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
- theItem
to get the standard deviation fortimestamp
- the point in time from which to compute the standard deviationserviceId
- the name of thePersistenceService
to use- Returns:
- the standard deviation between then and now, or
null
iftimestamp
is in the future, if the persistence service given byserviceId
is not available, or it is not aQueryablePersistenceService
, or if there is no persisted state for the givenitem
at the giventimestamp
-
deviationUntil
public static @Nullable State deviationUntil(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Gets the standard deviation of the state of the givenItem
until a certain point in time. ThePersistenceService
identified by theserviceId
is 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
- theItem
to get the standard deviation fortimestamp
- the point in time to which to compute the standard deviationserviceId
- the name of thePersistenceService
to use- Returns:
- the standard deviation between now and then, or
null
iftimestamp
is in the past, if the persistence service given byserviceId
is not available, or it is not aQueryablePersistenceService
, or if there is no persisted state for the givenitem
at 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 givenItem
between two points in time. ThePersistenceService
identified by theserviceId
is 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
- theItem
to get the standard deviation forbegin
- the point in time from which to computeend
- the end time for the computationserviceId
- the name of thePersistenceService
to use- Returns:
- the standard deviation between both points of time, or
null
ifbegin
is afterend
, if the persistence service given byserviceId
is not available, or it is not aQueryablePersistenceService
, or it is not aQueryablePersistenceService
, or if there is no persisted state for the givenitem
betweenbegin
andend
-
averageSince
Gets the average value of the state of a givenItem
since a certain point in time. The defaultPersistenceService
is used.- Parameters:
item
- theItem
to get the average value fortimestamp
- the point in time from which to search for the average value- Returns:
- the average value since
timestamp
ornull
if 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 givenItem
until a certain point in time. The defaultPersistenceService
is used.- Parameters:
item
- theItem
to get the average value fortimestamp
- the point in time to which to search for the average value- Returns:
- the average value until
timestamp
ornull
if 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 givenItem
between two certain points in time. The defaultPersistenceService
is used.- Parameters:
item
- theItem
to 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
begin
andend
ornull
if 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 givenItem
since a certain point in time. ThePersistenceService
identified by theserviceId
is used.- Parameters:
item
- theItem
to get the average value fortimestamp
- the point in time from which to search for the average valueserviceId
- the name of thePersistenceService
to use- Returns:
- the average value since
timestamp
, ornull
if no previous states could be found or if the persistence service given byserviceId
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 String serviceId) Gets the average value of the state of a givenItem
until a certain point in time. ThePersistenceService
identified by theserviceId
is used.- Parameters:
item
- theItem
to get the average value fortimestamp
- the point in time to which to search for the average valueserviceId
- the name of thePersistenceService
to use- Returns:
- the average value until
timestamp
, ornull
if no future states could be found or if the persistence service given byserviceId
does 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 givenItem
between two certain points in time. ThePersistenceService
identified by theserviceId
is used.- Parameters:
item
- theItem
to 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 thePersistenceService
to use- Returns:
- the average value between
begin
andend
, ornull
if no states could be found or if the persistence service given byserviceId
does not refer to an availableQueryablePersistenceService
-
medianSince
Gets the median value of the state of a givenItem
since a certain point in time. The defaultPersistenceService
is used.- Parameters:
item
- theItem
to get the median value fortimestamp
- the point in time from which to search for the median value- Returns:
- the median value since
timestamp
ornull
if 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 givenItem
until a certain point in time. The defaultPersistenceService
is used.- Parameters:
item
- theItem
to get the median value fortimestamp
- the point in time to which to search for the median value- Returns:
- the median value until
timestamp
ornull
if 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 givenItem
between two certain points in time. The defaultPersistenceService
is used.- Parameters:
item
- theItem
to 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
begin
andend
ornull
if 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 givenItem
since a certain point in time. ThePersistenceService
identified by theserviceId
is used.- Parameters:
item
- theItem
to get the median value fortimestamp
- the point in time from which to search for the median valueserviceId
- the name of thePersistenceService
to use- Returns:
- the median value since
timestamp
, ornull
if no previous states could be found or if the persistence service given byserviceId
does 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 givenItem
until a certain point in time. ThePersistenceService
identified by theserviceId
is used.- Parameters:
item
- theItem
to get the median value fortimestamp
- the point in time to which to search for the median valueserviceId
- the name of thePersistenceService
to use- Returns:
- the median value until
timestamp
, ornull
if no future states could be found or if the persistence service given byserviceId
does 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 givenItem
between two certain points in time. ThePersistenceService
identified by theserviceId
is used.- Parameters:
item
- theItem
to 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 thePersistenceService
to use- Returns:
- the median value between
begin
andend
, ornull
if no states could be found or if the persistence service given byserviceId
does not refer to an availableQueryablePersistenceService
-
sumSince
Gets the sum of the state of a givenitem
since a certain point in time. The default persistence service is used.- Parameters:
item
- the item for which we will sum its persisted state values sincetimestamp
timestamp
- the point in time from which to start the summation- Returns:
- the sum of the state values since
timestamp
, or null iftimestamp
is in the future or the default persistence service does not refer to aQueryablePersistenceService
-
sumUntil
Gets the sum of the state of a givenitem
until a certain point in time. The default persistence service is used.- Parameters:
item
- the item for which we will sum its persisted state values totimestamp
timestamp
- the point in time to which to start the summation- Returns:
- the sum of the state values until
timestamp
, or null iftimestamp
is in the past or the default persistence service does not refer to aQueryablePersistenceService
-
sumBetween
Gets the sum of the state of a givenitem
between two certain points in time. The default persistence service is used.- Parameters:
item
- the item for which we will sum its persisted state values betweenbegin
andend
begin
- 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
begin
is afterend
or 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 givenitem
since a certain point in time. ThePersistenceService
identified by theserviceId
is used.- Parameters:
item
- the item for which we will sum its persisted state values sincetimestamp
timestamp
- the point in time from which to start the summationserviceId
- the name of thePersistenceService
to use- Returns:
- the sum of the state values since
timestamp
, or null iftimestamp
is in the future orserviceId
does 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 givenitem
until a certain point in time. ThePersistenceService
identified by theserviceId
is used.- Parameters:
item
- the item for which we will sum its persisted state values totimestamp
timestamp
- the point in time to which to start the summationserviceId
- the name of thePersistenceService
to use- Returns:
- the sum of the state values until
timestamp
, or null iftimestamp
is in the past orserviceId
does 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 givenitem
between two certain points in time. ThePersistenceService
identified by theserviceId
is used.- Parameters:
item
- the item for which we will sum its persisted state values betweenbegin
andend
begin
- the point in time from which to start the summationend
- the point in time to which to start the summationserviceId
- the name of thePersistenceService
to use- Returns:
- the sum of the state values between the given points in time, or null if
begin
is afterend
orserviceId
does not refer to aQueryablePersistenceService
-
deltaSince
Gets the difference value of the state of a givenitem
since 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
null
if there is no default persistence service available, the default persistence service is not aQueryablePersistenceService
, or if there is no persisted state for the givenitem
at the giventimestamp
available in the default persistence service
-
deltaUntil
Gets the difference value of the state of a givenitem
until 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
null
if there is no default persistence service available, the default persistence service is not aQueryablePersistenceService
, or if there is no persisted state for the givenitem
at the giventimestamp
available in the default persistence service
-
deltaBetween
Gets the difference value of the state of a givenitem
between 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
null
if the default persistence service does not refer to an availableQueryablePersistenceService
, or if there is no persisted state for the givenitem
for 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 givenitem
since a certain point in time. ThePersistenceService
identified by theserviceId
is used.- Parameters:
item
- the item to get the delta fortimestamp
- the point in time from which to compute the deltaserviceId
- the name of thePersistenceService
to use- Returns:
- the difference between now and then, or
null
if the given serviceId does not refer to an availableQueryablePersistenceService
, or if there is no persisted state for the givenitem
at the giventimestamp
using 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 givenitem
until a certain point in time. ThePersistenceService
identified by theserviceId
is used.- Parameters:
item
- the item to get the delta fortimestamp
- the point in time to which to compute the deltaserviceId
- the name of thePersistenceService
to use- Returns:
- the difference between then and now, or
null
if the given serviceId does not refer to an availableQueryablePersistenceService
, or if there is no persisted state for the givenitem
at the giventimestamp
using 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 givenitem
between two points in time. ThePersistenceService
identified by theserviceId
is used.- Parameters:
item
- the item to get the delta forbegin
- the beginning point in timeend
- the end point in timeserviceId
- the name of thePersistenceService
to use- Returns:
- the difference between end and begin, or
null
if the given serviceId does not refer to an availableQueryablePersistenceService
, or if there is no persisted state for the givenitem
at the given points in time
-
evolutionRate
Deprecated.Gets the evolution rate of the state of a givenItem
since a certain point in time. The defaultPersistenceService
is 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
null
if there is no default persistence service available, the default persistence service is not aQueryablePersistenceService
, or if there is no persisted state for the givenitem
at 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 givenItem
since a certain point in time. The defaultPersistenceService
is 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
null
if there is no default persistence service available, the default persistence service is not aQueryablePersistenceService
, or if there is no persisted state for the givenitem
at 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 givenItem
until a certain point in time. The defaultPersistenceService
is 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
null
if there is no default persistence service available, the default persistence service is not aQueryablePersistenceService
, or if there is no persisted state for the givenitem
at 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 givenItem
between two points in time. The defaultPersistenceService
is 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
null
if there is no default persistence service available, the default persistence service is not aQueryablePersistenceService
, or if there are no persisted state for the givenitem
at 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 givenItem
between two points in time. The defaultPersistenceService
is 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
null
if there is no default persistence service available, the default persistence service is not aQueryablePersistenceService
, or if there are no persisted state for the givenitem
at 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 givenItem
since a certain point in time. ThePersistenceService
identified by theserviceId
is used. This method has been deprecated andevolutionRateSince(Item, ZonedDateTime, String)
should be used instead.- Parameters:
item
- theItem
to get the evolution rate value fortimestamp
- the point in time from which to compute the evolution rateserviceId
- the name of thePersistenceService
to use- Returns:
- the evolution rate in percent (positive and negative) between now and then, or
null
if the persistence service given byserviceId
is not available or is not aQueryablePersistenceService
, or if there is no persisted state for the givenitem
at the giventimestamp
using 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 givenItem
since a certain point in time. ThePersistenceService
identified by theserviceId
is used.- Parameters:
item
- theItem
to get the evolution rate value fortimestamp
- the point in time from which to compute the evolution rateserviceId
- the name of thePersistenceService
to use- Returns:
- the evolution rate in percent (positive and negative) between now and then, or
null
if the persistence service given byserviceId
is not available or is not aQueryablePersistenceService
, or if there is no persisted state for the givenitem
at the giventimestamp
using 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 givenItem
until a certain point in time. ThePersistenceService
identified by theserviceId
is used.- Parameters:
item
- theItem
to get the evolution rate value fortimestamp
- the point in time to which to compute the evolution rateserviceId
- the name of thePersistenceService
to use- Returns:
- the evolution rate in percent (positive and negative) between then and now, or
null
if the persistence service given byserviceId
is not available or is not aQueryablePersistenceService
, or if there is no persisted state for the givenitem
at the giventimestamp
using 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 givenItem
between two points in time. ThePersistenceService
identified by theserviceId
is used. This method has been deprecated andevolutionRateBetween(Item, ZonedDateTime, ZonedDateTime, String)
should be used instead.- Parameters:
item
- theItem
to get the evolution rate value forbegin
- the beginning point in timeend
- the end point in timeserviceId
- the name of thePersistenceService
to use- Returns:
- the evolution rate in percent (positive and negative) in the given interval, or
null
if the persistence service given byserviceId
is not available or is not aQueryablePersistenceService
, or if there is no persisted state for the givenitem
at the givenbegin
andend
using 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 givenItem
between two points in time. ThePersistenceService
identified by theserviceId
is used.- Parameters:
item
- theItem
to get the evolution rate value forbegin
- the beginning point in timeend
- the end point in timeserviceId
- the name of thePersistenceService
to use- Returns:
- the evolution rate in percent (positive and negative) in the given interval, or
null
if the persistence service given byserviceId
is not available or is not aQueryablePersistenceService
, or if there is no persisted state for the givenitem
at the givenbegin
andend
using 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 givenItem
from a point in time until now. The defaultPersistenceService
is used.- Parameters:
item
- theItem
to querytimestamp
- the beginning point in time- Returns:
- the number of values persisted for this item,
null
iftimestamp
is 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 givenItem
from now to a point in time. The defaultPersistenceService
is used.- Parameters:
item
- theItem
to querytimestamp
- the ending point in time- Returns:
- the number of values persisted for this item,
null
iftimestamp
is 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 givenItem
between two points in time. The defaultPersistenceService
is used.- Parameters:
item
- theItem
to querybegin
- the beginning point in timeend
- the end point in time- Returns:
- the number of values persisted for this item,
null
ifbegin
is 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 givenItem
from a point in time until now. ThePersistenceService
identified by theserviceId
is used.- Parameters:
item
- theItem
to querybegin
- the beginning point in timeserviceId
- the name of thePersistenceService
to use- Returns:
- the number of values persisted for this item,
null
iftimestamp
is 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 givenItem
from now to a point in time. ThePersistenceService
identified by theserviceId
is used.- Parameters:
item
- theItem
to querytimestamp
- the ending point in timeserviceId
- the name of thePersistenceService
to use- Returns:
- the number of values persisted for this item,
null
iftimestamp
is 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 givenItem
between two points in time. ThePersistenceService
identified by theserviceId
is used.- Parameters:
item
- theItem
to querybegin
- the beginning point in timeend
- the end point in timeserviceId
- the name of thePersistenceService
to use- Returns:
- the number of values persisted for this item,
null
ifbegin
is 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 givenItem
from a point in time until now. The defaultPersistenceService
is used.- Parameters:
item
- theItem
to querytimestamp
- the beginning point in time- Returns:
- the number of state changes for this item,
null
if the default persistence service is not available or does not refer to aQueryablePersistenceService
-
countStateChangesUntil
Gets the number of changes in data points of a givenItem
from now until a point in time. The defaultPersistenceService
is used.- Parameters:
item
- theItem
to querytimestamp
- the ending point in time- Returns:
- the number of state changes for this item,
null
if 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 givenItem
between two points in time. The defaultPersistenceService
is used.- Parameters:
item
- theItem
to querybegin
- the beginning point in timeend
- the end point in time- Returns:
- the number of state changes for this item,
null
if 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 givenItem
from a point in time until now. ThePersistenceService
identified by theserviceId
is used.- Parameters:
item
- theItem
to querytimestamp
- the beginning point in timeserviceId
- the name of thePersistenceService
to use- Returns:
- the number of state changes for this item,
null
if 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 givenItem
from now until a point in time. ThePersistenceService
identified by theserviceId
is used.- Parameters:
item
- theItem
to querytimestamp
- the ending point in timeserviceId
- the name of thePersistenceService
to use- Returns:
- the number of state changes for this item,
null
if 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 givenItem
between two points in time. ThePersistenceService
identified by theserviceId
is used.- Parameters:
item
- theItem
to querybegin
- the beginning point in timeend
- the end point in timeserviceId
- the name of thePersistenceService
to use- Returns:
- the number of state changes for this item,
null
if 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 givenitem
since 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
null
if 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 givenitem
until 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
null
if 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 givenitem
between 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
null
if 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 givenitem
since a certain point in time through aPersistenceService
identified 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 thePersistenceService
to use- Returns:
- the historic items since the given point in time, or
null
if the providedserviceId
does 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 givenitem
until a certain point in time through aPersistenceService
identified 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 thePersistenceService
to use- Returns:
- the future items to the given point in time, or
null
if the providedserviceId
does 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 givenitem
between two points in time through aPersistenceService
identified 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 thePersistenceService
to use- Returns:
- the historic items between the given points in time, or
null
if the providedserviceId
does not refer to an availableQueryablePersistenceService
-
removeAllStatesSince
Removes from persistence the historic items for a givenitem
since a certain point in time. The default persistence service is used. This will only have effect if the pPersistenceService
is 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 givenitem
until a certain point in time. The default persistence service is used. This will only have effect if the pPersistenceService
is 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 givenitem
between two points in time. The default persistence service is used. This will only have effect if the pPersistenceService
is 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 givenitem
since a certain point in time through aPersistenceService
identified by theserviceId
. This will only have effect if the pPersistenceService
is 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 thePersistenceService
to use
-
removeAllStatesUntil
public static void removeAllStatesUntil(Item item, ZonedDateTime timestamp, @Nullable String serviceId) Removes from persistence the future items for a givenitem
until a certain point in time through aPersistenceService
identified by theserviceId
. This will only have effect if the pPersistenceService
is 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 thePersistenceService
to use
-
removeAllStatesBetween
public static void removeAllStatesBetween(Item item, ZonedDateTime begin, ZonedDateTime end, @Nullable String serviceId) Removes from persistence the historic items for a givenitem
beetween two points in time through aPersistenceService
identified by theserviceId
. This will only have effect if the pPersistenceService
is 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 thePersistenceService
to use
-