Class VersionMismatchException

All Implemented Interfaces:
Serializable

public class VersionMismatchException extends RoStoreException
Exception thrown when the version of the record in the store is not the one as requested.
See Also:
  • Method Details

    • checkAndThrow

      public static void checkAndThrow(long dataVersion, Record queryRecord) throws VersionMismatchException
      Checks if the version of the request fits the underlying stored version. If not exception is thrown.

      It may ignore the versioning if the version is can be overridden as set in the RecordOption.OVERRIDE_VERSION in Record.

      Parameters:
      dataVersion - the version of the data in the store
      queryRecord - a record as it should be stored
      Throws:
      VersionMismatchException - the exception
    • checkAndThrow

      public static void checkAndThrow(long dataVersion, long queryVersion, boolean overrideVersion) throws VersionMismatchException
      Checks if the version of the request fits the underlying stored version. If not exception is thrown.

      It may ignore the versioning if the version is just overridden.

      Parameters:
      dataVersion - the version of the entry as stored in the store
      queryVersion - the version as provided in the request
      overrideVersion - true if no checks should be done
      Throws:
      VersionMismatchException - the exception