Search in sources :

Example 26 with ItemState

use of org.apache.jackrabbit.core.state.ItemState in project jackrabbit by apache.

the class ChangeLogRecord method doWrite.

/**
 * {@inheritDoc}
 */
@Override
protected void doWrite() throws JournalException {
    writeTimestampRecord();
    writeUserDataRecord();
    for (ItemState state : changes.deletedStates()) {
        if (state.isNode()) {
            writeNodeRecord(DELETED, (NodeState) state);
        } else {
            writePropertyRecord(DELETED, (PropertyState) state);
        }
    }
    for (ItemState state : changes.modifiedStates()) {
        if (state.isNode()) {
            writeNodeRecord(MODIFIED, (NodeState) state);
        } else {
            writePropertyRecord(MODIFIED, (PropertyState) state);
        }
    }
    for (ItemState state : changes.addedStates()) {
        if (state.isNode()) {
            writeNodeRecord(ADDED, (NodeState) state);
        } else {
            writePropertyRecord(ADDED, (PropertyState) state);
        }
    }
    for (EventState event : events) {
        writeEventRecord(event);
    }
}
Also used : EventState(org.apache.jackrabbit.core.observation.EventState) ItemState(org.apache.jackrabbit.core.state.ItemState)

Aggregations

ItemState (org.apache.jackrabbit.core.state.ItemState)26 RepositoryException (javax.jcr.RepositoryException)15 NodeId (org.apache.jackrabbit.core.id.NodeId)12 ItemStateException (org.apache.jackrabbit.core.state.ItemStateException)12 NoSuchItemStateException (org.apache.jackrabbit.core.state.NoSuchItemStateException)11 InvalidItemStateException (javax.jcr.InvalidItemStateException)8 ItemNotFoundException (javax.jcr.ItemNotFoundException)8 NodeState (org.apache.jackrabbit.core.state.NodeState)7 ItemId (org.apache.jackrabbit.core.id.ItemId)5 SessionItemStateManager (org.apache.jackrabbit.core.state.SessionItemStateManager)5 HashSet (java.util.HashSet)4 EffectiveNodeType (org.apache.jackrabbit.core.nodetype.EffectiveNodeType)4 ChildNodeEntry (org.apache.jackrabbit.core.state.ChildNodeEntry)4 ConstraintViolationException (javax.jcr.nodetype.ConstraintViolationException)3 PropertyId (org.apache.jackrabbit.core.id.PropertyId)3 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 LinkedHashSet (java.util.LinkedHashSet)2 AccessDeniedException (javax.jcr.AccessDeniedException)2 NodeTypeImpl (org.apache.jackrabbit.core.nodetype.NodeTypeImpl)2