public class ChangeLog extends Object
Constructor and Description |
---|
ChangeLog() |
Modifier and Type | Method and Description |
---|---|
void |
added(ItemState state)
A state has been added
|
Iterable<ItemState> |
addedStates()
Return the added states in this change log.
|
boolean |
deleted(ItemId id)
Return a flag indicating whether a given item state is marked as
deleted in this log.
|
void |
deleted(ItemState state)
A state has been deleted.
|
Iterable<ItemState> |
deletedStates()
Return the deleted states in this change log.
|
void |
disconnect()
Disconnect all states in the change log from their overlaid
states.
|
ItemState |
get(ItemId id)
Return an item state given its id.
|
NodeReferences |
getReferencesTo(NodeId id)
Return a node references object given the target node id.
|
long |
getUpdateSize()
Returns the update size of the change log.
|
boolean |
has(ItemId id)
Return a flag indicating whether a given item state exists.
|
boolean |
hasUpdates()
Checks whether this change log contains any changes.
|
boolean |
isAdded(ItemId id)
Return a flag indicating whether a given item state is marked as
added in this log.
|
boolean |
isModified(ItemId id)
Returns a flag indicating whether a given item state is marked as
modified in this log.
|
void |
merge(ChangeLog other)
Merge another change log with this change log
|
void |
modified(ItemState state)
A state has been modified.
|
void |
modified(NodeReferences refs)
A references has been modified
|
Iterable<NodeReferences> |
modifiedRefs()
Return the modified references in this change log.
|
Iterable<ItemState> |
modifiedStates()
Return the modified states in this change log.
|
void |
persisted()
After the states have actually been persisted, update their
internal states and notify listeners.
|
void |
push()
Push all states contained in the various maps of
items we have.
|
void |
removeReferencesEntry(NodeId targetId)
Removes the references entry with the given target node id.
|
void |
reset()
Reset this change log, removing all members inside the
maps we built.
|
void |
setUpdateSize(long updateSize)
Sets the update size of the change log.
|
String |
toString()
Returns a string representation of this change log for diagnostic
purposes.
|
void |
undo(ItemStateManager parent)
Undo changes made to items in the change log.
|
public boolean hasUpdates()
true
if this log contains at least one change,
false
otherwisepublic void added(ItemState state)
state
- state that has been addedpublic void modified(ItemState state)
state
- state that has been modifiedpublic void deleted(ItemState state)
state
- state that has been deletedpublic void modified(NodeReferences refs)
refs
- refs that has been modifiedpublic void removeReferencesEntry(NodeId targetId)
VersionItemStateManager
to drop
references to virtual nodes.targetId
- target node idpublic ItemState get(ItemId id) throws NoSuchItemStateException
null
if the item state is neither in the added nor in the modified
section. Throws a NoSuchItemStateException
if
the item state is in the deleted section.null
NoSuchItemStateException
- if the item has been deletedpublic boolean has(ItemId id)
true
if item state exists within this
log; false
otherwisepublic boolean deleted(ItemId id)
true
if item state is marked as deleted in this
log; false
otherwisepublic boolean isAdded(ItemId id)
true
if item state is marked as added in this
log; false
otherwisepublic boolean isModified(ItemId id)
id
- the id of the item.true
if the item state is marked as modified in this
log; false
otherwise.public NodeReferences getReferencesTo(NodeId id)
null
if the node reference is not in the modified
section.null
public Iterable<ItemState> addedStates()
public Iterable<ItemState> modifiedStates()
Note that this change log must not be modified while iterating through the returned states.
public Iterable<ItemState> deletedStates()
Note that this change log must not be modified while iterating through the returned states.
public Iterable<NodeReferences> modifiedRefs()
Note that this change log must not be modified while iterating through the returned states.
public void merge(ChangeLog other)
other
- other change logpublic void push()
public void persisted()
public void reset()
public void disconnect()
public void undo(ItemStateManager parent)
parent
- parent manager that will hold current datapublic long getUpdateSize()
public void setUpdateSize(long updateSize)
updateSize
- The update size.Copyright © 2004–2021 The Apache Software Foundation. All rights reserved.