Package org.modeshape.jcr.cache.change

Examples of org.modeshape.jcr.cache.change.NodeAdded


    }

    protected void assertNodeAdded( Change change,
                                    String path ) {
        assertThat(change, is(instanceOf(NodeAdded.class)));
        NodeAdded added = (NodeAdded)change;
        assertThat(added.getPath(), is(path(path)));
    }
View Full Code Here


        // Now process the changes ...
        Set<Name> nodeTypesToRefresh = new HashSet<Name>();
        Set<Name> nodeTypesToDelete = new HashSet<Name>();
        for (Change change : changeSet) {
            if (change instanceof NodeAdded) {
                NodeAdded added = (NodeAdded)change;
                Path addedPath = added.getPath();
                if (nodeTypesPath.isAncestorOf(addedPath)) {
                    // Get the name of the node type ...
                    Name nodeTypeName = addedPath.getSegment(2).getName();
                    nodeTypesToRefresh.add(nodeTypeName);
                }
View Full Code Here

        try {
            // Now process the changes ...
            Set<NodeKey> locksToDelete = null;
            for (Change change : changeSet) {
                if (change instanceof NodeAdded) {
                    NodeAdded added = (NodeAdded)change;
                    Path addedPath = added.getPath();
                    if (locksPath.isAncestorOf(addedPath)) {
                        // Get the name of the node type ...
                        Map<Name, Property> props = added.getProperties();
                        NodeKey lockKey = added.getKey();
                        ModeShapeLock lock = new ModeShapeLock(lockKey, props);
                        locksByNodeKey.put(lock.getLockedNodeKey(), lock);
                    }
                } else if (change instanceof NodeRemoved) {
                    NodeRemoved removed = (NodeRemoved)change;
View Full Code Here

                                        } else if (nodeChange instanceof PropertyRemoved) {
                                            ops.remove(propChange.getKey());
                                        }
                                    }
                                } else if (nodeChange instanceof NodeAdded) {
                                    NodeAdded added = (NodeAdded)nodeChange;
                                    Property addedProperty = added.getProperties().get(indexedPropertyName);
                                    if (addedProperty != null) {
                                        ops.add(nodeChange.getKey(), addedProperty);
                                    }
                                } else if (nodeChange instanceof NodeRemoved) {
                                    ops.remove(nodeChange.getKey());
View Full Code Here

                                // We found the location of this property, so no need to search more ...
                                break;
                            }
                        }
                    } else if (nodeChange instanceof NodeAdded) {
                        NodeAdded added = (NodeAdded)nodeChange;
                        for (int i = 0; i != numberOfProperties; ++i) {
                            newProps[i] = added.getProperties().get(indexedPropertyNames[i]);
                            oldProps[i] = null;
                        }
                        // Record the addition ...
                        ops.add(nodeKey, newProps);
                        // And we know that we won't see other changes for this node (or if we do we don't care about them) ...
View Full Code Here

        // It is simple to listen to all local and remote changes. Therefore, any changes made locally to the index definitions
        // will be propagated through the cached representation via this listener.
        AtomicReference<Map<Name, IndexChangeInfo>> changesByProviderName = new AtomicReference<>();
        for (Change change : changeSet) {
            if (change instanceof NodeAdded) {
                NodeAdded added = (NodeAdded)change;
                Path addedPath = added.getPath();
                if (indexesPath.isAncestorOf(addedPath)) {
                    // Get the name of the affected provider ...
                    Name providerName = addedPath.getSegment(2).getName();
                    if (addedPath.size() > 3) {
                        // Adding an index (or column definition), but all we care about is the name of the index
View Full Code Here

TOP

Related Classes of org.modeshape.jcr.cache.change.NodeAdded

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.