Package org.nuxeo.ecm.core.storage.dbs
Class DBSDocumentState
java.lang.Object
org.nuxeo.ecm.core.storage.dbs.DBSDocumentState
Implementation of a
Document
state for Document-Based Storage.
It wraps a State
, together with a dirty flag.
- Since:
- 5.9.4
-
Field Summary
-
Constructor Summary
ConstructorDescriptionConstructs an empty state.DBSDocumentState
(State base) Constructs a document state from the copy of an existing base state. -
Method Summary
Modifier and TypeMethodDescriptionboolean
containsKey
(String key) getId()
getName()
Gets the original state for this, needed when creating an undo log.getState()
Gets the state.Gets a diff of what changed since this document state was read from database or saved.boolean
isDirty()
Checks if the document state has been changed since its construction or the last call tosetNotDirty()
.void
This must be called if we're about to directly change the internal state.void
put
(String key, Serializable value) void
toString()
boolean
validateUserVisibleChangeToken
(String userVisibleChangeToken)
-
Field Details
-
state
The current state. -
originalState
When non-null, the original state (otherwise the state hasn't been modified).
-
-
Constructor Details
-
DBSDocumentState
public DBSDocumentState()Constructs an empty state. -
DBSDocumentState
Constructs a document state from the copy of an existing base state.
-
-
Method Details
-
markDirty
public void markDirty()This must be called if we're about to directly change the internal state. -
isDirty
public boolean isDirty()Checks if the document state has been changed since its construction or the last call tosetNotDirty()
. -
setNotDirty
public void setNotDirty() -
getState
Gets the state. If the caller changes the state, it must also callmarkDirty()
to inform this object that the state is dirtied. -
getStateChange
Gets a diff of what changed since this document state was read from database or saved.- Returns:
null
if there was no change, or aState.StateDiff
-
getOriginalState
Gets the original state for this, needed when creating an undo log.- Returns:
- a state that must not be modified
- Since:
- 7.4
-
get
-
put
-
containsKey
-
getId
-
getParentId
-
getName
-
getPrimaryType
-
getVersionSeriesId
-
getSysChangeToken
-
getChangeToken
-
validateUserVisibleChangeToken
-
toString
-