Examples of NodeReferencesId


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

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

            }
        }

        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

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

            }
        }

        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

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

            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

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

    }

    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

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

    protected void store(NodeReferences refs) throws ItemStateException {
        if (!initialized) {
            throw new IllegalStateException("not initialized");
        }

        NodeReferencesId id = refs.getId();
        String refsFilePath = buildNodeReferencesFilePath(id);
        FileSystemResource refsFile = new FileSystemResource(itemStateFS, refsFilePath);
        try {
            refsFile.makeParentDirs();
            OutputStream os = refsFile.getOutputStream();
View Full Code Here

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

    protected void destroy(NodeReferences refs) throws ItemStateException {
        if (!initialized) {
            throw new IllegalStateException("not initialized");
        }

        NodeReferencesId id = refs.getId();
        String refsFilePath = buildNodeReferencesFilePath(id);
        FileSystemResource refsFile = new FileSystemResource(itemStateFS, refsFilePath);
        try {
            if (refsFile.exists()) {
                // delete resource and prune empty parent folders
View Full Code Here

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

    public PropertyIterator getReferences() throws RepositoryException {
        // check state of this instance
        sanityCheck();

        try {
            NodeReferencesId targetId = new NodeReferencesId((NodeId) id);
            if (stateMgr.hasNodeReferences(targetId)) {
                NodeReferences refs = stateMgr.getNodeReferences(targetId);
                // refs.getReferences() returns a list of PropertyId's
                List idList = refs.getReferences();
                return new LazyItemIterator(itemMgr, idList);
View Full Code Here

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

        try {
            int n = in.readInt();   // number of entries
            while (n-- > 0) {
                String s = in.readUTF();    // target id
                NodeReferencesId id = (NodeReferencesId) NodeReferencesId.valueOf(s);
                int length = in.readInt()// data length
                byte[] data = new byte[length];
                in.readFully(data)// data
                // store in map
                refsStore.put(id, data);
View Full Code Here

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

        try {
            out.writeInt(refsStore.size()); // number of entries
            // entries
            Iterator iterKeys = refsStore.keySet().iterator();
            while (iterKeys.hasNext()) {
                NodeReferencesId id = (NodeReferencesId) iterKeys.next();
                out.writeUTF(id.toString());    // target id
                byte[] data = (byte[]) refsStore.get(id);
                out.writeInt(data.length)// data length
                out.write(data);    // data
            }
        } finally {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.