Package org.rostore.entity
Class VersionMismatchException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.rostore.entity.RoStoreException
org.rostore.entity.VersionMismatchException
- All Implemented Interfaces:
Serializable
Exception thrown when the version of the record in the store is
not the one as requested.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckAndThrow(long dataVersion, long queryVersion, boolean overrideVersion) Checks if the version of the request fits the underlying stored version.static voidcheckAndThrow(long dataVersion, Record queryRecord) Checks if the version of the request fits the underlying stored version.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
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_VERSIONinRecord.- Parameters:
dataVersion- the version of the data in the storequeryRecord- 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 storequeryVersion- the version as provided in the requestoverrideVersion-trueif no checks should be done- Throws:
VersionMismatchException- the exception
-