当前位置: 首页>>代码示例>>Java>>正文


Java JdbmPartition.setSuffixDn方法代码示例

本文整理汇总了Java中org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition.setSuffixDn方法的典型用法代码示例。如果您正苦于以下问题:Java JdbmPartition.setSuffixDn方法的具体用法?Java JdbmPartition.setSuffixDn怎么用?Java JdbmPartition.setSuffixDn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition的用法示例。


在下文中一共展示了JdbmPartition.setSuffixDn方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addPartition

import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition; //导入方法依赖的package包/类
private Partition addPartition(String partitionId, String partitionDn, DnFactory dnFactory) throws Exception {
    JdbmPartition partition = new JdbmPartition(directoryService.getSchemaManager(), dnFactory);
    partition.setId(partitionId);
    partition.setPartitionPath(new File(directoryService.getInstanceLayout().getPartitionsDirectory(), partitionId)
            .toURI());
    partition.setSuffixDn(new Dn(directoryService.getSchemaManager(), partitionDn));
    directoryService.addPartition(partition);
    return partition;
}
 
开发者ID:intropro,项目名称:prairie,代码行数:10,代码来源:KerberosServer.java

示例2: addPartition

import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition; //导入方法依赖的package包/类
private Partition addPartition(String partitionId, String partitionDn, DnFactory dnFactory) throws Exception {
      JdbmPartition partition = new JdbmPartition(directoryService.getSchemaManager(), dnFactory);
      partition.setId(partitionId);
      partition.setPartitionPath(new File(directoryService.getInstanceLayout().getPartitionsDirectory(), partitionId).toURI());
      try {
	partition.setSuffixDn(new Dn(directoryService.getSchemaManager(), partitionDn));
} catch (LdapInvalidDnException e) {
	log.error("Could not create partition " + partitionId + ", exiting; " + e.getMessage());
	throw new Exception();
}
      
      return partition;
  }
 
开发者ID:ztarbug,项目名称:apacheds-embedded,代码行数:14,代码来源:DirectoryRunner.java

示例3: addPartition

import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition; //导入方法依赖的package包/类
/**
 * Add a new partition to the server.
 *
 * @param partitionId The partition Id
 * @param partitionDn The partition DN
 * @param dnFactory the DN factory
 * @return The newly added partition
 * @throws Exception If the partition can't be added
 */
private Partition addPartition(final String partitionId, final String partitionDn, final DnFactory dnFactory)
        throws Exception {

    // Create a new partition with the given partition id
    JdbmPartition partition = new JdbmPartition(service.getSchemaManager(), dnFactory);
    partition.setId(partitionId);
    partition.setPartitionPath(new File(service.getInstanceLayout().getPartitionsDirectory(), partitionId).toURI());
    partition.setSuffixDn(new Dn(partitionDn));
    service.addPartition(partition);

    return partition;
}
 
开发者ID:apache,项目名称:syncope,代码行数:22,代码来源:ApacheDSStartStopListener.java

示例4: addPartition

import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition; //导入方法依赖的package包/类
/**
 * Add a new partition to the server
 *
 * @param partitionId The partition Id
 * @param partitionDn The partition DN
 * @param dnFactory the DN factory
 * @return The newly added partition
 * @throws Exception If the partition can't be added
 */
protected Partition addPartition(String partitionId, String partitionDn, DnFactory dnFactory) throws Exception {
  // Create a new partition with the given partition id
  JdbmPartition partition = new JdbmPartition(service.getSchemaManager(), dnFactory);
  partition.setId(partitionId);
  partition.setPartitionPath(new File(service.getInstanceLayout().getPartitionsDirectory(), partitionId).toURI());
  partition.setSuffixDn(new Dn(partitionDn));
  service.addPartition(partition);

  return partition;
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:20,代码来源:LdapTestEnvironment.java

示例5: initDirectoryService

import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition; //导入方法依赖的package包/类
private void initDirectoryService() throws Exception {
  ds = new DefaultDirectoryService();
  ds.setInstanceLayout(new InstanceLayout(workDir));

  CacheService cacheService = new CacheService();
  ds.setCacheService(cacheService);

  // first load the schema
  InstanceLayout instanceLayout = ds.getInstanceLayout();
  File schemaPartitionDirectory = new File(
          instanceLayout.getPartitionsDirectory(), "schema");
  SchemaLdifExtractor extractor = new DefaultSchemaLdifExtractor(
          instanceLayout.getPartitionsDirectory());
  extractor.extractOrCopy();

  SchemaLoader loader = new LdifSchemaLoader(schemaPartitionDirectory);
  SchemaManager schemaManager = new DefaultSchemaManager(loader);
  schemaManager.loadAllEnabled();
  ds.setSchemaManager(schemaManager);
  // Init the LdifPartition with schema
  LdifPartition schemaLdifPartition = new LdifPartition(schemaManager);
  schemaLdifPartition.setPartitionPath(schemaPartitionDirectory.toURI());

  // The schema partition
  SchemaPartition schemaPartition = new SchemaPartition(schemaManager);
  schemaPartition.setWrappedPartition(schemaLdifPartition);
  ds.setSchemaPartition(schemaPartition);

  JdbmPartition systemPartition = new JdbmPartition(ds.getSchemaManager());
  systemPartition.setId("system");
  systemPartition.setPartitionPath(new File(
          ds.getInstanceLayout().getPartitionsDirectory(),
          systemPartition.getId()).toURI());
  systemPartition.setSuffixDn(new Dn(ServerDNConstants.SYSTEM_DN));
  systemPartition.setSchemaManager(ds.getSchemaManager());
  ds.setSystemPartition(systemPartition);

  ds.getChangeLog().setEnabled(false);
  ds.setDenormalizeOpAttrsEnabled(true);
  ds.addLast(new KeyDerivationInterceptor());

  // create one partition
  String orgName= conf.getProperty(ORG_NAME).toLowerCase(Locale.ENGLISH);
  String orgDomain = conf.getProperty(ORG_DOMAIN).toLowerCase(Locale.ENGLISH);

  JdbmPartition partition = new JdbmPartition(ds.getSchemaManager());
  partition.setId(orgName);
  partition.setPartitionPath(new File(
          ds.getInstanceLayout().getPartitionsDirectory(), orgName).toURI());
  partition.setSuffixDn(new Dn("dc=" + orgName + ",dc=" + orgDomain));
  ds.addPartition(partition);
  // indexes
  Set<Index<?, ?, String>> indexedAttributes = new HashSet<Index<?, ?, String>>();
  indexedAttributes.add(new JdbmIndex<String, Entry>("objectClass", false));
  indexedAttributes.add(new JdbmIndex<String, Entry>("dc", false));
  indexedAttributes.add(new JdbmIndex<String, Entry>("ou", false));
  partition.setIndexedAttributes(indexedAttributes);

  // And start the ds
  ds.setInstanceId(conf.getProperty(INSTANCE));
  ds.startup();
  // context entry, after ds.startup()
  Dn dn = new Dn("dc=" + orgName + ",dc=" + orgDomain);
  Entry entry = ds.newEntry(dn);
  entry.add("objectClass", "top", "domain");
  entry.add("dc", orgName);
  ds.getAdminSession().add(entry);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:69,代码来源:MiniKdc.java

示例6: initDirectoryService

import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition; //导入方法依赖的package包/类
private void initDirectoryService() throws Exception {
    ds = new DefaultDirectoryService();
    ds.setInstanceLayout(new InstanceLayout(workDir));

    CacheService cacheService = new CacheService();
    ds.setCacheService(cacheService);

    // first load the schema
    InstanceLayout instanceLayout = ds.getInstanceLayout();
    File schemaPartitionDirectory = new File(instanceLayout.getPartitionsDirectory(), "schema");
    SchemaLdifExtractor extractor = new DefaultSchemaLdifExtractor(instanceLayout.getPartitionsDirectory());
    extractor.extractOrCopy();

    SchemaLoader loader = new LdifSchemaLoader(schemaPartitionDirectory);
    SchemaManager schemaManager = new DefaultSchemaManager(loader);
    schemaManager.loadAllEnabled();
    ds.setSchemaManager(schemaManager);
    // Init the LdifPartition with schema
    LdifPartition schemaLdifPartition = new LdifPartition(schemaManager);
    schemaLdifPartition.setPartitionPath(schemaPartitionDirectory.toURI());

    // The schema partition
    SchemaPartition schemaPartition = new SchemaPartition(schemaManager);
    schemaPartition.setWrappedPartition(schemaLdifPartition);
    ds.setSchemaPartition(schemaPartition);

    JdbmPartition systemPartition = new JdbmPartition(ds.getSchemaManager());
    systemPartition.setId("system");
    systemPartition.setPartitionPath(
            new File(ds.getInstanceLayout().getPartitionsDirectory(), systemPartition.getId()).toURI());
    systemPartition.setSuffixDn(new Dn(ServerDNConstants.SYSTEM_DN));
    systemPartition.setSchemaManager(ds.getSchemaManager());
    ds.setSystemPartition(systemPartition);

    ds.getChangeLog().setEnabled(false);
    ds.setDenormalizeOpAttrsEnabled(true);
    ds.addLast(new KeyDerivationInterceptor());

    // create one partition
    String orgName = conf.getProperty(ORG_NAME).toLowerCase(Locale.ENGLISH);
    String orgDomain = conf.getProperty(ORG_DOMAIN).toLowerCase(Locale.ENGLISH);

    JdbmPartition partition = new JdbmPartition(ds.getSchemaManager());
    partition.setId(orgName);
    partition.setPartitionPath(new File(ds.getInstanceLayout().getPartitionsDirectory(), orgName).toURI());
    partition.setSuffixDn(new Dn("dc=" + orgName + ",dc=" + orgDomain));
    ds.addPartition(partition);
    // indexes
    Set<Index<?, ?, String>> indexedAttributes = new HashSet<Index<?, ?, String>>();
    indexedAttributes.add(new JdbmIndex<String, Entry>("objectClass", false));
    indexedAttributes.add(new JdbmIndex<String, Entry>("dc", false));
    indexedAttributes.add(new JdbmIndex<String, Entry>("ou", false));
    partition.setIndexedAttributes(indexedAttributes);

    // And start the ds
    ds.setInstanceId(conf.getProperty(INSTANCE));
    ds.startup();
    // context entry, after ds.startup()
    Dn dn = new Dn("dc=" + orgName + ",dc=" + orgDomain);
    Entry entry = ds.newEntry(dn);
    entry.add("objectClass", "top", "domain");
    entry.add("dc", orgName);
    ds.getAdminSession().add(entry);
}
 
开发者ID:l294265421,项目名称:ZooKeeper,代码行数:65,代码来源:MiniKdc.java

示例7: initDirectoryService

import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition; //导入方法依赖的package包/类
/**
 * Initialize the server. It creates the partition, adds the index, and injects the context entries for the created
 * partitions.
 *
 * @param workDir the directory to be used for storing the data
 * @param loadDefaultContent if default content should be loaded
 * @throws Exception if there were some problems while initializing
 */
private void initDirectoryService(final ServletContext servletContext, final File workDir,
        final boolean loadDefaultContent) throws Exception {

    // Initialize the LDAP service
    service = new DefaultDirectoryService();
    service.setInstanceLayout(new InstanceLayout(workDir));

    CacheService cacheService = new CacheService();
    cacheService.initialize(service.getInstanceLayout());

    service.setCacheService(cacheService);

    // first load the schema
    initSchemaPartition();

    // then the system partition
    // this is a MANDATORY partition
    // DO NOT add this via addPartition() method, trunk code complains about duplicate partition
    // while initializing
    JdbmPartition systemPartition = new JdbmPartition(service.getSchemaManager(), service.getDnFactory());
    systemPartition.setId("system");
    systemPartition.setPartitionPath(
            new File(service.getInstanceLayout().getPartitionsDirectory(), systemPartition.getId()).toURI());
    systemPartition.setSuffixDn(new Dn(ServerDNConstants.SYSTEM_DN));
    systemPartition.setSchemaManager(service.getSchemaManager());

    // mandatory to call this method to set the system partition
    // Note: this system partition might be removed from trunk
    service.setSystemPartition(systemPartition);

    // Disable the ChangeLog system
    service.getChangeLog().setEnabled(false);
    service.setDenormalizeOpAttrsEnabled(true);

    // Now we can create as many partitions as we need
    Partition ispPartition = addPartition("isp", "o=isp", service.getDnFactory());

    // Index some attributes on the apache partition
    addIndex(ispPartition, "objectClass", "ou", "uid");

    // And start the service
    service.startup();

    if (loadDefaultContent) {
        Resource contentLdif = WebApplicationContextUtils.getWebApplicationContext(servletContext).
                getResource("classpath:/content.ldif");
        LdifInputStreamLoader contentLoader = new LdifInputStreamLoader(service.getAdminSession(),
                contentLdif.getInputStream());
        int numEntries = contentLoader.execute();
        LOG.info("Successfully created {} entries", numEntries);
    }
}
 
开发者ID:apache,项目名称:syncope,代码行数:61,代码来源:ApacheDSStartStopListener.java

示例8: initDirectoryService

import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition; //导入方法依赖的package包/类
private void initDirectoryService() throws Exception {
  ds = new DefaultDirectoryService();
  ds.setInstanceLayout(new InstanceLayout(workDir));

  CacheService cacheService = new CacheService();
  ds.setCacheService(cacheService);

  // first load the schema
  InstanceLayout instanceLayout = ds.getInstanceLayout();
  File schemaPartitionDirectory = new File(
          instanceLayout.getPartitionsDirectory(), "schema");
  SchemaLdifExtractor extractor = new DefaultSchemaLdifExtractor(
          instanceLayout.getPartitionsDirectory());
  extractor.extractOrCopy();

  SchemaLoader loader = new LdifSchemaLoader(schemaPartitionDirectory);
  SchemaManager schemaManager = new DefaultSchemaManager(loader);
  schemaManager.loadAllEnabled();
  ds.setSchemaManager(schemaManager);
  // Init the LdifPartition with schema
  LdifPartition schemaLdifPartition = new LdifPartition(schemaManager);
  schemaLdifPartition.setPartitionPath(schemaPartitionDirectory.toURI());

  // The schema partition
  SchemaPartition schemaPartition = new SchemaPartition(schemaManager);
  schemaPartition.setWrappedPartition(schemaLdifPartition);
  ds.setSchemaPartition(schemaPartition);

  JdbmPartition systemPartition = new JdbmPartition(ds.getSchemaManager());
  systemPartition.setId("system");
  systemPartition.setPartitionPath(new File(
          ds.getInstanceLayout().getPartitionsDirectory(),
          systemPartition.getId()).toURI());
  systemPartition.setSuffixDn(new Dn(ServerDNConstants.SYSTEM_DN));
  systemPartition.setSchemaManager(ds.getSchemaManager());
  ds.setSystemPartition(systemPartition);

  ds.getChangeLog().setEnabled(false);
  ds.setDenormalizeOpAttrsEnabled(true);
  ds.addLast(new KeyDerivationInterceptor());

  // create one partition
  String orgName= conf.getProperty(ORG_NAME).toLowerCase();
  String orgDomain = conf.getProperty(ORG_DOMAIN).toLowerCase();

  JdbmPartition partition = new JdbmPartition(ds.getSchemaManager());
  partition.setId(orgName);
  partition.setPartitionPath(new File(
          ds.getInstanceLayout().getPartitionsDirectory(), orgName).toURI());
  partition.setSuffixDn(new Dn("dc=" + orgName + ",dc=" + orgDomain));
  ds.addPartition(partition);
  // indexes
  Set<Index<?, ?, String>> indexedAttributes = new HashSet<Index<?, ?, String>>();
  indexedAttributes.add(new JdbmIndex<String, Entry>("objectClass", false));
  indexedAttributes.add(new JdbmIndex<String, Entry>("dc", false));
  indexedAttributes.add(new JdbmIndex<String, Entry>("ou", false));
  partition.setIndexedAttributes(indexedAttributes);

  // And start the ds
  ds.setInstanceId(conf.getProperty(INSTANCE));
  ds.startup();
  // context entry, after ds.startup()
  Dn dn = new Dn("dc=" + orgName + ",dc=" + orgDomain);
  Entry entry = ds.newEntry(dn);
  entry.add("objectClass", "top", "domain");
  entry.add("dc", orgName);
  ds.getAdminSession().add(entry);
}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre2,代码行数:69,代码来源:MiniKdc.java

示例9: initializeDirectory

import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition; //导入方法依赖的package包/类
/**
 * Initialize the server. It creates the partition, adds the index, and
 * injects the context entries for the created partitions.
 *
 * @throws Exception if there were some problems while initializing the system
 */
protected void initializeDirectory() throws Exception {

  workingDirectory.mkdirs();

  service = new DefaultDirectoryService();
  InstanceLayout il = new InstanceLayout(workingDirectory);
  service.setInstanceLayout(il);

  CacheService cacheService = new CacheService();
  cacheService.initialize(service.getInstanceLayout());
  service.setCacheService(cacheService);

  initSchemaPartition();

  // then the system partition
  // this is a MANDATORY partition
  // DO NOT add this via addPartition() method, trunk code complains about duplicate partition
  // while initializing
  JdbmPartition systemPartition = new JdbmPartition(service.getSchemaManager(), service.getDnFactory());
  systemPartition.setId("system");
  systemPartition.setPartitionPath(new File(service.getInstanceLayout().getPartitionsDirectory(), systemPartition.getId()).toURI());
  systemPartition.setSuffixDn(new Dn(ServerDNConstants.SYSTEM_DN));
  systemPartition.setSchemaManager(service.getSchemaManager());

  // mandatory to call this method to set the system partition
  // Note: this system partition might be removed from trunk
  service.setSystemPartition(systemPartition);

  // Disable the ChangeLog system
  service.getChangeLog().setEnabled(false);
  service.setDenormalizeOpAttrsEnabled(true);

  Partition camundaPartition = addPartition("camunda", BASE_DN, service.getDnFactory());
  addIndex(camundaPartition, "objectClass", "ou", "uid");

  service.startup();

  // Create the root entry
  if (!service.getAdminSession().exists(camundaPartition.getSuffixDn())) {
    Dn dn = new Dn(BASE_DN);
    Entry entry = service.newEntry(dn);
    entry.add("objectClass", "top", "domain", "extensibleObject");
    entry.add("dc", "camunda");
    service.getAdminSession().add(entry);
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:53,代码来源:LdapTestEnvironment.java


注:本文中的org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition.setSuffixDn方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。