Package org.apache.jackrabbit.core.persistence.util

Examples of org.apache.jackrabbit.core.persistence.util.NodePropBundle


            return true;
        }

        @Override
        void doRepair(final ChangeLog changes) throws ItemStateException {
            final NodePropBundle bundle = getBundle(nodeId);
            final Iterator<NodePropBundle.ChildNodeEntry> entryIterator = bundle.getChildNodeEntries().iterator();
            while (entryIterator.hasNext()) {
                final NodePropBundle.ChildNodeEntry childNodeEntry = entryIterator.next();
                if (childNodeEntry.getId().equals(childNodeId)) {
                    entryIterator.remove();
                    saveBundle(bundle);
View Full Code Here


            }
        }

        @Override
        boolean doubleCheck() throws ItemStateException {
            final NodePropBundle childBundle = pm.loadBundle(childNodeId);
            if (childBundle == null) {
                final NodePropBundle bundle = pm.loadBundle(nodeId);
                if (bundle != null) {
                    for (NodePropBundle.ChildNodeEntry entry : bundle.getChildNodeEntries()) {
                        if (entry.getId().equals(childNodeId)) {
                            return true;
                        }
                    }
                }
View Full Code Here

            return true;
        }

        @Override
        void doRepair(final ChangeLog changes) throws ItemStateException {
            NodePropBundle bundle = getBundle(nodeId);
            final Iterator<NodePropBundle.ChildNodeEntry> entryIterator = bundle.getChildNodeEntries().iterator();
            while (entryIterator.hasNext()) {
                final NodePropBundle.ChildNodeEntry childNodeEntry = entryIterator.next();
                if (childNodeEntry.getId().equals(childNodeId)) {
                    entryIterator.remove();
                    saveBundle(bundle);
View Full Code Here

            }
        }

        @Override
        boolean doubleCheck() throws ItemStateException {
            final NodePropBundle childBundle = pm.loadBundle(childNodeId);
            if (childBundle != null && !childBundle.getParentId().equals(nodeId)) {
                final NodePropBundle bundle = pm.loadBundle(nodeId);
                if (bundle != null) {
                    // double check if the child node entry is still there
                    for (NodePropBundle.ChildNodeEntry entry : bundle.getChildNodeEntries()) {
                        if (entry.getId().equals(childNodeId)) {
                            return true;
                        }
                    }
                }
View Full Code Here

        }

        @Override
        void doRepair(final ChangeLog changes) throws ItemStateException {
            if (lostNFoundId != null) {
                final NodePropBundle bundle = getBundle(nodeId);
                final NodePropBundle lfBundle = getBundle(lostNFoundId);

                final String nodeName = nodeId + "-" + System.currentTimeMillis();
                final NameFactory nameFactory = NameFactoryImpl.getInstance();
                lfBundle.addChildNodeEntry(nameFactory.create("", nodeName), nodeId);
                bundle.setParentId(lostNFoundId);

                saveBundle(bundle);
                saveBundle(lfBundle);
View Full Code Here

            }
        }

        @Override
        boolean doubleCheck() throws ItemStateException {
            final NodePropBundle parentBundle = pm.loadBundle(parentNodeId);
            if (parentBundle == null) {
                final NodePropBundle bundle = pm.loadBundle(nodeId);
                if (bundle != null) {
                    if (parentNodeId.equals(bundle.getParentId())) {
                        return true;
                    }
                }
            }
            return false;
View Full Code Here

            return true;
        }

        @Override
        void doRepair(final ChangeLog changes) throws ItemStateException {
            final NodePropBundle parentBundle = getBundle(parentNodeId);

            parentBundle.addChildNodeEntry(createNodeName(), nodeId);

            saveBundle(parentBundle);
            changes.modified(new NodeState(parentNodeId, null, null, ItemState.STATUS_EXISTING, false));
        }
View Full Code Here

            return nameFactory.create("{}" + localName);
        }

        @Override
        boolean doubleCheck() throws ItemStateException {
            final NodePropBundle parentBundle = pm.loadBundle(parentNodeId);
            if (parentBundle != null) {
                for (NodePropBundle.ChildNodeEntry entry : parentBundle.getChildNodeEntries()) {
                    if (entry.getId().equals(nodeId)) {
                        return false;
                    }
                }
            }
            final NodePropBundle bundle = pm.loadBundle(nodeId);
            if (bundle != null) {
                if (parentNodeId.equals(bundle.getParentId())) {
                    return true;
                }
            }
            return false;
        }
View Full Code Here

     * {@inheritDoc}
     *
     * Loads the state via the appropriate NodePropBundle.
     */
    public NodeState load(NodeId id) throws NoSuchItemStateException, ItemStateException {
        NodePropBundle bundle = getBundle(id);
        if (bundle == null) {
            throw new NoSuchItemStateException(id.toString());
        }
        return bundle.createNodeState(this);
    }
View Full Code Here

     * {@inheritDoc}
     *
     * Loads the state via the appropriate NodePropBundle.
     */
    public PropertyState load(PropertyId id) throws NoSuchItemStateException, ItemStateException {
        NodePropBundle bundle = getBundle(id.getParentId());
        if (bundle != null) {
            PropertyState state = createNew(id);
            PropertyEntry p = bundle.getPropertyEntry(id.getName());
            if (p != null) {
                state.setMultiValued(p.isMultiValued());
                state.setType(p.getType());
                state.setValues(p.getValues());
                state.setModCount(p.getModCount());
            } else if (id.getName().equals(JCR_UUID)) {
                state.setType(PropertyType.STRING);
                state.setMultiValued(false);
                state.setValues(new InternalValue[] {
                        InternalValue.create(id.getParentId().toString()) });
            } else if (id.getName().equals(JCR_PRIMARYTYPE)) {
                state.setType(PropertyType.NAME);
                state.setMultiValued(false);
                state.setValues(new InternalValue[] {
                        InternalValue.create(bundle.getNodeTypeName()) });
            } else if (id.getName().equals(JCR_MIXINTYPES)) {
                state.setType(PropertyType.NAME);
                state.setMultiValued(true);
                Set<Name> mixins = bundle.getMixinTypeNames();
                state.setValues(InternalValue.create(
                        mixins.toArray(new Name[mixins.size()])));
            } else {
                throw new NoSuchItemStateException(id.toString());
            }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.core.persistence.util.NodePropBundle

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.