Interface PersistenceService

  • All Known Subinterfaces:
    ModifiablePersistenceService, QueryablePersistenceService

    @NonNullByDefault
    public interface PersistenceService
    A persistence service which can be used to store data from openHAB. This must not necessarily be a local database, a persistence service can also be cloud-based or a simply data-export facility (e.g. for sending data to an IoT (Internet of Things) service.
    Author:
    Kai Kreuzer - Initial contribution
    • Method Detail

      • store

        void store​(Item item)
        Stores the current value of the given item.

        Implementors should keep in mind that all registered PersistenceServices are called synchronously. Hence long running operations should be processed asynchronously. E.g. store adds things to a queue which is processed by some asynchronous workers (Quartz Job, Thread, etc.).

        Parameters:
        item - the item which state should be persisted.
      • store

        void store​(Item item,
                   @Nullable String alias)

        Stores the current value of the given item under a specified alias.

        Implementors should keep in mind that all registered PersistenceServices are called synchronously. Hence long running operations should be processed asynchronously. E.g. store adds things to a queue which is processed by some asynchronous workers (Quartz Job, Thread, etc.).

        Parameters:
        item - the item which state should be persisted.
        alias - the alias under which the item should be persisted.
      • getDefaultStrategies

        List<PersistenceStrategy> getDefaultStrategies()
        Provides default persistence strategies that are used for all items if no user defined configuration is found.
        Returns:
        The default persistence strategies