• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java DirectoryServiceFactory类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.directory.server.core.factory.DirectoryServiceFactory的典型用法代码示例。如果您正苦于以下问题:Java DirectoryServiceFactory类的具体用法?Java DirectoryServiceFactory怎么用?Java DirectoryServiceFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DirectoryServiceFactory类属于org.apache.directory.server.core.factory包,在下文中一共展示了DirectoryServiceFactory类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: startMasterLdapServer

import org.apache.directory.server.core.factory.DirectoryServiceFactory; //导入依赖的package包/类
private static void startMasterLdapServer() throws Exception {
    masterWorkingDir = createWorkingDir(masterWorkingDir, "master");
    DirectoryServiceFactory dsf = new InMemoryDirectoryServiceFactory();
    dsf.init(MASTER_DIRECTORY_NAME);
    masterDirectoryService = dsf.getDirectoryService();
    masterDirectoryService.getChangeLog().setEnabled(false);
    SchemaManager schemaManager = masterDirectoryService.getSchemaManager();

    createPartition(dsf, schemaManager, "simple", "dc=simple,dc=wildfly,dc=org", masterDirectoryService, masterWorkingDir);
    createPartition(dsf, schemaManager, "group-to-principal", "dc=group-to-principal,dc=wildfly,dc=org", masterDirectoryService, masterWorkingDir);
    createPartition(dsf, schemaManager, "principal-to-group", "dc=principal-to-group,dc=wildfly,dc=org", masterDirectoryService, masterWorkingDir);

    CoreSession adminSession = masterDirectoryService.getAdminSession();
    processLdif(schemaManager, adminSession, "memberOf-schema.ldif");
    processLdif(schemaManager, adminSession, "simple-partition.ldif");
    processLdif(schemaManager, adminSession, "group-to-principal.ldif");
    processLdif(schemaManager, adminSession, "principal-to-group.ldif");

    masterLdapServer = new LdapServer();
    masterLdapServer.setServiceName("DefaultLDAP");
    Transport ldap = new TcpTransport( "0.0.0.0", MASTER_LDAP_PORT, 3, 5 );
    masterLdapServer.addTransports(ldap);
    masterLdapServer.setDirectoryService(masterDirectoryService);
    masterLdapServer.start();
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:26,代码来源:LdapTestSuite.java


示例2: startSlaveLdapServer

import org.apache.directory.server.core.factory.DirectoryServiceFactory; //导入依赖的package包/类
private static void startSlaveLdapServer() throws Exception {
    slaveWorkingDir = createWorkingDir(slaveWorkingDir, "slave");
    DirectoryServiceFactory dsf = new InMemoryDirectoryServiceFactory();
    dsf.init(SLAVE_DIRECTORY_NAME);
    slaveDirectoryService = dsf.getDirectoryService();
    slaveDirectoryService.getChangeLog().setEnabled(false);
    SchemaManager schemaManager = slaveDirectoryService.getSchemaManager();

    createPartition(dsf, schemaManager, "simple", "dc=simple,dc=wildfly,dc=org", slaveDirectoryService, slaveWorkingDir);
    createPartition(dsf, schemaManager, "group-to-principal", "dc=group-to-principal,dc=wildfly,dc=org", slaveDirectoryService, slaveWorkingDir);
    createPartition(dsf, schemaManager, "principal-to-group", "dc=principal-to-group,dc=wildfly,dc=org", slaveDirectoryService, slaveWorkingDir);

    CoreSession adminSession = slaveDirectoryService.getAdminSession();
    processLdif(schemaManager, adminSession, "memberOf-schema.ldif");
    processLdif(schemaManager, adminSession, "simple-partition-slave.ldif");
    processLdif(schemaManager, adminSession, "group-to-principal-slave.ldif");
    processLdif(schemaManager, adminSession, "principal-to-group-slave.ldif");

    slaveLdapServer = new LdapServer();
    slaveLdapServer.setServiceName("DefaultLDAP");
    Transport ldap = new TcpTransport( "0.0.0.0", SLAVE_LDAP_PORT, 3, 5 );
    slaveLdapServer.addTransports(ldap);
    slaveLdapServer.setDirectoryService(slaveDirectoryService);
    slaveLdapServer.start();
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:26,代码来源:LdapTestSuite.java


示例3: start

import org.apache.directory.server.core.factory.DirectoryServiceFactory; //导入依赖的package包/类
public void start() throws Exception {
    DirectoryServiceFactory factory = new DefaultDirectoryServiceFactory();
    factory.init("server");
    service = factory.getDirectoryService();
    service.addPartition(createPartition("default", "cn=test"));
    service.addPartition(createPartition("domain", "dc=example,dc=com"));

    server = new LdapServer();
    server.setDirectoryService(service);
    server.setTransports(new TcpTransport(PORT));
    server.start();
}
 
开发者ID:ctco,项目名称:cukes,代码行数:13,代码来源:EmbeddedLDAPServer.java


示例4: initializeDefaultDirectoryService

import org.apache.directory.server.core.factory.DirectoryServiceFactory; //导入依赖的package包/类
protected void initializeDefaultDirectoryService()
        throws DirectoryServerException {
    try {

        DirectoryServiceFactory factory = CarbonDirectoryServiceFactory.DEFAULT;
        this.service = factory.getDirectoryService();

        configureDirectoryService();

        factory.init(this.ldapConfigurations.getInstanceId());

    } catch (Exception e) {
        throw new DirectoryServerException("Can not start the Default apacheds service ", e);
    }
}
 
开发者ID:wso2-attic,项目名称:carbon-identity,代码行数:16,代码来源:ApacheLDAPServer.java


示例5: createPartition

import org.apache.directory.server.core.factory.DirectoryServiceFactory; //导入依赖的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);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:12,代码来源:LdapTestSuite.java


示例6: setupDirectoryService

import org.apache.directory.server.core.factory.DirectoryServiceFactory; //导入依赖的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;
    }
 
开发者ID:wildfly-extras,项目名称:wildfly-camel,代码行数:34,代码来源:DirectoryServiceBuilder.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java MeasurementUnit类代码示例发布时间:2022-05-23
下一篇:
Java DefaultTypes类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap