Package org.apache.jackrabbit.oak.plugins.document

Examples of org.apache.jackrabbit.oak.plugins.document.DocumentStoreException


    private static RuntimeException convert(Exception e) {
        if (e instanceof RuntimeException) {
            return (RuntimeException) e;
        }
        return new DocumentStoreException("Unexpected exception: " + e.toString(), e);
    }
View Full Code Here


            oldDoc = map.get(update.getId());

            T doc = collection.newDocument(this);
            if (oldDoc == null) {
                if (!update.isNew()) {
                    throw new DocumentStoreException("Document does not exist: " + update.getId());
                }
            } else {
                oldDoc.deepCopy(doc);
            }
            if (checkConditions && !UpdateUtils.checkConditions(doc, update)) {
View Full Code Here

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

        } catch (UncheckedExecutionException e) {
            t = e.getCause();
        } catch (ExecutionException e) {
            t = e.getCause();
        }
        throw new DocumentStoreException("Failed to load document with " + key, t);
    }
View Full Code Here

        long start = start();
        try {
            WriteResult writeResult = dbCollection.remove(getByKeyQuery(key).get());
            invalidateCache(collection, key);
            if (writeResult.getError() != null) {
                throw new DocumentStoreException("Remove failed: " + writeResult.getError());
            }
        } finally {
            end("remove", start);
        }
    }
View Full Code Here

        for(List<String> keyBatch : Lists.partition(keys, IN_CLAUSE_BATCH_SIZE)){
            DBObject query = QueryBuilder.start(Document.ID).in(keyBatch).get();
            WriteResult writeResult = dbCollection.remove(query);
            invalidateCache(collection, keyBatch);
            if (writeResult.getError() != null) {
                throw new DocumentStoreException("Remove failed: " + writeResult.getError());
            }
        }

    }
View Full Code Here

                }
            }
            try {
                WriteResult writeResult = dbCollection.update(query.get(), update, false, true);
                if (writeResult.getError() != null) {
                    throw new DocumentStoreException("Update failed: " + writeResult.getError());
                }
                if (collection == Collection.NODES) {
                    // update cache
                    for (Entry<String, NodeDocument> entry : cachedDocs.entrySet()) {
                        TreeLock lock = acquire(entry.getKey());
View Full Code Here

            } else if (op.type == UpdateOp.Operation.Type.MAX) {
                sb.append("\"M\",");
            } else if (op.type == UpdateOp.Operation.Type.REMOVE_MAP_ENTRY) {
                sb.append("\"*\",");
            } else {
                throw new DocumentStoreException("Can't serialize " + update.toString() + " for JSON append");
            }
            appendString(sb, key.getName());
            sb.append(",");
            if (key.getRevision() != null) {
                appendString(sb, key.getRevision().toString());
View Full Code Here

        } else if (value instanceof String) {
            appendString(sb, (String) value);
        } else if (value instanceof Map) {
            appendMap(sb, (Map<Object, Object>) value);
        } else {
            throw new DocumentStoreException("unexpected type: " + value.getClass());
        }
    }
View Full Code Here

                baseData = (Map<String, Object>) jp.parse(fromBlobData(bdata));
            }
            // TODO figure out a faster way
            arr = (JSONArray) new JSONParser().parse("[" + row.getData() + "]");
        } catch (ParseException ex) {
            throw new DocumentStoreException(ex);
        }

        int updatesStartAt = 0;
        if (baseData == null) {
            // if we do not have a blob, the first part of the string data is
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.oak.plugins.document.DocumentStoreException

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.