Package org.modeshape.common.collection

Examples of org.modeshape.common.collection.SimpleProblems


                                JcrRepository.ConfigurationChange change ) throws Exception {
            this.config = repositoryConfiguration();
            this.systemContentInitializer = new SystemContentInitializer();
            if (other == null) {
                logger.debug("Starting '{0}' repository with configuration: \n{1}", repositoryName(), this.config);
                this.problems = new SimpleProblems();
            } else {
                logger.debug("Updating '{0}' repository with configuration: \n{1}", repositoryName(), this.config);
                this.problems = other.problems;
            }
            ExecutionContext tempContext = new ExecutionContext();
View Full Code Here


     * @throws IOException if there is a problem with the specified Infinispan configuration file
     * @throws Exception if there is a problem with underlying resource setup
     */
    public Problems getStartupProblems() throws Exception {
        doStart();
        SimpleProblems result = new SimpleProblems();
        result.addAll(this.configurationProblems);
        result.addAll(runningState().problems());
        return result;
    }
View Full Code Here

            }
        }

        private boolean updateInternalNodeTypes( RunningState repository ) {
            CndImporter importer = new CndImporter(repository.context());
            SimpleProblems problems = new SimpleProblems();
            try {
                importer.importFrom(getClass().getClassLoader().getResourceAsStream(CndImporter.MODESHAPE_BUILT_INS),
                                    problems,
                                    null);
                if (!problems.isEmpty()) {
                    LOGGER.error(JcrI18n.upgrade3_6_0CannotUpdateNodeTypes, problems.toString());
                    return false;
                }
                List<NodeTypeDefinition> nodeTypeDefinitions = new ArrayList<NodeTypeDefinition>(
                                                                                                 importer.getNodeTypeDefinitions());
                for (Iterator<NodeTypeDefinition> nodeTypeDefinitionIterator = nodeTypeDefinitions.iterator(); nodeTypeDefinitionIterator.hasNext();) {
View Full Code Here

            // This is Jackrabbit XML format ...
            return registerNodeTypes(importFromXml(new InputSource(new FileInputStream(file))), allowUpdate);
        }
        // Assume this is CND format ...
        CndImporter importer = new CndImporter(context());
        Problems problems = new SimpleProblems();
        importer.importFrom(content, problems, file.getAbsolutePath());

        // Check for (and report) any problems ...
        if (problems.hasProblems()) {
            // There are errors and/or warnings, so report them ...
            String summary = messageFrom(problems);
            if (problems.hasErrors()) {
                String msg = JcrI18n.errorsParsingNodeTypeDefinitions.text(file.getAbsolutePath(), summary);
                throw new RepositoryException(msg);
            }
            // Otherwise, there are warnings, so log them ...
            I18n msg = JcrI18n.warningsParsingNodeTypeDefinitions;
View Full Code Here

            // This is Jackrabbit XML format ...
            return registerNodeTypes(importFromXml(new InputSource(new StringReader(content))), allowUpdate);
        }
        // Assume this is CND format ...
        CndImporter importer = new CndImporter(context());
        Problems problems = new SimpleProblems();
        importer.importFrom(content, problems, "stream");

        // Check for (and report) any problems ...
        if (problems.hasProblems()) {
            // There are errors and/or warnings, so report them ...
            String summary = messageFrom(problems);
            if (problems.hasErrors()) {
                String msg = JcrI18n.errorsParsingStreamOfNodeTypeDefinitions.text(summary);
                throw new RepositoryException(msg);
            }
            // Otherwise, there are warnings, so log them ...
            I18n msg = JcrI18n.warningsParsingStreamOfNodeTypeDefinitions;
View Full Code Here

            // This is Jackrabbit XML format ...
            return registerNodeTypes(importFromXml(new InputSource(new StringReader(content))), allowUpdate);
        }
        // Assume this is CND format ...
        CndImporter importer = new CndImporter(context());
        Problems problems = new SimpleProblems();
        importer.importFrom(content, problems, url.toExternalForm());

        // Check for (and report) any problems ...
        if (problems.hasProblems()) {
            // There are errors and/or warnings, so report them ...
            String summary = messageFrom(problems);
            if (problems.hasErrors()) {
                String msg = JcrI18n.errorsParsingNodeTypeDefinitions.text(url.toExternalForm(), summary);
                throw new RepositoryException(msg);
            }
            // Otherwise, there are warnings, so log them ...
            I18n msg = JcrI18n.warningsParsingNodeTypeDefinitions;
View Full Code Here

     * Get the ordered list of index providers defined in the configuration.
     *
     * @return the immutable list of provider components; never null but possibly empty
     */
    public List<Component> getIndexProviders() {
        Problems problems = new SimpleProblems();
        List<Component> components = readComponents(doc, FieldName.INDEX_PROVIDERS, FieldName.CLASSNAME, INDEX_PROVIDER_ALIASES,
                                                    problems);
        assert !problems.hasErrors();
        return components;
    }
View Full Code Here

     * @return the validation results; never null
     * @see #validate(Changes)
     */
    public Problems validate() {
        if (problems == null) {
            SimpleProblems problems = new SimpleProblems();
            warnUseOfDeprecatedFields(problems);
            Results results = SCHEMA_LIBRARY.validate(doc, JSON_SCHEMA_URI);
            for (Problem problem : results) {
                switch (problem.getType()) {
                    case ERROR:
                        problems.addError(JcrI18n.configurationError, problem.getPath(), problem.getReason());
                        break;
                    case WARNING:
                        problems.addWarning(JcrI18n.configurationWarning, problem.getPath(), problem.getReason());
                        break;
                }
            }
            // Validate the components ...
            getSecurity().validateCustomProviders(problems);
View Full Code Here

            super.registerNamespace(namespace.getPrefix(), namespace.getNamespaceUri(), namespaceRegistry);
        }
    }

    private CndImporter importNodesFromCND( InputStream cndInputStream ) throws IOException {
        Problems problemsDuringImport = new SimpleProblems();

        CndImporter cndImporter = new CndImporter(new ExecutionContext());
        cndImporter.importFrom(cndInputStream, problemsDuringImport, null);
        if (problemsDuringImport.hasErrors()) {
            problemsDuringImport.writeTo(LOGGER);
            return null;
        }

        return cndImporter;
    }
View Full Code Here

         * Get the ordered list of sequencers. All sequencers are configured with this list.
         *
         * @return the immutable list of sequencers; never null but possibly empty
         */
        public List<Component> getSequencers() {
            Problems problems = new SimpleProblems();
            List<Component> components = getSequencers(problems);
            assert !problems.hasErrors();
            return components;
        }
View Full Code Here

TOP

Related Classes of org.modeshape.common.collection.SimpleProblems

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.