Examples of NodeMap


Examples of org.apache.jackrabbit.mk.simple.NodeMap

        try {
            String head = mk.getHeadRevision();
            VirtualRepositoryWrapper vm = new VirtualRepositoryWrapper(mk);
            if (mk.nodeExists(MOUNT, head)) {
                String mounts = mk.getNodes(MOUNT, head);
                NodeMap map = new NodeMap();
                JsopReader t = new JsopTokenizer(mounts);
                t.read('{');
                NodeImpl n = NodeImpl.parse(map, t, 0);
                for (long pos = 0;; pos++) {
                    String childName = n.getChildNodeName(pos);
View Full Code Here

Examples of org.apache.jackrabbit.mk.simple.NodeMap

            }
            String path = PathUtils.concat(rootPath, t.readString());
            switch (r) {
            case '+': {
                t.read(':');
                NodeMap map = new NodeMap();
                if (t.matches('{')) {
                    NodeImpl n = NodeImpl.parse(map, t, 0, path);
                    addOrRemoveRecursive(n, false, true);
                } else {
                    String value = t.readRawValue().trim();
View Full Code Here

Examples of org.apache.jackrabbit.mk.simple.NodeMap

            return;
        }
        // TODO remove: support large trees
        String node = mk.getNodes(nodePath, lastRevision, Integer.MAX_VALUE, 0, Integer.MAX_VALUE, null);
        JsopTokenizer t = new JsopTokenizer(node);
        NodeMap map = new NodeMap();
        t.read('{');
        NodeImpl n = NodeImpl.parse(map, t, 0, path);
        if (n.hasProperty(property)) {
            n.setPath(nodePath);
            for (Index index : indexes.values()) {
View Full Code Here

Examples of org.apache.jackrabbit.oak.plugins.index.old.mk.simple.NodeMap

*/
public class MemoryNodeTest {

    @Test
    public void addChildNodes() {
        NodeMap map = new NodeMap();

        map.setMaxMemoryChildren(2);
        map.setDescendantInlineCount(-1);

        NodeImpl n = new NodeImpl(map, 0);
        Assert.assertEquals("{}", n.asString());
        n.setId(NodeId.get(255));
        Assert.assertEquals("nff={};", n.asString());
        n.setPath("/test");
        Assert.assertEquals("nff={};/* /test */", n.toString());
        n = n.createClone(10);
        Assert.assertEquals("{}", n.asString());
        NodeImpl a = new NodeImpl(map, 0);
        map.addNode(a);
        NodeImpl b = new NodeImpl(map, 0);
        map.addNode(b);
        NodeImpl c = new NodeImpl(map, 0);
        map.addNode(c);
        NodeImpl d = new NodeImpl(map, 0);
        map.addNode(d);
        n = n.cloneAndAddChildNode("a", false, null, a, 11);
        n = n.cloneAndSetProperty("x", "1", 12);
        n.setId(NodeId.get(3));
        Assert.assertEquals("n3={\"x\":1,\"a\":n1};", n.asString());
        NodeImpl n2 = NodeImpl.fromString(map, n.asString());
View Full Code Here

Examples of org.apache.jackrabbit.oak.plugins.index.old.mk.simple.NodeMap

    }

    @Test
    public void inlineChildNodes() {
        NodeMap map = new NodeMap();
        map.setDescendantCount(true);
        map.setDescendantInlineCount(3);

        NodeImpl n = new NodeImpl(map, 0);
        Assert.assertEquals("{}", n.asString());
        NodeImpl a = new NodeImpl(map, 0);
        a.setProperty("name", "\"a\"");
        map.addNode(a);
        NodeImpl b = new NodeImpl(map, 0);
        b.setProperty("name", "\"b\"");
        map.addNode(b);
        NodeImpl c = new NodeImpl(map, 0);
        c.setProperty("name", "\"c\"");
        map.addNode(c);
        NodeImpl d = new NodeImpl(map, 0);
        d.setProperty("name", "\"d\"");
        map.addNode(d);
        n = n.cloneAndAddChildNode("a", false, null, a, 11);
        n = n.cloneAndSetProperty("x", "1", 12);
        n.setId(NodeId.get(3));
        Assert.assertEquals("n3={\"x\":1,\"a\":{\"name\":\"a\"}};", n.asString());
        NodeImpl n2 = NodeImpl.fromString(map, n.asString());
View Full Code Here

Examples of org.apache.jackrabbit.oak.plugins.index.old.mk.simple.NodeMap

            do {
                String key = t.readString();
                t.read(':');
                if (t.matches('{')) {
                    names.add(key);
                    NodeImpl.parse(new NodeMap(), t, 0);
                } else {
                    if (!key.equals(":childNodeCount")) {
                        properties.add(key);
                    } else if (!key.equals(":hash")) {
                        properties.add(key);
View Full Code Here

Examples of org.apache.jackrabbit.oak.plugins.index.old.mk.simple.NodeMap

        this.mk = MicroKernelWrapperBase.wrap(mk);

        String head = mk.getHeadRevision();
        if (mk.nodeExists(MOUNT, head)) {
            String mounts = mk.getNodes(MOUNT, head, 1, 0, -1, null);
            NodeMap map = new NodeMap();
            JsopReader t = new JsopTokenizer(mounts);
            t.read('{');
            NodeImpl n = NodeImpl.parse(map, t, 0);
            for (long pos = 0;; pos++) {
                String childName = n.getChildNodeName(pos);
View Full Code Here

Examples of org.apache.jackrabbit.oak.plugins.index.old.mk.simple.NodeMap

    public SecurityWrapper(MicroKernel mk, String user, String pass) {
        this.mk = MicroKernelWrapperBase.wrap(mk);
        // TODO security for the index mechanism

        String role = mk.getNodes("/:user/" + user, mk.getHeadRevision(), 1, 0, -1, null);
        NodeMap map = new NodeMap();
        JsopReader t = new JsopTokenizer(role);
        t.read('{');
        NodeImpl n = NodeImpl.parse(map, t, 0);
        String password = JsopTokenizer.decodeQuoted(n.getProperty("password"));
        if (!pass.equals(password)) {
View Full Code Here

Examples of org.apache.jackrabbit.oak.plugins.index.old.mk.simple.NodeMap

        boolean exists = mk.nodeExists(indexRootNode, revision);
        createNodes(INDEX_CONTENT);
        if (exists) {
            String node = mk.getNodes(indexRootNode, revision, 1, 0, Integer.MAX_VALUE, null);
            JsopTokenizer t = new JsopTokenizer(node);
            NodeMap map = new NodeMap();
            t.read('{');
            NodeImpl n = NodeImpl.parse(map, t, 0);
            String rev = n.getNode(INDEX_CONTENT).getProperty("rev");
            if (rev != null) {
                readRevision = JsopTokenizer.decodeQuoted(rev);
View Full Code Here

Examples of org.apache.jackrabbit.oak.plugins.index.old.mk.simple.NodeMap

            String path = PathUtils.concat(rootPath, t.readString());
            String target;
            switch (r) {
            case '+': {
                t.read(':');
                NodeMap map = new NodeMap();
                if (t.matches('{')) {
                    NodeImpl n = NodeImpl.parse(map, t, 0, path);
                    addOrRemoveRecursive(n, false, true);
                } else {
                    String value = t.readRawValue().trim();
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.