Package org.apache.jackrabbit.oak.api

Examples of org.apache.jackrabbit.oak.api.CommitFailedException


        return parent != null && parent.wasCheckedIn();
    }

    private static void throwCheckedIn(String msg)
            throws CommitFailedException {
        throw new CommitFailedException(CommitFailedException.VERSION,
                VersionExceptionCode.NODE_CHECKED_IN.ordinal(), msg);
    }
View Full Code Here


                VersionExceptionCode.NODE_CHECKED_IN.ordinal(), msg);
    }

    private static void throwProtected(String name)
            throws CommitFailedException {
        throw new CommitFailedException(CommitFailedException.CONSTRAINT, 100,
                "Property is protected: " + name);
    }
View Full Code Here

            String path = getPath();
            try {
                context.getWriter().updateDocument(newPathTerm(path),
                        makeDocument(path, after));
            } catch (IOException e) {
                throw new CommitFailedException(
                        "Lucene", 3, "Failed to index the node " + path, e);
            }
            long indexed = context.incIndexedNodes();
            if (indexed % 1000 == 0) {
                log.debug("Indexed {} nodes...", indexed);
            }
        }

        if (parent == null) {
            try {
                context.closeWriter();
            } catch (IOException e) {
                throw new CommitFailedException("Lucene", 4,
                        "Failed to close the Lucene index", e);
            }
            if (context.getIndexedNodes() > 0) {
                log.debug("Indexed {} nodes, done.", context.getIndexedNodes());
            }
View Full Code Here

            IndexWriter writer = context.getWriter();
            // Remove all index entries in the removed subtree
            writer.deleteDocuments(newPathTerm(path));
            writer.deleteDocuments(new PrefixQuery(newPathTerm(path + "/")));
        } catch (IOException e) {
            throw new CommitFailedException(
                    "Lucene", 5, "Failed to remove the index entries of"
                    + " the removed subtree " + path, e);
        }

        return null; // no need to recurse down the removed subtree
View Full Code Here

        if (parent == null) {
            try {
                context.closeWriter();
            } catch (IOException e) {
                throw new CommitFailedException("Lucene", 4,
                        "Failed to close the Lucene index", e);
            }
            if (context.getIndexedNodes() > 0) {
                log.debug("Indexed {} nodes, done.", context.getIndexedNodes());
            }
View Full Code Here

            // Remove all index entries in the removed subtree
            writer.deleteDocuments(newPathTerm(path));
            writer.deleteDocuments(new PrefixQuery(newPathTerm(path + "/")));
            this.context.indexUpdate();
        } catch (IOException e) {
            throw new CommitFailedException(
                    "Lucene", 5, "Failed to remove the index entries of"
                    + " the removed subtree " + path, e);
        }

        return null; // no need to recurse down the removed subtree
View Full Code Here

            if (d != null) {
                context.getWriter().updateDocument(newPathTerm(path), d);
                return true;
            }
        } catch (IOException e) {
            throw new CommitFailedException("Lucene", 3,
                    "Failed to index the node " + path, e);
        }
        return false;
    }
View Full Code Here

        }

        PropertyState primaryType = after.getProperty(JCR_PRIMARYTYPE);
        String nt = primaryType == null ? null : primaryType.getValue(Type.NAME);
        if (nt == null) {
            throw new CommitFailedException(CONSTRAINT, 34, JCR_PRIMARYTYPE + " missing at " + state.path);
        }

        if (UserConstants.NT_REP_GROUP.equals(nt)) {
            if (currentGroup != null) {
                log.error("rep:Group within rep:Group not supported during upgrade. current group: {}, overwriting group: {}",
View Full Code Here

        if (propertiesChanged || !before.exists()) {
            updateCallback.indexUpdate();
            try {
                solrServer.add(docFromState(after));
            } catch (SolrServerException e) {
                throw new CommitFailedException(
                        "Solr", 2, "Failed to add a document to Solr", e);
            } catch (IOException e) {
                throw new CommitFailedException(
                        "Solr", 6, "Failed to send data to Solr", e);
            }
        }

        if (parent == null) {
            try {
                OakSolrUtils.commitByPolicy(
                        solrServer,  configuration.getCommitPolicy());
            } catch (SolrServerException e) {
                throw new CommitFailedException(
                        "Solr", 3, "Failed to commit changes to Solr", e);
            } catch (IOException e) {
                throw new CommitFailedException(
                        "Solr", 6, "Failed to send data to Solr", e);
            }
        }
    }
View Full Code Here

        try {
            solrServer.deleteByQuery(String.format(
                    "%s:%s\\/*", configuration.getPathField(), path));
            updateCallback.indexUpdate();
        } catch (SolrServerException e) {
            throw new CommitFailedException(
                    "Solr", 5, "Failed to remove documents from Solr", e);
        } catch (IOException e) {
            throw new CommitFailedException(
                    "Solr", 6, "Failed to send data to Solr", e);
        }

        return null; // no need to recurse down the removed subtree
    }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.oak.api.CommitFailedException

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.