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

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

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

Jcr.<init>介绍

暂无

代码示例

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

@Override
  public Jcr customize(Oak oak) {
    return new Jcr(oak);
  }
};

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

@Override
  public Jcr customize(Oak oak) {
    whiteboardRef.set(oak);
    return new Jcr(oak);
  }
});

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

private static Repository getRepository(
    URI uri, Map<String, String> parameters)
    throws RepositoryException {
  // TODO correctly interpret uri
  return new Jcr().createRepository();
}

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

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

代码示例来源: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

@Before
public void before() throws Exception {
  repository = new Jcr().createRepository();
  Session admin = repository.login(new SimpleCredentials("admin", "admin".toCharArray()));
  sessions.add(admin);
  Node testNode = admin.getRootNode().addNode("testNode");
  AccessControlUtils.addAccessControlEntry(admin, testNode.getPath(),
      EveryonePrincipal.getInstance(), new String[]{Privilege.JCR_READ}, true);
  admin.save();
}

代码示例来源: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

@Before
public void setUp() throws Exception {
  jackrabbitRepository = JcrUtils.getRepository(
      new File("target", "jackrabbit").toURI().toURL().toString());
  oakRepository = new Jcr().createRepository();
  writeSessions.add((JackrabbitSession) jackrabbitRepository.login(new SimpleCredentials("admin", "admin".toCharArray())));
  writeSessions.add((JackrabbitSession) oakRepository.login(new SimpleCredentials("admin", "admin".toCharArray())));
  setupAuthorizables();
  setupContent();
  readSessions.add(jackrabbitRepository.login(new SimpleCredentials(userId, userId.toCharArray())));
  readSessions.add(oakRepository.login(new SimpleCredentials(userId, userId.toCharArray())));
}

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

public Repository getTargetRepository() {
  if (targetRepository == null) {
    targetRepository = (JackrabbitRepository) new Jcr(new Oak(
        targetNodeStore)).createRepository();
  }
  return targetRepository;
}

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

@Before
public void setUp() throws RepositoryException {
  r = new Jcr().createRepository();
  s = r.login(new SimpleCredentials("admin", "admin".toCharArray()));
}

代码示例来源: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

/**
 * Adjust JCR repository creation to register a mock BlobAccessProvider in Whiteboard
 * so it can be picked up by oak-jcr.
 */
@Override
protected Repository createRepository(NodeStore nodeStore) {
  Oak oak = new Oak(nodeStore);
  oak.getWhiteboard().register(BlobAccessProvider.class, new MockBlobAccessProvider(), Collections.emptyMap());
  return initJcr(new Jcr(oak)).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 before() throws Exception {
  store = SegmentNodeStoreBuilders.builder(new MemoryStore()).build();
  repo = new Jcr(store).createRepository();
  session = repo.login(new SimpleCredentials("admin", "admin".toCharArray()));
  vMgr = session.getWorkspace().getVersionManager();
}

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

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

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

@Before
public void before() throws Exception {
  ns = builderProvider.newBuilder().setAsyncDelay(0)
      .setDocumentStore(store).build();
  repository = new Jcr(ns).createRepository();
  session = repository.login(new SimpleCredentials("admin", "admin".toCharArray()));
}

代码示例来源: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

private static void initRepository() throws Exception {
  MongoConnection con = createConnection();
  DocumentMK mk = new DocumentMK.Builder()
      .setMongoDB(con.getMongoClient(), con.getDBName())
      .setClusterId(1).open();
  Repository repository = new Jcr(mk.getNodeStore()).createRepository();
  Session session = repository.login(
      new SimpleCredentials("admin", "admin".toCharArray()));
  session.logout();
  dispose(repository);
  mk.dispose(); // closes connection as well
}

代码示例来源: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();
}

相关文章