Class PersistenceLayer


  • public class PersistenceLayer
    extends Object
    Manages the persistence layer: for now, primarily indicating the version of the connector for which data has been persisted, to validate migration starting points.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static long LATEST_VERSION  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      protected static xtdb.api.XtdbDocument getPersistenceDetails​(xtdb.api.IXtdb xtdbAPI)
      Retrieve details about the persistence layer from the provided XTDB back-end.
      static long getVersion​(xtdb.api.IXtdb xtdbAPI)
      Retrieve the version of the persistence layer for the provided XTDB back-end.
      static boolean isLatestVersion​(xtdb.api.IXtdb xtdbAPI)
      Check whether the persistence layer for the provided XTDB back-end is the latest or not.
      static void setVersion​(xtdb.api.IXtdb xtdbAPI, long version)
      Set the version of the persistence layer for the provided XTDB back-end.
    • Method Detail

      • getVersion

        public static long getVersion​(xtdb.api.IXtdb xtdbAPI)
        Retrieve the version of the persistence layer for the provided XTDB back-end.
        Parameters:
        xtdbAPI - the XTDB back-end for which to retrieve the persistence layer version
        Returns:
        the version of the persistence layer
      • setVersion

        public static void setVersion​(xtdb.api.IXtdb xtdbAPI,
                                      long version)
        Set the version of the persistence layer for the provided XTDB back-end. CAUTION: this is used for migration purposes, so should not be set by anything other than migration utilities.
        Parameters:
        xtdbAPI - the XTDB back-end for which to set the persistence layer version
        version - to set
      • isLatestVersion

        public static boolean isLatestVersion​(xtdb.api.IXtdb xtdbAPI)
        Check whether the persistence layer for the provided XTDB back-end is the latest or not.
        Parameters:
        xtdbAPI - the XTDB back-end for which to check the persistence layer version
        Returns:
        true if it is at the latest version, otherwise false
      • getPersistenceDetails

        protected static xtdb.api.XtdbDocument getPersistenceDetails​(xtdb.api.IXtdb xtdbAPI)
        Retrieve details about the persistence layer from the provided XTDB back-end.
        Parameters:
        xtdbAPI - the XTDB back-end for which to retrieve the persistence layer details
        Returns:
        XtdbDocument containing the details (or null if there are none)