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

Examples of org.apache.jackrabbit.core.persistence.util.NodePropBundle.addChildNodeEntry()


                        int l = (int) System.currentTimeMillis();
                        int r = new Random().nextInt();
                        int n = l + r;
                        String nodeName = Integer.toHexString(n);
                        parentBundle.addChildNodeEntry(NameFactoryImpl
                                .getInstance().create("{}" + nodeName), id);
                        log.info("NodeState '" + id + "' adds itself to its parent node '" + parentId + "' with a new name '" + nodeName + "'");
                        modifications.add(parentBundle);
                    }
                }
View Full Code Here


                            if (fix && lostNFoundId != null) {
                                // add a child to lost+found
                                NodePropBundle lfBundle = pm.loadBundle(lostNFoundId);
                                lfBundle.markOld();
                                String nodeName = id + "-" + System.currentTimeMillis();
                                lfBundle.addChildNodeEntry(NF.create("", nodeName), id);
                                pm.storeBundle(lfBundle);
                                pm.evictBundle(lostNFoundId);

                                // set lost+found parent
                                bundle.setParentId(lostNFoundId);
View Full Code Here

                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
        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

                log.error("NodeState '" + id + "' is not referenced by its parent node '" + parentId + "'");
                int l = (int) System.currentTimeMillis();
                int r = new Random().nextInt();
                int n = l + r;
                String nodeName = Integer.toHexString(n);
                parentBundle.addChildNodeEntry(NameFactoryImpl.getInstance().create("{}" + nodeName), id);
                log.info("NodeState '" + id + "' adds itself to its parent node '" + parentId + "' with a new name '" + nodeName+ "'");
                modifications.add(parentBundle);
              }
            }
        } catch (ItemStateException e) {
View Full Code Here

                                if (fix && lostNFoundId != null) {
                                    // add a child to lost+found
                                    NodePropBundle lfBundle = pm.loadBundle(lostNFoundId);
                                    lfBundle.markOld();
                                    String nodeName = id + "-" + System.currentTimeMillis();
                                    lfBundle.addChildNodeEntry(NF.create("", nodeName), id);
                                    pm.storeBundle(lfBundle);
                                    pm.evictBundle(lostNFoundId);

                                    // set lost+found parent
                                    bundle.setParentId(lostNFoundId);
View Full Code Here

        assertTrue("Double check didn't remove invalid error", checker.getReport().getItems().isEmpty());
    }

    public void testFixMissingNode() throws RepositoryException, ClusterException {
        NodePropBundle bundle = new NodePropBundle(new NodeId(0, 0));
        bundle.addChildNodeEntry(nameFactory.create("", "test"), new NodeId(0, 1));

        MockPersistenceManager pm = new MockPersistenceManager(Arrays.asList(bundle));

        ConsistencyCheckerImpl checker = new ConsistencyCheckerImpl(pm, null, null, master.createUpdateChannel("default"));
View Full Code Here

    }

    public void testDoubleCheckMissingNode() throws RepositoryException {
        NodePropBundle bundle = new NodePropBundle(new NodeId(0, 0));
        final NodeId childNodeId = new NodeId(0, 1);
        bundle.addChildNodeEntry(nameFactory.create("", "test"), childNodeId);

        MockPersistenceManager pm = new MockPersistenceManager(Arrays.asList(bundle));

        ConsistencyCheckerImpl checker = new ConsistencyCheckerImpl(pm, null, null, null);
View Full Code Here

                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
        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

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.