org.apache.jackrabbit.oak.jcr.Jcr.with()方法的使用及代码示例

x33g5p2x  于2022-01-22 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(114)

本文整理了Java中org.apache.jackrabbit.oak.jcr.Jcr.with()方法的一些代码示例,展示了Jcr.with()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Jcr.with()方法的具体详情如下:
包路径:org.apache.jackrabbit.oak.jcr.Jcr
类名称:Jcr
方法名:with

Jcr.with介绍

暂无

代码示例

代码示例来源:origin: apache/jackrabbit-oak

@Override
  public Jcr customize(Oak oak) {
    Jcr jcr = new Jcr(oak);
    if (bundlingEnabled) {
      jcr.with(bundlingInitializer);
    }
    jcr.with(FixNodeTypeIndexInitializer.INSTANCE);
    return jcr;
  }
});

代码示例来源:origin: apache/jackrabbit-oak

protected Jcr initJcr(Jcr jcr) {
  QueryEngineSettings qs = new QueryEngineSettings();
  qs.setFullTextComparisonWithoutIndex(true);
  jcr.with(BundlingConfigInitializer.INSTANCE);
  return jcr.withAsyncIndexing().with(qs);
}

代码示例来源:origin: apache/jackrabbit-oak

@Override
  protected Jcr getJcr(NodeStore store) {
    CustomScheduledExecutor e = new CustomScheduledExecutor(10);
    executors.add(e);
    return super.getJcr(store)
      .with(e)
      .withAtomicCounter();
  }
}

代码示例来源:origin: apache/jackrabbit-oak

@Override
protected void preCreateRepository(Jcr jcr) {
  LuceneIndexProvider provider = new LuceneIndexProvider().with(getNodeAggregator());
  jcr.with(
      new LuceneCompatModeInitializer("luceneGlobal", (Set<String>) null))
      .with((QueryIndexProvider)provider)
      .with((Observer) provider)
      .withFastQueryResultSize(true)
      .with(new LuceneIndexEditorProvider());
}

代码示例来源:origin: org.apache.jackrabbit/oak-jcr

/**
 * @deprecated Use {@link #with(ThreeWayConflictHandler)} instead
 */
@Deprecated
@NotNull
public final Jcr with(@NotNull PartialConflictHandler conflictHandler) {
  return with(ConflictHandlers.wrap(conflictHandler));
}

代码示例来源:origin: apache/jackrabbit-oak

@Override
  public Jcr customize(Oak oak) {
    return new Jcr(oak).with(newTestSecurityProvider(cnt));
  }
});

代码示例来源:origin: apache/jackrabbit-oak

/**
 * @deprecated Use {@link #with(ThreeWayConflictHandler)} instead
 */
@Deprecated
@NotNull
public final Jcr with(@NotNull PartialConflictHandler conflictHandler) {
  return with(ConflictHandlers.wrap(conflictHandler));
}

代码示例来源:origin: apache/jackrabbit-oak

protected Jcr getJcr(@NotNull NodeStore store) {
  Jcr j = new Jcr(checkNotNull(store));
  if (store instanceof Clusterable) {
    j.with((Clusterable) store);
  }
  return j;
}

代码示例来源:origin: apache/jackrabbit-oak

@Before
public void before() {
  Jcr jcr = new Jcr();
  // lucene specific
  jcr.with(new LuceneInitializerHelper("lucene").async());
  LuceneIndexProvider provider = new LuceneIndexProvider();
  jcr.with((QueryIndexProvider) provider);
  jcr.with((Observer) provider);
  jcr.with(new LuceneIndexEditorProvider());
  repository = jcr.createRepository();
}

代码示例来源:origin: apache/jackrabbit-oak

@Override
  public Jcr customize(Oak oak) {
    ConfigurationParameters conf = ConfigurationParameters.of(UserConfiguration.NAME,
        ConfigurationParameters.of(ProtectedItemImporter.PARAM_IMPORT_BEHAVIOR, ImportBehavior.NAME_BESTEFFORT));
    SecurityProvider sp = SecurityProviderBuilder.newBuilder().with(conf).build();
    return new Jcr(oak).with(sp);
  }
});

代码示例来源:origin: apache/jackrabbit-oak

@Before
public void before() throws Exception {
  LuceneIndexProvider provider = new LuceneIndexProvider();
  Jcr jcr = new Jcr()
    .with(((QueryIndexProvider) provider))
    .with((Observer) provider)
    .with(new LuceneIndexEditorProvider());
  repository = jcr.createRepository();
  session = (JackrabbitSession) repository.login(new SimpleCredentials("admin", "admin".toCharArray()));
  root = session.getRootNode();
}

代码示例来源:origin: apache/jackrabbit-oak

@Override
  public Jcr customize(Oak oak) {
    ConfigurationParameters params = ConfigurationParameters.of("eagerCacheSize", 100);
    SecurityProvider securityProvider = SecurityProviderBuilder.newBuilder().with(ConfigurationParameters.of(AuthorizationConfiguration.NAME, params)).build();
    return new Jcr(oak).with(securityProvider);
  }
});

代码示例来源:origin: apache/jackrabbit-oak

@Override
  public Jcr customize(Oak oak) {
    ConfigurationParameters conf = ConfigurationParameters.of(UserConfiguration.NAME,
        ConfigurationParameters.of(ProtectedItemImporter.PARAM_IMPORT_BEHAVIOR,
            ImportBehavior.NAME_BESTEFFORT));
    SecurityProvider sp = SecurityProviderBuilder.newBuilder().with(conf).build();
    return new Jcr(oak).with(sp);
  }
});

代码示例来源:origin: apache/jackrabbit-oak

@Override
  public Jcr customize(Oak oak) {
    ConfigurationParameters config = ConfigurationParameters.of(UserConfiguration.NAME,
        ConfigurationParameters.of(ProtectedItemImporter.PARAM_IMPORT_BEHAVIOR, importBehavior));
    SecurityProvider sp = SecurityProviderBuilder.newBuilder().with(config).build();
    return new Jcr(oak).with(sp);
  }
});

代码示例来源:origin: apache/jackrabbit-oak

@Override
  public Jcr customize(Oak oak) {
    ConfigurationParameters conf = ConfigurationParameters.of(UserConfiguration.NAME,
        ConfigurationParameters.of(ProtectedItemImporter.PARAM_IMPORT_BEHAVIOR,
            ImportBehavior.NAME_BESTEFFORT));
    SecurityProvider sp = SecurityProviderBuilder.newBuilder().with(conf).build();
    return new Jcr(oak).with(sp);
  }
});

代码示例来源:origin: apache/jackrabbit-oak

@Before
public void prepare() throws Exception {
  File tempDir = new File("target", "test-jcr2");
  if (!tempDir.isDirectory()) {
    Util.unzip(AbstractOak2OakTest.class.getResourceAsStream("/jcr2.zip"), tempDir);
  }
  OakUpgrade.main("--copy-binaries", tempDir.getPath(), destinationContainer.getDescription());
  destination = destinationContainer.open();
  repository = (RepositoryImpl) new Jcr(destination).with("oak.sling").with(new ReferenceIndexProvider()).createRepository();
  session = repository.login(new SimpleCredentials("admin", "admin".toCharArray()));
}

代码示例来源:origin: apache/jackrabbit-oak

protected void createSession() throws RepositoryException, IOException {
  destination = getDestinationContainer().open();
  repository = (RepositoryImpl) new Jcr(destination).with("oak.sling").with(new ReferenceIndexProvider()).createRepository();
  session = repository.login(new SimpleCredentials("admin", "admin".toCharArray()));
}

代码示例来源:origin: apache/jackrabbit-oak

private Repository createRepo() {
  SecurityProvider securityProvider = TestSecurityProvider.newTestSecurityProvider(ConfigurationParameters.EMPTY,
      new ExternalPrincipalConfiguration());
  QueryEngineSettings queryEngineSettings = new QueryEngineSettings();
  queryEngineSettings.setFailTraversal(true);
  Jcr jcr = new Jcr();
  jcr.with(securityProvider);
  jcr.with(queryEngineSettings);
  return jcr.createRepository();
}

代码示例来源:origin: apache/jackrabbit-oak

@Override
protected Repository createRepository(NodeStore nodeStore) {
  Whiteboard wb = new DefaultWhiteboard();
  BlobStore blobStore = getNodeStoreComponent(BlobStore.class);
  if (blobStore != null && blobStore instanceof BlobAccessProvider) {
    wb.register(BlobAccessProvider.class, (BlobAccessProvider) blobStore,
        Collections.emptyMap());
  }
  return initJcr(new Jcr(nodeStore).with(wb)).createRepository();
}

代码示例来源:origin: apache/jackrabbit-oak

@Before
public void setup() throws RepositoryException {
  session = new Jcr()
    .with(new OpenSecurityProvider())
    .createRepository()
    .login();
}

相关文章