Examples of BinaryBinding


Examples of org.apache.jackrabbit.mk.store.BinaryBinding

        DatabaseEntry key = new DatabaseEntry(id.getBytes());
        DatabaseEntry data = new DatabaseEntry();

        if (db.get(null, key, data, LockMode.DEFAULT) == OperationStatus.SUCCESS) {
            ByteArrayInputStream in = new ByteArrayInputStream(data.getData());
            node.deserialize(new BinaryBinding(in));
        } else {
            throw new NotFoundException(id.toString());
        }
    }
View Full Code Here

Examples of org.apache.jackrabbit.mk.store.BinaryBinding

        }
    }

    public Id writeNode(Node node) throws Exception {
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        node.serialize(new BinaryBinding(out));
        byte[] bytes = out.toByteArray();
        Id id = new Id(idFactory.createContentId(bytes));
        persist(id.getBytes(), bytes);
        return id;
    }
View Full Code Here

Examples of org.apache.jackrabbit.mk.store.BinaryBinding

        DatabaseEntry key = new DatabaseEntry(id.getBytes());
        DatabaseEntry data = new DatabaseEntry();

        if (db.get(null, key, data, LockMode.DEFAULT) == OperationStatus.SUCCESS) {
            ByteArrayInputStream in = new ByteArrayInputStream(data.getData());
            return StoredCommit.deserialize(id, new BinaryBinding(in));
        } else {
            throw new NotFoundException(id.toString());
        }
    }
View Full Code Here

Examples of org.apache.jackrabbit.mk.store.BinaryBinding

        }
    }

    public void writeCommit(Id id, Commit commit) throws Exception {
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        commit.serialize(new BinaryBinding(out));
        byte[] bytes = out.toByteArray();
        persist(id.getBytes(), bytes);
    }
View Full Code Here

Examples of org.apache.jackrabbit.mk.store.BinaryBinding

        DatabaseEntry key = new DatabaseEntry(id.getBytes());
        DatabaseEntry data = new DatabaseEntry();

        if (db.get(null, key, data, LockMode.DEFAULT) == OperationStatus.SUCCESS) {
            ByteArrayInputStream in = new ByteArrayInputStream(data.getData());
            return ChildNodeEntriesMap.deserialize(new BinaryBinding(in));
        } else {
            throw new NotFoundException(id.toString());
        }
    }
View Full Code Here

Examples of org.apache.jackrabbit.mk.store.BinaryBinding

        }
    }

    public Id writeCNEMap(ChildNodeEntriesMap map) throws Exception {
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        map.serialize(new BinaryBinding(out));
        byte[] bytes = out.toByteArray();
        Id id = new Id(idFactory.createContentId(bytes));
        persist(id.getBytes(), bytes);
        return id;
    }
View Full Code Here

Examples of org.apache.jackrabbit.mk.store.BinaryBinding

        File f = getFile(id);
       
        if (f.exists()) {
            BufferedInputStream in = new BufferedInputStream(new FileInputStream(f));
            try {
                node.deserialize(new BinaryBinding(in));
            } finally {
                in.close();
            }
        } else {
            throw new NotFoundException(id.toString());
View Full Code Here

Examples of org.apache.jackrabbit.mk.store.BinaryBinding

        }
    }

    public Id writeNode(Node node) throws Exception {
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        node.serialize(new BinaryBinding(out));
        byte[] bytes = out.toByteArray();
        Id id = new Id(idFactory.createContentId(bytes));
        writeFile(id, bytes);
        return id;
    }
View Full Code Here

Examples of org.apache.jackrabbit.mk.store.BinaryBinding

    public StoredCommit readCommit(Id id) throws NotFoundException, Exception {
        File f = getFile(id);
        if (f.exists()) {
            BufferedInputStream in = new BufferedInputStream(new FileInputStream(f));
            try {
                return StoredCommit.deserialize(id, new BinaryBinding(in));
            } finally {
                in.close();
            }
        } else {
            throw new NotFoundException(id.toString());
View Full Code Here

Examples of org.apache.jackrabbit.mk.store.BinaryBinding

        }
    }

    public void writeCommit(Id id, Commit commit) throws Exception {
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        commit.serialize(new BinaryBinding(out));
        byte[] bytes = out.toByteArray();
        writeFile(id, bytes);
    }
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.