Package org.apache.jackrabbit.mk.store

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

        BasicDBObject nodeObject;
        if (BINARY_FORMAT) {
View Full Code Here


        }
        BasicDBObject commitObject = (BasicDBObject) commits.findOne(key);
        if (commitObject != null) {
            if (BINARY_FORMAT) {
                byte[] bytes = (byte[]) commitObject.get(DATA_FIELD);
                return StoredCommit.deserialize(id, new BinaryBinding(new ByteArrayInputStream(bytes)));
            } else {
                return StoredCommit.deserialize(id, new DBObjectBinding(commitObject));
            }
        } else {
            throw new NotFoundException(id.toString());
View Full Code Here

        }
    }

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

        BasicDBObject commitObject;
        if (BINARY_FORMAT) {
            commitObject = new BasicDBObject(ID_FIELD, id.getBytes()).append(DATA_FIELD, bytes);
View Full Code Here

        }
        BasicDBObject mapObject = (BasicDBObject) cneMaps.findOne(key);
        if (mapObject != null) {
            if (BINARY_FORMAT) {
                byte[] bytes = (byte[]) mapObject.get(DATA_FIELD);
                return ChildNodeEntriesMap.deserialize(new BinaryBinding(new ByteArrayInputStream(bytes)));
            } else {
                return ChildNodeEntriesMap.deserialize(new DBObjectBinding(mapObject));
            }
        } else {
            throw new NotFoundException(id.toString());
View Full Code Here

        }
    }

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

        BasicDBObject mapObject;
        if (BINARY_FORMAT) {
View Full Code Here

        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

        }
    }

    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

    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

        }
    }

    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

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

TOP

Related Classes of org.apache.jackrabbit.mk.store.BinaryBinding

Copyright © 2018 www.massapicom. 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.