本文整理汇总了Java中org.apache.directory.server.core.factory.PartitionFactory类的典型用法代码示例。如果您正苦于以下问题:Java PartitionFactory类的具体用法?Java PartitionFactory怎么用?Java PartitionFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PartitionFactory类属于org.apache.directory.server.core.factory包,在下文中一共展示了PartitionFactory类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addPartition
import org.apache.directory.server.core.factory.PartitionFactory; //导入依赖的package包/类
/**
* Add a new partition to the directory server.
*
* @param partitionName - The name of the partition.
* @param indexes - The attributes to index.
* @return This Builder for subsequent changes.
*/
public Builder addPartition(final String id, final String partitionName, final int indexSize, final String ... indexes) throws Exception {
assertNotStarted();
if (directoryService == null) {
throw new IllegalStateException("The Directory service has not been created.");
}
SchemaManager schemaManager = directoryService.getSchemaManager();
PartitionFactory partitionFactory = directoryServiceFactory.getPartitionFactory();
Partition partition = partitionFactory.createPartition(schemaManager, directoryService.getDnFactory(), id, partitionName, 1000, workingDir);
for (String current : indexes) {
partitionFactory.addIndex(partition, current, indexSize);
}
partition.initialize();
directoryService.addPartition(partition);
return this;
}
示例2: createPartition
import org.apache.directory.server.core.factory.PartitionFactory; //导入依赖的package包/类
private static void createPartition(final DirectoryServiceFactory dsf, final SchemaManager schemaManager, final String id,
final String suffix, final DirectoryService directoryService, final File workingDir) throws Exception {
PartitionFactory pf = dsf.getPartitionFactory();
Partition p = pf.createPartition(schemaManager, id, suffix, 1000, workingDir);
pf.addIndex(p, "uid", 10);
pf.addIndex(p, "departmentNumber", 10);
pf.addIndex(p, "member", 10);
pf.addIndex(p, "memberOf", 10);
p.initialize();
directoryService.addPartition(p);
}
示例3: setupDirectoryService
import org.apache.directory.server.core.factory.PartitionFactory; //导入依赖的package包/类
public static SetupResult setupDirectoryService(Class<?> testClass) throws Exception {
// Define a default class DS then
DirectoryServiceFactory dsf = DefaultDirectoryServiceFactory.class.newInstance();
SetupResult result = new SetupResult();
result.directoryService = dsf.getDirectoryService();
result.directoryService.getChangeLog().setEnabled(true);
dsf.init("default" + UUID.randomUUID().toString());
// Apply the class LDIFs
ApplyLdifFiles applyLdifFiles = testClass.getAnnotation(ApplyLdifFiles.class);
if (applyLdifFiles != null) {
LOG.debug("Applying {} to {}", applyLdifFiles.value(), testClass.getName());
DSAnnotationProcessor.injectLdifFiles(applyLdifFiles.clazz(), result.directoryService, applyLdifFiles.value());
}
// check if it has a LdapServerBuilder then use the DS created above
CreateLdapServer ldapServerAnnotation = testClass.getAnnotation(CreateLdapServer.class);
if (ldapServerAnnotation != null) {
result.ldapServer = ServerAnnotationProcessor.instantiateLdapServer(ldapServerAnnotation, result.directoryService);
result.ldapServer.setDirectoryService(result.directoryService);
result.ldapServer.start();
}
// print out information which partition factory we use
DirectoryServiceFactory dsFactory = DefaultDirectoryServiceFactory.class.newInstance();
PartitionFactory partitionFactory = dsFactory.getPartitionFactory();
LOG.debug("Using partition factory {}", partitionFactory.getClass().getSimpleName());
return result;
}
示例4: getPartitionFactory
import org.apache.directory.server.core.factory.PartitionFactory; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
public PartitionFactory getPartitionFactory() throws Exception {
return partitionFactory;
}
示例5: getPartitionFactory
import org.apache.directory.server.core.factory.PartitionFactory; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public PartitionFactory getPartitionFactory() throws Exception {
return partitionFactory;
}
示例6: getPartitionFactory
import org.apache.directory.server.core.factory.PartitionFactory; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public PartitionFactory getPartitionFactory()
throws Exception {
return partitionFactory;
}
示例7: getPartitionFactory
import org.apache.directory.server.core.factory.PartitionFactory; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public PartitionFactory getPartitionFactory() throws Exception {
return partitionFactory;
}
示例8: InMemoryDirectoryServiceFactory
import org.apache.directory.server.core.factory.PartitionFactory; //导入依赖的package包/类
/**
* Constructor which uses provided {@link DirectoryService} and {@link PartitionFactory} implementations.
*
* @param directoryService must be not-<code>null</code>
* @param partitionFactory must be not-<code>null</code>
*/
public InMemoryDirectoryServiceFactory(DirectoryService directoryService, PartitionFactory partitionFactory) {
this.directoryService = directoryService;
this.partitionFactory = partitionFactory;
}
示例9: InMemoryDirectoryServiceFactory
import org.apache.directory.server.core.factory.PartitionFactory; //导入依赖的package包/类
/**
* Constructor which uses provided {@link DirectoryService} and {@link PartitionFactory} implementations.
*
* @param directoryService must be not-<code>null</code>
* @param partitionFactory must be not-<code>null</code>
*/
public InMemoryDirectoryServiceFactory(DirectoryService directoryService, PartitionFactory partitionFactory) {
this.directoryService = directoryService;
this.partitionFactory = partitionFactory;
}
示例10: InMemoryDirectoryServiceFactory
import org.apache.directory.server.core.factory.PartitionFactory; //导入依赖的package包/类
/**
* Constructor which uses provided {@link DirectoryService} and {@link PartitionFactory} implementations.
*
* @param directoryService must be not-<code>null</code>
* @param partitionFactory must be not-<code>null</code>
*/
public InMemoryDirectoryServiceFactory(DirectoryService directoryService, PartitionFactory partitionFactory) {
this.directoryService = directoryService;
this.partitionFactory = partitionFactory;
}