Package org.modeshape.jcr.cache.change

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


                                    JcrEventBundle bundle,
                                    Change change ) {
            if (!(change instanceof AbstractNodeChange)) {
                return;
            }
            AbstractNodeChange nodeChange = (AbstractNodeChange)change;
            if (LOGGER.isDebugEnabled()) {
                LOGGER.debug("Processing change: " + nodeChange);
            }

            if (shouldRejectChange(nodeChange)) {
                return;
            }

            // process event making sure we have the right event type
            Path newPath = nodeChange.getPath();
            String nodeId = nodeIdentifier(nodeChange.getKey());
            NodeType primaryType = nodeType(nodeChange.getPrimaryType());
            Set<NodeType> mixinTypes = nodeTypes(nodeChange.getMixinTypes());

            // node moved
            if (nodeChange instanceof NodeMoved) {
                NodeMoved nodeMovedChange = (NodeMoved)nodeChange;
                Path oldPath = nodeMovedChange.getOldPath();
View Full Code Here


        public void notify( ChangeSet changeSet ) {
            if (ops.start(changeSet.getWorkspaceName(), isLocal(changeSet))) {
                try {
                    for (Change change : changeSet) {
                        if (change instanceof AbstractNodeChange) {
                            AbstractNodeChange nodeChange = (AbstractNodeChange)change;
                            if (acceptableNodeType(nodeChange)) {
                                if (nodeChange instanceof AbstractPropertyChange) {
                                    AbstractPropertyChange propChange = (AbstractPropertyChange)nodeChange;
                                    Property property = propChange.getProperty();
                                    if (indexedPropertyName.equals(property.getName())) {
                                        if (nodeChange instanceof PropertyAdded) {
                                            ops.add(propChange.getKey(), property);
                                        } else if (nodeChange instanceof PropertyChanged) {
                                            PropertyChanged changedProperty = (PropertyChanged)nodeChange;
                                            ops.change(propChange.getKey(), property, changedProperty.getOldProperty());
                                        } 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());
                                }
                            }
                        }
                    }
                } finally {
View Full Code Here

                    if (!(change instanceof AbstractNodeChange)) {
                        // This is not a change we care about, and in fact it does tell us that the next change (if any) will be
                        // for a different node than we've seen already ...
                        continue;
                    }
                    AbstractNodeChange nodeChange = (AbstractNodeChange)change;
                    if (!acceptableNodeType(nodeChange)) {
                        // This is not a change we care about, and in fact it does tell us that the next change (if any) will be
                        // for a different node than we've seen already ...
                        continue;
                    }
                    // This is a node that we're interested in, and it might be the same node that the last change was for ...
                    if (nodeKey == null) {
                        // This is the first node we've seen, so there's nothing to do yet ...
                        nodeKey = nodeChange.getKey();
                    } else if (!nodeKey.equals(nodeChange.getKey())) {
                        // This is a different node than we've seen previously in this ChangeSet, so process the previous events
                        // ...
                        processProperties();
                        nodeKey = nodeChange.getKey();
                    }
                    // We know we care about this node type, so figure out if there are any properties we care about ...
                    if (nodeChange instanceof AbstractPropertyChange) {
                        AbstractPropertyChange propChange = (AbstractPropertyChange)nodeChange;
                        Property property = propChange.getProperty();
View Full Code Here

TOP

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

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.