Examples of MongoNode


Examples of org.apache.jackrabbit.mongomk.impl.model.MongoNode

        if (pathAndNodeMap.isEmpty()) {
            return true;
        }

        MongoNode nodeMongo = pathAndNodeMap.get(path);
        if (nodeMongo != null) {
            verified = true;
            if ((depth == -1) || (currentDepth < depth)) {
                List<String> childNames = nodeMongo.getChildren();
                if (childNames != null) {
                    for (String childName : childNames) {
                        String childPath = PathUtils.concat(path, childName);
                        verified = verifyNodeHierarchyRec(childPath, ++currentDepth);
                        if (!verified) {
View Full Code Here

Examples of org.apache.jackrabbit.mongomk.impl.model.MongoNode

        }
    }

    private void mergeNodes() {
        for (MongoNode committingNode : nodes.values()) {
            MongoNode existingNode = existingNodes.get(committingNode.getPath());
            if (existingNode != null) {
                if(logger.isDebugEnabled()){
                    logger.debug("Found existing node to merge: {}", existingNode.getPath());
                    logger.debug("Existing node: {}", existingNode);
                    logger.debug("Committing node: {}", committingNode);
                }
                Map<String, Object> existingProperties = existingNode.getProperties();
                if (!existingProperties.isEmpty()) {
                    committingNode.setProperties(existingProperties);

                    logger.debug("Merged properties for {}: {}", existingNode.getPath(),
                            existingProperties);
                }

                List<String> existingChildren = existingNode.getChildren();
                if (existingChildren != null) {
                    committingNode.setChildren(existingChildren);

                    logger.debug("Merged children for {}: {}", existingNode.getPath(), existingChildren);
                }

                logger.debug("Merged node for {}: {}", existingNode.getPath(), committingNode);
            } else {
                // FIXME: this may also mean a node we modify has
                // been removed in the meantime
            }
        }
View Full Code Here

Examples of org.apache.jackrabbit.mongomk.impl.model.MongoNode

    public static void assertNodeRevisionId(String path, String revisionId,
            boolean exists) throws Exception {
        DBCollection nodeCollection = nodeStore.getNodeCollection();
        DBObject query = QueryBuilder.start(MongoNode.KEY_PATH).is(path).and(MongoNode.KEY_REVISION_ID)
                .is(MongoUtil.toMongoRepresentation(revisionId)).get();
        MongoNode nodeMongo = (MongoNode) nodeCollection.findOne(query);

        if (exists) {
            Assert.assertNotNull(nodeMongo);
        } else {
            Assert.assertNull(nodeMongo);
View Full Code Here

Examples of org.apache.jackrabbit.mongomk.impl.model.MongoNode

            }
        }

        DBObject query = qb.get();

        MongoNode nodeMongo = (MongoNode) nodeCollection.findOne(query);
        Assert.assertNotNull(nodeMongo);

        List<String> nodeMongoChildren = nodeMongo.getChildren();
        int actual = nodeMongoChildren != null? nodeMongoChildren.size() : 0;
        Assert.assertEquals(expected.getChildNodeCount(), actual);

        for (Iterator<Node> it = expected.getChildNodeEntries(0, -1); it.hasNext(); ) {
            Node childNode = it.next();
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.