org.apache.directory.shared.ldap.name.DN.normalize()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(6.8k)|赞(0)|评价(0)|浏览(118)

本文整理了Java中org.apache.directory.shared.ldap.name.DN.normalize()方法的一些代码示例,展示了DN.normalize()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DN.normalize()方法的具体详情如下:
包路径:org.apache.directory.shared.ldap.name.DN
类名称:DN
方法名:normalize

DN.normalize介绍

[英]Static factory which creates a normalized DN from a String and a Map of OIDs.
[中]静态工厂,从字符串和OID映射创建规范化DN。

代码示例

代码示例来源:origin: org.apache.directory.shared/shared-ldap

public DN getDn( Object obj ) throws LdapInvalidDnException
{
  DN dn = null;
  
  if ( obj instanceof DN )
  {
    dn = (DN)obj;
    
    dn = ( dn.isNormalized() ? dn : DN.normalize( dn, schemaManager.getNormalizerMapping() ) );
  }
  else if ( obj instanceof String )
  {
    dn = new DN( ( String ) obj );
    dn.normalize( schemaManager.getNormalizerMapping() );
  }
  else
  {
    throw new IllegalStateException( I18n.err( I18n.ERR_04218, (obj == null ? null : obj.getClass() ) ) );
  }
  
  return dn;
}

代码示例来源:origin: org.apache.directory.shared/shared-ldap

/**
 * {@inheritDoc}
 */
public String normalize( String value ) throws LdapException
{
  DN dn = null;
  
  dn = new DN( value );
  
  dn.normalize( schemaManager.getNormalizerMapping() );
  return dn.getNormName();
}

代码示例来源:origin: org.apache.directory.shared/shared-ldap

public DN getDn( Object obj ) throws LdapInvalidDnException
  {
    DN dn = null;

    if ( obj instanceof DN )
    {
      dn = ( DN ) obj;

      dn = ( dn.isNormalized() ? dn : DN.normalize( dn, schemaManager.getNormalizerMapping() ) );
    }
    else if ( obj instanceof String )
    {
      dn = new DN( ( String ) obj );
      dn.normalize( schemaManager.getNormalizerMapping() );
    }
    else
    {
      throw new IllegalStateException( I18n.err( I18n.ERR_04218, ( obj == null ? null : obj.getClass() ) ) );
    }

    return dn;
  }
}

代码示例来源:origin: org.apache.directory.shared/shared-ldap

/**
 * Normalize a DN
 * @param value The DN to normalize
 * @return A normalized DN
 * @throws LdapException
 */
public String normalize( DN value ) throws LdapException
{
  DN dn = null;
  
  dn = new DN( value );
  
  dn.normalize( schemaManager.getNormalizerMapping() );
  return dn.getNormName();
}

代码示例来源:origin: org.apache.directory.shared/shared-ldap-schema-manager

/**
 * Initializes the SchemaService
 *
 * @throws Exception If the initialization fails
 */
public void initialize() throws Exception
{
  try
  {
    schemaModificationAttributesDN = new DN( SchemaConstants.SCHEMA_MODIFICATIONS_DN );
    schemaModificationAttributesDN
      .normalize( getRegistries().getAttributeTypeRegistry().getNormalizerMapping() );
  }
  catch ( LdapInvalidDnException e )
  {
    throw new RuntimeException( e );
  }
}

代码示例来源:origin: org.apache.directory.shared/shared-ldap

dn.normalize( schemaManager.getNormalizerMapping() );
return new DN( value ).normalize( schemaManager.getNormalizerMapping() ).getNormName();

代码示例来源:origin: org.apache.directory.shared/shared-ldap

public final  DN  distinguishedName() throws RecognitionException, TokenStreamException {
   DN name ;
  
  Token  token = null;
  
  log.debug( "entered distinguishedName()" );
  name = null;
  
  
  try {      // for error handling
    token = LT(1);
    match(SAFEUTF8STRING);
    
    name = new DN( token.getText() );
    if ( oidsMap != null )
    {
    name.normalize( oidsMap );
    }
    log.debug( "recognized a DistinguishedName: " + token.getText() );
    
  }
  catch (Exception e) {
    
    throw new RecognitionException( "dnParser failed for " + token.getText() + " " + e.getMessage() );
    
  }
  return name ;
}

代码示例来源:origin: org.apache.directory.shared/shared-ldap

/**
 * {@inheritDoc}
 */
public Value<?> normalize( Value<?> value ) throws LdapException
{
  DN dn = null;
  
  String dnStr = value.getString();
  
  dn = new DN( dnStr );
  
  dn.normalize( schemaManager.getNormalizerMapping() );
  return new StringValue( dn.getNormName() );
}

代码示例来源:origin: org.apache.directory.shared/shared-ldap

name.normalize( oidsMap );

代码示例来源:origin: org.apache.directory.shared/shared-ldap

dn.normalize( schemaManager.getNormalizerMapping() );

代码示例来源:origin: org.apache.directory.shared/shared-ldap

attributeTypeAndValueSetAsDn.normalize( oidsMap );

代码示例来源:origin: dwimberger/crowd-ldap-server

crowdDN.normalize(
  m_SchemaManager.getRegistries().getAttributeTypeRegistry()
    .getNormalizerMapping()

代码示例来源:origin: org.apache.directory.server/apacheds-avl-partition

/**
 * {@inheritDoc}
 * TODO why this and initRegistries on Store interface ???
 */
public void init( SchemaManager schemaManager ) throws Exception
{
  this.schemaManager = schemaManager;
  OBJECT_CLASS_AT = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.OBJECT_CLASS_AT );
  ALIASED_OBJECT_NAME_AT = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.ALIASED_OBJECT_NAME_AT );
  // Create the master table (the table containing all the entries)
  master = new AvlMasterTable<ServerEntry>( name, new LongComparator(), null, false );
  suffixDn.normalize( schemaManager.getNormalizerMapping() );
  // -------------------------------------------------------------------
  // Initializes the user and system indices
  // -------------------------------------------------------------------
  setupSystemIndices();
  setupUserIndices();
  // We are done !
  initialized = true;
}

代码示例来源:origin: org.apache.directory.server/apacheds-avl-partition

suffix.normalize( schemaManager.getNormalizerMapping() );
store.setSuffixDn( suffix.getName() );

代码示例来源:origin: org.apache.directory.shared/shared-ldap

dn.normalize( schemaManager.getNormalizerMapping() );

代码示例来源:origin: dwimberger/crowd-ldap-server

DN prefix = dn.getPrefix(2);
try {
 prefix.normalize(m_SchemaManager.getNormalizerMapping());
} catch (Exception ex) {
 log.error("hasEntry()", ex);

代码示例来源:origin: org.apache.directory.server/apacheds-xdbm-tools

suffixDn.normalize( schemaManager.getNormalizerMapping() );
dn.normalize( schemaManager.getNormalizerMapping() );
entry = new DefaultServerEntry( schemaManager, dn );
entry.add( "objectClass", "top", "organizationalUnit" );
dn.normalize( schemaManager.getNormalizerMapping() );
entry = new DefaultServerEntry( schemaManager, dn );
entry.add( "objectClass", "top", "organizationalUnit" );
dn.normalize( schemaManager.getNormalizerMapping() );
entry = new DefaultServerEntry( schemaManager, dn );
entry.add( "objectClass", "top", "organizationalUnit" );
dn.normalize( schemaManager.getNormalizerMapping() );
entry = new DefaultServerEntry( schemaManager, dn );
entry.add( "objectClass", "top", "person", "organizationalPerson" );
dn.normalize( schemaManager.getNormalizerMapping() );
entry = new DefaultServerEntry( schemaManager, dn );
entry.add( "objectClass", "top", "person", "organizationalPerson" );
dn.normalize( schemaManager.getNormalizerMapping() );
entry = new DefaultServerEntry( schemaManager, dn );
entry.add( "objectClass", "top", "organizationalUnit" );
dn.normalize( schemaManager.getNormalizerMapping() );
entry = new DefaultServerEntry( schemaManager, dn );
entry.add( "objectClass", "top", "person", "organizationalPerson" );

代码示例来源:origin: org.apache.directory.server/apacheds-avl-partition

normalizedAliasTargetDn.normalize( schemaManager.getNormalizerMapping() );

代码示例来源:origin: org.apache.directory.server/apacheds-avl-partition

updn.normalize( schemaManager.getNormalizerMapping() );
rdnDN.normalize( schemaManager.getNormalizerMapping() );
childUpdn.add( rdnDN.getRdn() );

代码示例来源:origin: org.apache.directory.server/apacheds-avl-partition

newUpdn.normalize( schemaManager.getNormalizerMapping() );

相关文章