本文整理汇总了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>();
}
示例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 );
}