Search in sources :

Example 1 with ReferenceEditorProvider

use of org.apache.jackrabbit.oak.plugins.index.reference.ReferenceEditorProvider in project jackrabbit-oak by apache.

the class RepositoryManagerTest method registerRequiredServices.

private void registerRequiredServices() {
    context.registerService(SecurityProvider.class, new OpenSecurityProvider());
    context.registerService(NodeStore.class, new MemoryNodeStore());
    context.registerService(IndexEditorProvider.class, new PropertyIndexEditorProvider(), ImmutableMap.<String, Object>of("type", "property"));
    context.registerService(IndexEditorProvider.class, new ReferenceEditorProvider(), ImmutableMap.<String, Object>of("type", "reference"));
}
Also used : ReferenceEditorProvider(org.apache.jackrabbit.oak.plugins.index.reference.ReferenceEditorProvider) MemoryNodeStore(org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStore) OpenSecurityProvider(org.apache.jackrabbit.oak.spi.security.OpenSecurityProvider) PropertyIndexEditorProvider(org.apache.jackrabbit.oak.plugins.index.property.PropertyIndexEditorProvider)

Example 2 with ReferenceEditorProvider

use of org.apache.jackrabbit.oak.plugins.index.reference.ReferenceEditorProvider in project jackrabbit-oak by apache.

the class CrossMountReferenceValidatorTest method initializeHook.

@Before
public void initializeHook() {
    MountInfoProvider mip = Mounts.newBuilder().mount("foo", "/a").build();
    hook = new EditorHook(new CompositeEditorProvider(new IndexUpdateProvider(new CompositeIndexEditorProvider(new PropertyIndexEditorProvider().with(mip), new ReferenceEditorProvider().with(mip))), new CrossMountReferenceValidatorProvider().with(mip).withFailOnDetection(true)));
}
Also used : ReferenceEditorProvider(org.apache.jackrabbit.oak.plugins.index.reference.ReferenceEditorProvider) CompositeEditorProvider(org.apache.jackrabbit.oak.spi.commit.CompositeEditorProvider) IndexUpdateProvider(org.apache.jackrabbit.oak.plugins.index.IndexUpdateProvider) EditorHook(org.apache.jackrabbit.oak.spi.commit.EditorHook) PropertyIndexEditorProvider(org.apache.jackrabbit.oak.plugins.index.property.PropertyIndexEditorProvider) MountInfoProvider(org.apache.jackrabbit.oak.spi.mount.MountInfoProvider) CompositeIndexEditorProvider(org.apache.jackrabbit.oak.plugins.index.CompositeIndexEditorProvider) Before(org.junit.Before)

Example 3 with ReferenceEditorProvider

use of org.apache.jackrabbit.oak.plugins.index.reference.ReferenceEditorProvider in project jackrabbit-oak by apache.

the class IndexUpdateTest method reindexForDisabledIndexes.

@Test
public void reindexForDisabledIndexes() throws Exception {
    EditorHook hook = new EditorHook(new IndexUpdateProvider(new CompositeIndexEditorProvider(new PropertyIndexEditorProvider(), new ReferenceEditorProvider())));
    NodeState before = builder.getNodeState();
    createIndexDefinition(builder.child(INDEX_DEFINITIONS_NAME), "fooIndex", true, false, ImmutableSet.of("foo"), null);
    builder.child("testRoot").setProperty("foo", "abc");
    NodeState after = builder.getNodeState();
    NodeState indexed = hook.processCommit(before, after, CommitInfo.EMPTY);
    before = indexed;
    builder = before.builder();
    builder.getChildNode("oak:index").getChildNode("fooIndex").setProperty(TYPE_PROPERTY_NAME, TYPE_DISABLED);
    builder.getChildNode("oak:index").getChildNode("fooIndex").setProperty(REINDEX_PROPERTY_NAME, true);
    after = builder.getNodeState();
    LogCustomizer customLogs = LogCustomizer.forLogger(IndexUpdate.class.getName()).filter(Level.INFO).create();
    customLogs.starting();
    before = after;
    builder = before.builder();
    builder.child("testRoot2").setProperty("foo", "abc");
    after = builder.getNodeState();
    indexed = hook.processCommit(before, after, CommitInfo.EMPTY);
    assertTrue(customLogs.getLogs().isEmpty());
    customLogs.finished();
}
Also used : ReferenceEditorProvider(org.apache.jackrabbit.oak.plugins.index.reference.ReferenceEditorProvider) EmptyNodeState(org.apache.jackrabbit.oak.plugins.memory.EmptyNodeState) NodeState(org.apache.jackrabbit.oak.spi.state.NodeState) LogCustomizer(org.apache.jackrabbit.oak.commons.junit.LogCustomizer) EditorHook(org.apache.jackrabbit.oak.spi.commit.EditorHook) PropertyIndexEditorProvider(org.apache.jackrabbit.oak.plugins.index.property.PropertyIndexEditorProvider) Test(org.junit.Test)

Example 4 with ReferenceEditorProvider

use of org.apache.jackrabbit.oak.plugins.index.reference.ReferenceEditorProvider in project jackrabbit-oak by apache.

the class ClusterPermissionsTest method before.

@Before
public void before() throws Exception {
    MemoryDocumentStore ds = new MemoryDocumentStore();
    MemoryBlobStore bs = new MemoryBlobStore();
    DocumentMK.Builder builder;
    builder = new DocumentMK.Builder();
    builder.setDocumentStore(ds).setBlobStore(bs).setAsyncDelay(0);
    ns1 = builder.setClusterId(1).getNodeStore();
    builder = new DocumentMK.Builder();
    builder.setDocumentStore(ds).setBlobStore(bs).setAsyncDelay(0);
    ns2 = builder.setClusterId(2).getNodeStore();
    Oak oak = new Oak(ns1).with(new InitialContent()).with(new ReferenceEditorProvider()).with(new ReferenceIndexProvider()).with(new PropertyIndexEditorProvider()).with(new PropertyIndexProvider()).with(new TypeEditorProvider()).with(securityProvider1 = SecurityProviderBuilder.newBuilder().with(getSecurityConfigParameters()).build());
    contentRepository1 = oak.createContentRepository();
    adminSession1 = login1(getAdminCredentials());
    root1 = adminSession1.getLatestRoot();
    userManager1 = securityProvider1.getConfiguration(UserConfiguration.class).getUserManager(root1, namePathMapper);
    aclMgr1 = securityProvider1.getConfiguration(AuthorizationConfiguration.class).getAccessControlManager(root1, namePathMapper);
    // make sure initial content is visible to ns2
    syncClusterNodes();
    oak = new Oak(ns2).with(new InitialContent()).with(new ReferenceEditorProvider()).with(new ReferenceIndexProvider()).with(new PropertyIndexEditorProvider()).with(new PropertyIndexProvider()).with(new TypeEditorProvider()).with(securityProvider2 = SecurityProviderBuilder.newBuilder().with(getSecurityConfigParameters()).build());
    contentRepository2 = oak.createContentRepository();
    adminSession2 = login2(getAdminCredentials());
    root2 = adminSession2.getLatestRoot();
    userManager2 = securityProvider2.getConfiguration(UserConfiguration.class).getUserManager(root2, namePathMapper);
    aclMgr2 = securityProvider2.getConfiguration(AuthorizationConfiguration.class).getAccessControlManager(root2, namePathMapper);
}
Also used : InitialContent(org.apache.jackrabbit.oak.InitialContent) ReferenceEditorProvider(org.apache.jackrabbit.oak.plugins.index.reference.ReferenceEditorProvider) ReferenceIndexProvider(org.apache.jackrabbit.oak.plugins.index.reference.ReferenceIndexProvider) PropertyIndexProvider(org.apache.jackrabbit.oak.plugins.index.property.PropertyIndexProvider) MemoryDocumentStore(org.apache.jackrabbit.oak.plugins.document.memory.MemoryDocumentStore) TypeEditorProvider(org.apache.jackrabbit.oak.plugins.nodetype.TypeEditorProvider) DocumentMK(org.apache.jackrabbit.oak.plugins.document.DocumentMK) Oak(org.apache.jackrabbit.oak.Oak) PropertyIndexEditorProvider(org.apache.jackrabbit.oak.plugins.index.property.PropertyIndexEditorProvider) MemoryBlobStore(org.apache.jackrabbit.oak.spi.blob.MemoryBlobStore) Before(org.junit.Before)

Example 5 with ReferenceEditorProvider

use of org.apache.jackrabbit.oak.plugins.index.reference.ReferenceEditorProvider in project jackrabbit-oak by apache.

the class AbstractSecurityTest method before.

@Before
public void before() throws Exception {
    Oak oak = new Oak().with(new InitialContent()).with(new VersionHook()).with(JcrConflictHandler.createJcrConflictHandler()).with(new NamespaceEditorProvider()).with(new ReferenceEditorProvider()).with(new ReferenceIndexProvider()).with(new PropertyIndexEditorProvider()).with(new PropertyIndexProvider()).with(new TypeEditorProvider()).with(new ConflictValidatorProvider()).with(getQueryEngineSettings()).with(getSecurityProvider());
    withEditors(oak);
    contentRepository = oak.createContentRepository();
    adminSession = login(getAdminCredentials());
    root = adminSession.getLatestRoot();
    Configuration.setConfiguration(getConfiguration());
}
Also used : NamespaceEditorProvider(org.apache.jackrabbit.oak.plugins.name.NamespaceEditorProvider) ReferenceEditorProvider(org.apache.jackrabbit.oak.plugins.index.reference.ReferenceEditorProvider) ReferenceIndexProvider(org.apache.jackrabbit.oak.plugins.index.reference.ReferenceIndexProvider) PropertyIndexProvider(org.apache.jackrabbit.oak.plugins.index.property.PropertyIndexProvider) TypeEditorProvider(org.apache.jackrabbit.oak.plugins.nodetype.TypeEditorProvider) PropertyIndexEditorProvider(org.apache.jackrabbit.oak.plugins.index.property.PropertyIndexEditorProvider) VersionHook(org.apache.jackrabbit.oak.plugins.version.VersionHook) ConflictValidatorProvider(org.apache.jackrabbit.oak.plugins.commit.ConflictValidatorProvider) Before(org.junit.Before)

Aggregations

PropertyIndexEditorProvider (org.apache.jackrabbit.oak.plugins.index.property.PropertyIndexEditorProvider)6 ReferenceEditorProvider (org.apache.jackrabbit.oak.plugins.index.reference.ReferenceEditorProvider)6 Before (org.junit.Before)3 PropertyIndexProvider (org.apache.jackrabbit.oak.plugins.index.property.PropertyIndexProvider)2 ReferenceIndexProvider (org.apache.jackrabbit.oak.plugins.index.reference.ReferenceIndexProvider)2 TypeEditorProvider (org.apache.jackrabbit.oak.plugins.nodetype.TypeEditorProvider)2 EditorHook (org.apache.jackrabbit.oak.spi.commit.EditorHook)2 OpenSecurityProvider (org.apache.jackrabbit.oak.spi.security.OpenSecurityProvider)2 Test (org.junit.Test)2 Closeable (java.io.Closeable)1 InitialContent (org.apache.jackrabbit.oak.InitialContent)1 Oak (org.apache.jackrabbit.oak.Oak)1 ContentRepository (org.apache.jackrabbit.oak.api.ContentRepository)1 ContentSession (org.apache.jackrabbit.oak.api.ContentSession)1 Root (org.apache.jackrabbit.oak.api.Root)1 Tree (org.apache.jackrabbit.oak.api.Tree)1 LogCustomizer (org.apache.jackrabbit.oak.commons.junit.LogCustomizer)1 ConflictValidatorProvider (org.apache.jackrabbit.oak.plugins.commit.ConflictValidatorProvider)1 DocumentMK (org.apache.jackrabbit.oak.plugins.document.DocumentMK)1 MemoryDocumentStore (org.apache.jackrabbit.oak.plugins.document.memory.MemoryDocumentStore)1