Returns the enum constant of this class with the specified name.
The string must match exactly an identifier used to declare an
enum constant in this class. (Extraneous whitespace characters are
not permitted.)
Parameters:
name - the name of the enum constant to be returned.
public abstractbooleanisVersionConflictForWrites(long currentVersion,
long expectedVersion,
boolean deleted)
Checks whether the current version conflicts with the expected version, based on the current version type.
Parameters:
currentVersion - the current version for the document
expectedVersion - the version specified for the write operation
deleted - true if the document is currently deleted (note that #currentVersion will typically be
Versions.NOT_FOUND, but may be something else if the document was recently deleted
Returns:
true if versions conflict false o.w.
explainConflictForWrites
public abstractStringexplainConflictForWrites(long currentVersion,
long expectedVersion,
boolean deleted)
currentVersion - the current version for the document
expectedVersion - the version specified for the write operation
deleted - true if the document is currently deleted (note that #currentVersion will typically be
Versions.NOT_FOUND, but may be something else if the document was recently deleted
isVersionConflictForReads
public abstractbooleanisVersionConflictForReads(long currentVersion,
long expectedVersion)
Checks whether the current version conflicts with the expected version, based on the current version type.
Parameters:
currentVersion - the current version for the document
expectedVersion - the version specified for the read operation
Returns:
true if versions conflict false o.w.
explainConflictForReads
public abstractStringexplainConflictForReads(long currentVersion,
long expectedVersion)
Returns a human readable explanation for a version conflict on read.
Note that this method is only called if isVersionConflictForReads(long, long) returns true;
Parameters:
currentVersion - the current version for the document
expectedVersion - the version specified for the read operation
updateVersion
public abstractlongupdateVersion(long currentVersion,
long expectedVersion)
Returns the new version for a document, based on its current one and the specified in the request
Returns:
new version
validateVersionForWrites
public abstractbooleanvalidateVersionForWrites(long version)
validate the version is a valid value for this type when writing.
Returns:
true if valid, false o.w
validateVersionForReads
public abstractbooleanvalidateVersionForReads(long version)
validate the version is a valid value for this type when reading.