Search in sources :

Example 1 with IdentifierTracker

use of org.apache.jackrabbit.oak.plugins.identifier.IdentifierTracker in project jackrabbit-oak by apache.

the class QueueingHandler method nodeMoved.

@Override
public void nodeMoved(final String sourcePath, String name, NodeState moved) {
    IdentifierTracker tracker = identifierTracker.getChildTracker(name, moved);
    AggregationResult aggregated = aggregate(name, moved, tracker);
    queue.addEvent(factory.nodeMoved(aggregated.primaryType, aggregated.mixinTypes, aggregated.pathTracker.getPath(), aggregated.name, aggregated.identifierTracker.getIdentifier(), sourcePath));
}
Also used : IdentifierTracker(org.apache.jackrabbit.oak.plugins.identifier.IdentifierTracker)

Example 2 with IdentifierTracker

use of org.apache.jackrabbit.oak.plugins.identifier.IdentifierTracker in project jackrabbit-oak by apache.

the class QueueingHandler method nodeReordered.

@Override
public void nodeReordered(final String destName, final String name, NodeState reordered) {
    IdentifierTracker tracker = identifierTracker.getChildTracker(name, reordered);
    AggregationResult aggregated = aggregate(name, reordered, tracker);
    queue.addEvent(factory.nodeReordered(aggregated.primaryType, aggregated.mixinTypes, aggregated.pathTracker.getPath(), aggregated.name, aggregated.identifierTracker.getIdentifier(), destName));
}
Also used : IdentifierTracker(org.apache.jackrabbit.oak.plugins.identifier.IdentifierTracker)

Example 3 with IdentifierTracker

use of org.apache.jackrabbit.oak.plugins.identifier.IdentifierTracker in project jackrabbit-oak by apache.

the class QueueingHandler method aggregate.

private AggregationResult aggregate(String name, NodeState node, IdentifierTracker childTracker) {
    int aggregationLevel = 0;
    if (aggregator != null) {
        aggregationLevel = aggregator.aggregate(root, parents, new MemoryChildNodeEntry(name, node));
    }
    if (aggregationLevel <= 0) {
        // no aggregation
        return new AggregationResult(name, childTracker, getPrimaryType(node), getMixinTypes(node), pathTracker);
    } else {
        QueueingHandler handler = this;
        IdentifierTracker tracker = childTracker;
        String primaryType = null;
        Iterable<String> mixinTypes = null;
        PathTracker pathTracker = null;
        String childName = null;
        for (int i = 0; i < aggregationLevel; i++) {
            if (i > 0) {
                name = childName + "/" + name;
            }
            tracker = handler.identifierTracker;
            primaryType = handler.parentType;
            mixinTypes = handler.parentMixins;
            pathTracker = handler.pathTracker;
            childName = handler.name;
            handler = handler.parent;
        }
        return new AggregationResult(name, tracker, primaryType, mixinTypes, pathTracker);
    }
}
Also used : PathTracker(org.apache.jackrabbit.oak.namepath.PathTracker) MemoryChildNodeEntry(org.apache.jackrabbit.oak.plugins.memory.MemoryChildNodeEntry) IdentifierTracker(org.apache.jackrabbit.oak.plugins.identifier.IdentifierTracker)

Example 4 with IdentifierTracker

use of org.apache.jackrabbit.oak.plugins.identifier.IdentifierTracker in project jackrabbit-oak by apache.

the class QueueingHandler method nodeAdded.

@Override
public void nodeAdded(String name, NodeState after) {
    IdentifierTracker tracker = identifierTracker.getChildTracker(name, after);
    AggregationResult aggregated = aggregate(name, after, tracker);
    queue.addEvent(factory.nodeAdded(aggregated.primaryType, aggregated.mixinTypes, aggregated.pathTracker.getPath(), aggregated.name, aggregated.identifierTracker.getIdentifier()));
}
Also used : IdentifierTracker(org.apache.jackrabbit.oak.plugins.identifier.IdentifierTracker)

Example 5 with IdentifierTracker

use of org.apache.jackrabbit.oak.plugins.identifier.IdentifierTracker in project jackrabbit-oak by apache.

the class QueueingHandler method nodeDeleted.

@Override
public void nodeDeleted(String name, NodeState before) {
    IdentifierTracker tracker = beforeIdentifierTracker.getChildTracker(name, before);
    AggregationResult aggregated = aggregate(name, before, tracker);
    queue.addEvent(factory.nodeDeleted(aggregated.primaryType, aggregated.mixinTypes, aggregated.pathTracker.getPath(), aggregated.name, aggregated.identifierTracker.getIdentifier()));
}
Also used : IdentifierTracker(org.apache.jackrabbit.oak.plugins.identifier.IdentifierTracker)

Aggregations

IdentifierTracker (org.apache.jackrabbit.oak.plugins.identifier.IdentifierTracker)5 PathTracker (org.apache.jackrabbit.oak.namepath.PathTracker)1 MemoryChildNodeEntry (org.apache.jackrabbit.oak.plugins.memory.MemoryChildNodeEntry)1