Package org.apache.jackrabbit.oak.spi.commit

Examples of org.apache.jackrabbit.oak.spi.commit.ValidatingHook


    public RepositoryImpl(
            MicroKernel kernel, ScheduledExecutorService executor) {
        this(new ContentRepositoryImpl(
                kernel, null, new CompositeHook(
                        new ValidatingHook(DEFAULT_VALIDATOR),
                        new UniqueIndexHook())),
                executor);
    }
View Full Code Here


    public Object addingService(ServiceReference reference) {
        Object service = context.getService(reference);
        if (service instanceof MicroKernel) {
            List<CommitHook> hooks = new ArrayList<CommitHook>();
            hooks.add(new DefaultTypeEditor());
            hooks.add(new ValidatingHook(validatorProvider));
            // hooks.add(new LuceneEditor());

            MicroKernel kernel = (MicroKernel) service;
            services.put(reference, context.registerService(
                    ContentRepository.class.getName(),
View Full Code Here

        }

        private static CommitHook buildDefaultCommitHook() {
            List<CommitHook> hooks = new ArrayList<CommitHook>();
            hooks.add(new DefaultTypeEditor());
            hooks.add(new ValidatingHook(createDefaultValidatorProvider()));
            hooks.add(new LuceneHook());
            return new CompositeHook(hooks);
        }
View Full Code Here

     *            the validation provider
     */
    public ContentRepositoryImpl(MicroKernel microKernel,
            QueryIndexProvider indexProvider,
            ValidatorProvider validatorProvider) {
        this(microKernel, indexProvider, new ValidatingHook(
                validatorProvider != null ? validatorProvider
                        : new CompositeValidatorProvider(
                                Collections.<ValidatorProvider> emptyList())));
    }
View Full Code Here

    protected RepositoryImpl createRepository(MicroKernel mk) {

        // return new RepositoryImpl();

        mk = new IndexWrapper(mk);
        ValidatingHook ve =  new ValidatingHook(
                new CompositeValidatorProvider(Collections.<ValidatorProvider>emptyList()));
        ContentRepository contentRepository = new ContentRepositoryImpl(mk, null, ve);
        return new RepositoryImpl(contentRepository, null);

    }
View Full Code Here

        }
        if (validators.isEmpty()) {
            return after; // shortcut
        }

        new ValidatingHook(validators).processCommit(store, before, after);

        for (UniqueIndexValidator validator : validators) {
            validator.apply(unique);
        }
View Full Code Here

     * order while still being able to leverage the performance gains of
     * multiple validators iterating over the changes simultaneously.
     */
    private void withValidatorHook() {
        if (!validatorProviders.isEmpty()) {
            commitHooks.add(new ValidatingHook(
                    CompositeValidatorProvider.compose(validatorProviders)));
            validatorProviders = newArrayList();
        }
    }
View Full Code Here

                    kernelTracker, indexHookProvider);
            Oak oak = new Oak(kernel)
                    .with(new CompositeHook(
                        // TODO: DefaultTypeEditor is JCR specific and does not belong here
                        new DefaultTypeEditor(),
                        new ValidatingHook(validatorProvider)))
                    .with(indexProvider)
                    .with(indexHookProvider);
            services.put(reference, context.registerService(
                    ContentRepository.class.getName(),
                    oak.createContentRepository(),
View Full Code Here

        }

        private static CommitHook buildDefaultCommitHook() {
            return new CompositeHook(
                    new DefaultTypeEditor(),
                    new ValidatingHook(createDefaultValidatorProvider()),
                    IndexHookManager.of(
                            new CompositeIndexHookProvider(
                            new Property2IndexHookProvider(),
                            new LuceneIndexHookProvider())));
        }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.oak.spi.commit.ValidatingHook

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.