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


Java DirectoryService.getSchemaManager方法代码示例

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


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

示例1: DefaultCoreSession

import org.apache.directory.server.core.api.DirectoryService; //导入方法依赖的package包/类
/**
 * Creates a new instance of a DefaultCoreSession
 * @param principal The principal to use to process operation for this session
 * @param directoryService The DirectoryService to which we will send requests
 */
public DefaultCoreSession( LdapPrincipal principal, DirectoryService directoryService )
{
    this.directoryService = directoryService;
    authenticatedPrincipal = principal;

    if ( principal.getAuthenticationLevel() == AuthenticationLevel.NONE )
    {
        anonymousPrincipal = principal;
    }
    else
    {
        anonymousPrincipal = new LdapPrincipal( directoryService.getSchemaManager() );
    }

    // setup attribute type value
    OBJECT_CLASS_AT = directoryService.getSchemaManager().getAttributeType( SchemaConstants.OBJECT_CLASS_AT );
    
    // initalize the user session
    this.userSession = new HashMap<Object,Object>();
}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:26,代码来源:DefaultCoreSession.java

示例2: isSubSchemaSubEntrySearch

import org.apache.directory.server.core.api.DirectoryService; //导入方法依赖的package包/类
/**
 * <p>
 * Determines if a search request is a subSchemaSubEntry search.
 * </p>
 * <p>
 * It is a schema search if:
 * - the base Dn is the Dn of the subSchemaSubEntry of the root DSE
 * - and the scope is BASE OBJECT
 * - and the filter is (objectClass=subschema)
 * (RFC 4512, 4.4,)
 * </p>
 * <p>
 * However in this method we only check the first condition to avoid
 * performance issues.
 * </p>
 *
 * @param session the LDAP session
 * @param req the request issued
 *
 * @return true if the search is on the subSchemaSubEntry, false otherwise
 *
 * @throws Exception the exception
 */
private boolean isSubSchemaSubEntrySearch( LdapSession session, SearchRequest req ) throws Exception
{
    Dn base = req.getBase();
    String baseNormForm = ( base.isSchemaAware() ? base.getNormName() : base.getNormName() );

    DirectoryService ds = session.getCoreSession().getDirectoryService();
    PartitionNexus nexus = ds.getPartitionNexus();
    Value<?> subschemaSubentry = nexus.getRootDse( null ).get( SchemaConstants.SUBSCHEMA_SUBENTRY_AT ).get();
    Dn subschemaSubentryDn = new Dn( ds.getSchemaManager(), subschemaSubentry.getString() );
    String subschemaSubentryDnNorm = subschemaSubentryDn.getNormName();

    return subschemaSubentryDnNorm.equals( baseNormForm );
}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:37,代码来源:SearchRequestHandler.java


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