Package org.apache.jackrabbit.mk.api

Examples of org.apache.jackrabbit.mk.api.MicroKernelException


            list.addFirst(revision);
            if (revision.id.equals(fromRevisionId)) {
                break;
            } else if (revision.base == null) {
                if (getRevision(fromRevisionId).branch != null) {
                    throw new MicroKernelException();
                }
                list.clear();
                break;
            }
            revision = revision.base;
View Full Code Here


            throws MicroKernelException {
        NodeState node = getNode(revisionId, path);
        if (node.exists()) {
            return node.getChildNodeCount(Long.MAX_VALUE);
        } else {
            throw new MicroKernelException(
                    "Node not found: " + revisionId + path);
        }
    }
View Full Code Here

                    notifyAll();
                } else {
                    return head.id;
                }
            } catch (CommitFailedException e) {
                throw new MicroKernelException(e);
            }
        }

        revisions.put(revision.id, revision);
        return revision.id;
View Full Code Here

    @Override
    public synchronized String merge(String branchRevisionId, String message)
            throws MicroKernelException {
        Revision revision = getRevision(branchRevisionId);
        if (revision.branch == null) {
            throw new MicroKernelException(
                    "Branch not found: " + branchRevisionId);
        }

        try {
            NodeState newRoot =
                    store.merge(revision.branch, CONFLICT_HOOK, null);
            if (!newRoot.equals(head.root)) {
                head = new Revision(head, newRoot, message);
                revisions.put(head.id, head);
                notifyAll();
            }
        } catch (CommitFailedException e) {
            throw new MicroKernelException(e);
        }

        return head.id;
    }
View Full Code Here

    public synchronized String reset(@Nonnull String branchRevisionId,
                                     @Nonnull String ancestorRevisionId)
            throws MicroKernelException {
        Revision revision = getRevision(branchRevisionId);
        if (revision.branch == null) {
            throw new MicroKernelException(
                    "Branch not found: " + branchRevisionId);
        }
        Revision ancestor = getRevision(ancestorRevisionId);
        while (!ancestor.id.equals(revision.id)) {
            revision = revision.base;
            if (revision.branch == null) {
                throw new MicroKernelException(ancestorRevisionId + " is not " +
                        "an ancestor revision of " + branchRevisionId);
            }
        }
        Revision r = new Revision(ancestor);
        revisions.put(r.id, r);
View Full Code Here

    public long getLength(String blobId) throws MicroKernelException {
        Blob blob = blobs.get(blobId);
        if (blob != null) {
            return blob.length();
        } else {
            throw new MicroKernelException("Blob not found: " + blobId);
        }
    }
View Full Code Here

                    return n;
                }
            });
            return node == Node.MISSING ? null : node;
        } catch (ExecutionException e) {
            throw new MicroKernelException(e);
        }
    }
View Full Code Here

                    return stream.read(buff, off, length);
                } finally {
                    stream.close();
                }
            } catch (IOException e) {
                throw new MicroKernelException("Failed to read a blob", e);
            }
        } else {
            throw new MicroKernelException("Blob not found: " + blobId);
        }
    }
View Full Code Here

                public Node.Children call() throws Exception {
                    return readChildren(path, rev, limit);
                }
            });
        } catch (ExecutionException e) {
            throw new MicroKernelException("Error occurred while fetching children nodes for path "+path, e);
        }

        //In case the limit > cached children size and there are more child nodes
        //available then refresh the cache
        if (children.hasMore) {
View Full Code Here

            String id = hash.toString();
            blobs.put(id, blob);
            return id;
        } catch (IOException e) {
            throw new MicroKernelException("Failed to create a blob", e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.mk.api.MicroKernelException

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.