Package org.nuxeo.ecm.core.storage.dbs
Class DBSDocumentState
- java.lang.Object
-
- org.nuxeo.ecm.core.storage.dbs.DBSDocumentState
-
-
Field Summary
Fields Modifier and Type Field Description protected State
originalState
When non-null, the original state (otherwise the state hasn't been modified).protected State
state
The current state.
-
Constructor Summary
Constructors Constructor Description DBSDocumentState()
Constructs an empty state.DBSDocumentState(State base)
Constructs a document state from the copy of an existing base state.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsKey(String key)
Serializable
get(String key)
Long
getChangeToken()
String
getId()
String
getName()
State
getOriginalState()
Gets the original state for this, needed when creating an undo log.String
getParentId()
String
getPrimaryType()
State
getState()
Gets the state.State.StateDiff
getStateChange()
Gets a diff of what changed since this document state was read from database or saved.Long
getSysChangeToken()
String
getVersionSeriesId()
boolean
isDirty()
Checks if the document state has been changed since its construction or the last call tosetNotDirty()
.void
markDirty()
This must be called if we're about to directly change the internal state.void
put(String key, Serializable value)
void
setNotDirty()
String
toString()
boolean
validateUserVisibleChangeToken(String userVisibleChangeToken)
-
-
-
Constructor Detail
-
DBSDocumentState
public DBSDocumentState()
Constructs an empty state.
-
DBSDocumentState
public DBSDocumentState(State base)
Constructs a document state from the copy of an existing base state.
-
-
Method Detail
-
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
public State getState()
Gets the state. If the caller changes the state, it must also callmarkDirty()
to inform this object that the state is dirtied.
-
getStateChange
public State.StateDiff 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
public State 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
public Serializable get(String key)
-
put
public void put(String key, Serializable value)
-
containsKey
public boolean containsKey(String key)
-
getId
public String getId()
-
getParentId
public String getParentId()
-
getName
public String getName()
-
getPrimaryType
public String getPrimaryType()
-
getVersionSeriesId
public String getVersionSeriesId()
-
getSysChangeToken
public Long getSysChangeToken()
-
getChangeToken
public Long getChangeToken()
-
validateUserVisibleChangeToken
public boolean validateUserVisibleChangeToken(String userVisibleChangeToken)
-
-