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"));
}
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)));
}
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();
}
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);
}
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());
}
Aggregations