Package org.apache.jackrabbit.mk.api

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


    private static RuntimeException convert(Exception e) {
        if (e instanceof RuntimeException) {
            return (RuntimeException) e;
        }
        log("// unexpected exception type: " + e.getClass().getName());
        return new MicroKernelException("Unexpected exception: " + e.toString(), e);
    }
View Full Code Here


        @Override
        public NodeState getNodeState() {
            try {
                return cache.get(revision + getChildPath(name));
            } catch (ExecutionException e) {
                throw new MicroKernelException(e);
            }
        }
View Full Code Here

            if (collection == Collection.NODES) {
                nodesCache.invalidate(key);
            }
            WriteResult writeResult = dbCollection.remove(getByKeyQuery(key).get(), WriteConcern.SAFE);
            if (writeResult.getError() != null) {
                throw new MicroKernelException("Remove failed: " + writeResult.getError());
            }
        } finally {
            end("remove", start);
        }
    }
View Full Code Here

            }
            T oldDoc = convertFromDBObject(collection, oldNode);
            applyToCache(collection, oldDoc, updateOp);
            return oldDoc;
        } catch (Exception e) {
            throw new MicroKernelException(e);
        } finally {
            end("findAndModify", start);
        }
    }
View Full Code Here

        try {
            try {

                WriteResult writeResult = dbCollection.updateMulti(query.get(), update);
                if (writeResult.getError() != null) {
                    throw new MicroKernelException("Update failed: " + writeResult.getError());
                }
                if (collection == Collection.NODES) {
                    // update cache
                    for (String key : keys) {
                        @SuppressWarnings("unchecked")
                        T doc = (T) nodesCache.getIfPresent(key);
                        if (doc != null) {
                            applyToCache(collection, doc, new UpdateOp(key, updateOp));
                        }
                    }
                }
            } catch (MongoException e) {
                throw new MicroKernelException(e);
            }
        } finally {
            end("update", start);
        }
    }
View Full Code Here

            boolean success = store.create(Collection.CLUSTER_NODES, Collections.singletonList(update));
            if (success) {
                return clusterNode;
            }
        }
        throw new MicroKernelException("Could not get cluster node info");
    }
View Full Code Here

        // their commit wins, we have to mark ourRev
        NodeDocument newDoc = Collection.NODES.newDocument(store);
        document.deepCopy(newDoc);
        MemoryDocumentStore.applyChanges(newDoc, ourOp, context.getRevisionComparator());
        if (!markCommitRoot(newDoc, ourRev, store)) {
            throw new MicroKernelException("Unable to annotate our revision "
                    + "with collision marker. Our revision: " + ourRev
                    + ", document:\n" + newDoc.format());
        }
    }
View Full Code Here

    }
   
    private static void throwNoCommitRootException(@Nonnull Revision revision,
                                                   @Nonnull Document document)
                                                           throws MicroKernelException {
        throw new MicroKernelException("No commit root for revision: "
                + revision + ", document: " + document.format());
    }
View Full Code Here

                public 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

    @Override
    public String getRevisionHistory(long since, int maxEntries, String path)
            throws MicroKernelException {
        // not currently called by oak-core
        throw new MicroKernelException("Not implemented");
    }
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.