org.apache.directory.server.core.api.DnFactory Java Examples

The following examples show how to use org.apache.directory.server.core.api.DnFactory. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ApacheDSStartStopListener.java    From syncope with Apache License 2.0 6 votes vote down vote up
/**
 * 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 void 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);

    Set<Index<?, String>> indexedAttributes = Stream.of(
            SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.OU_AT,
            SchemaConstants.UID_AT, SchemaConstants.CN_AT).
            map(attr -> new JdbmIndex<String>(attr, false)).collect(Collectors.toSet());
    partition.setIndexedAttributes(indexedAttributes);
}
 
Example #2
Source File: ApacheDSUtils.java    From aws-iam-ldap-bridge with Apache License 2.0 5 votes vote down vote up
/**
 * 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
 */
public 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(service.getSchemaManager(), partitionDn));
    partition.initialize();
    service.addPartition( partition );

    return partition;
}
 
Example #3
Source File: LdapTestEnvironment.java    From camunda-bpm-platform with Apache License 2.0 5 votes vote down vote up
/**
 * 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;
}
 
Example #4
Source File: InMemoryDirectoryServiceFactory.java    From wildfly-core with GNU Lesser General Public License v2.1 4 votes vote down vote up
@Override
public DnFactory getDnFactory() {
    return wrapped.getDnFactory();
}
 
Example #5
Source File: InMemoryDirectoryServiceFactory.java    From wildfly-core with GNU Lesser General Public License v2.1 4 votes vote down vote up
@Override
public DnFactory getDnFactory() {
    return wrapped.getDnFactory();
}
 
Example #6
Source File: InMemoryDirectoryServiceFactory.java    From wildfly-core with GNU Lesser General Public License v2.1 4 votes vote down vote up
@Override
public DnFactory getDnFactory() {
    return wrapped.getDnFactory();
}
 
Example #7
Source File: InMemoryDirectoryServiceFactory.java    From wildfly-core with GNU Lesser General Public License v2.1 4 votes vote down vote up
@Override
public DnFactory getDnFactory() {
    return wrapped.getDnFactory();
}