Examples of BinaryBinding


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

    public void readNode(StoredNode node) throws NotFoundException, Exception {
        Id id = node.getId();
        byte[] bytes = objects.get(id);
        if (bytes != null) {
            node.deserialize(new BinaryBinding(new ByteArrayInputStream(bytes)));
            return;
        }
        throw new NotFoundException(id.toString());
    }
View Full Code Here

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

        throw new NotFoundException(id.toString());
    }

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

        if (!objects.containsKey(id)) {
            objects.put(id, bytes);
View Full Code Here

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

    }

    public StoredCommit readCommit(Id id) throws NotFoundException, Exception {
        byte[] bytes = objects.get(id);
        if (bytes != null) {
            return StoredCommit.deserialize(id, new BinaryBinding(new ByteArrayInputStream(bytes)));
        }
        throw new NotFoundException(id.toString());
    }
View Full Code Here

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

        throw new NotFoundException(id.toString());
    }

    public void writeCommit(Id id, Commit commit) throws Exception {
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        commit.serialize(new BinaryBinding(out));
        byte[] bytes = out.toByteArray();

        if (!objects.containsKey(id)) {
            objects.put(id, bytes);
        }
View Full Code Here

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

    }

    public ChildNodeEntriesMap readCNEMap(Id id) throws NotFoundException, Exception {
        byte[] bytes = objects.get(id);
        if (bytes != null) {
            return ChildNodeEntriesMap.deserialize(new BinaryBinding(new ByteArrayInputStream(bytes)));
        }
        throw new NotFoundException(id.toString());
    }
View Full Code Here

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

        throw new NotFoundException(id.toString());
    }

    public Id writeCNEMap(ChildNodeEntries map) throws Exception {
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        map.serialize(new BinaryBinding(out));
        byte[] bytes = out.toByteArray();
        Id id = new Id(idFactory.createContentId(bytes));

        if (!objects.containsKey(id)) {
            objects.put(id, bytes);
View Full Code Here

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

    }
   
    @Override
    public void replaceCommit(Id id, Commit commit) throws Exception {
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        commit.serialize(new BinaryBinding(out));
        byte[] bytes = out.toByteArray();

        objects.put(id, bytes);
        marked.put(id, bytes);
    }
View Full Code Here

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

            try {
                stmt.setBytes(1, id.getBytes());
                ResultSet rs = stmt.executeQuery();
                if (rs.next()) {
                    ByteArrayInputStream in = new ByteArrayInputStream(rs.getBytes(1));
                    node.deserialize(new BinaryBinding(in));
                } else {
                    throw new NotFoundException(id.toString());
                }
            } finally {
                stmt.close();
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();
        byte[] rawId = idFactory.createContentId(bytes);
        //String id = StringUtils.convertBytesToHex(rawId);

        Connection con = cp.getConnection();
View Full Code Here

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

            try {
                stmt.setBytes(1, id.getBytes());
                ResultSet rs = stmt.executeQuery();
                if (rs.next()) {
                    ByteArrayInputStream in = new ByteArrayInputStream(rs.getBytes(1));
                    return StoredCommit.deserialize(id, new BinaryBinding(in));
                } else {
                    throw new NotFoundException(id.toString());
                }
            } finally {
                stmt.close();
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.