Package org.apache.jackrabbit.core.id

Examples of org.apache.jackrabbit.core.id.NodeReferencesId


                if (prop.getType() == PropertyType.REFERENCE) {
                    InternalValue[] vals = prop.getValues();
                    for (int i = 0; vals != null && i < vals.length; i++) {
                        addVirtualReference(
                                references, prop.getPropertyId(),
                                new NodeReferencesId(vals[i].getNodeId()));
                    }
                }
            }
        }
        for (Iterator iter = changes.modifiedStates(); iter.hasNext();) {
            ItemState state = (ItemState) iter.next();
            if (!state.isNode()) {
                PropertyState newProp = (PropertyState) state;
                PropertyState oldProp =
                        (PropertyState) getItemState(state.getId());
                if (oldProp.getType() == PropertyType.REFERENCE) {
                    InternalValue[] vals = oldProp.getValues();
                    for (int i = 0; vals != null && i < vals.length; i++) {
                        removeVirtualReference(
                                references, oldProp.getPropertyId(),
                                new NodeReferencesId(vals[i].getNodeId()));
                    }
                }
                if (newProp.getType() == PropertyType.REFERENCE) {
                    InternalValue[] vals = newProp.getValues();
                    for (int i = 0; vals != null && i < vals.length; i++) {
                        addVirtualReference(
                                references, newProp.getPropertyId(),
                                new NodeReferencesId(vals[i].getNodeId()));
                    }
                }
            }
        }
        for (Iterator iter = changes.deletedStates(); iter.hasNext();) {
            ItemState state = (ItemState) iter.next();
            if (!state.isNode()) {
                PropertyState prop = (PropertyState) state;
                if (prop.getType() == PropertyType.REFERENCE) {
                    InternalValue[] vals = prop.getValues();
                    for (int i = 0; vals != null && i < vals.length; i++) {
                        removeVirtualReference(
                                references, prop.getPropertyId(),
                                new NodeReferencesId(vals[i].getNodeId()));
                    }
                }
            }
        }
View Full Code Here


            }
        }

        private void addReference(PropertyId id, NodeId target)
                throws ItemStateException {
            NodeReferencesId refsId = new NodeReferencesId(target);
            if (virtualProvider == null
                    || !virtualProvider.hasNodeReferences(refsId)) {
                // get or create the references instance
                NodeReferences refs = local.get(refsId);
                if (refs == null) {
View Full Code Here

            }
        }

        private void removeReference(PropertyId id, NodeId target)
                throws ItemStateException {
            NodeReferencesId refsId = new NodeReferencesId(target);
            if (virtualProvider == null
                    || !virtualProvider.hasNodeReferences(refsId)) {
                // either get node references from change log or load from
                // persistence manager
                NodeReferences refs = local.get(refsId);
View Full Code Here

            for (Iterator<ItemState> iter = local.deletedStates(); iter.hasNext();) {
                ItemState state = iter.next();
                if (state.isNode()) {
                    NodeState node = (NodeState) state;
                    if (isReferenceable(node)) {
                        NodeReferencesId refsId = new NodeReferencesId(node.getNodeId());
                        // either get node references from change log or
                        // load from persistence manager
                        NodeReferences refs = local.get(refsId);
                        if (refs == null) {
                            if (!hasNodeReferences(refsId)) {
View Full Code Here

    }

    private static boolean hasDependency(ChangeLog changeLog, ItemId id) {
        try {
            if (changeLog.get(id) == null) {
                if (!id.denotesNode() || changeLog.get(new NodeReferencesId((NodeId) id)) == null) {
                    // change log does not contain the item
                    return false;
                }
            }
        } catch (NoSuchItemStateException e) {
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.core.id.NodeReferencesId

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.