Package com.evolveum.midpoint.repo.api
Interface ConflictWatcher
- All Known Implementing Classes:
ConflictWatcherImpl
public interface ConflictWatcher
Detects if a repository object was modified in an unexpected way, typically by a different thread.
Unlike
VersionPrecondition, this is not used to prevent modifications, but rather to detect that they
happened and so the caller can later act upon it.
A watcher is connected to a single object, specified at the creation time. See getOid().-
Method Summary
Modifier and TypeMethodDescriptionintWhat is the version we are currently expected?@NotNull StringgetOid()OID of the object this watcher is watching.booleanWas a conflict detected on the object by this watcher?booleantrueif the watcher was initialized, so it actually detects the conflicts.voidsetExpectedVersion(String version) Tells the watcher to expect given version of the object being watched.
-
Method Details
-
getOid
OID of the object this watcher is watching. -
hasConflict
boolean hasConflict()Was a conflict detected on the object by this watcher? -
setExpectedVersion
Tells the watcher to expect given version of the object being watched. Calling this method is optional: If expected version is not provided, it will be determined automatically e.g. on the first MODIFY operation. -
isInitialized
boolean isInitialized()trueif the watcher was initialized, so it actually detects the conflicts. -
getExpectedVersion
int getExpectedVersion()What is the version we are currently expected? Relevant only ifisInitialized()istrue. NOTE: This is a bit of encapsulation breakage. The conflict detection may be based on things other that the object version. However, for some reason, we (probably temporarily) need this information.
-