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


Java LdifEntry.getDn方法代码示例

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


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

示例1: anonymizeChangeDelete

import org.apache.directory.api.ldap.model.ldif.LdifEntry; //导入方法依赖的package包/类
/**
 * Anonymize a Delete change
 */
private LdifEntry anonymizeChangeDelete( LdifEntry ldifEntry ) throws LdapException
{
    Dn entryDn = ldifEntry.getDn();

    // Process the DN, there is nothing more in the entry
    Dn anonymizedDn = anonymizeDn( entryDn );
    
    ldifEntry.setDn( anonymizedDn );
    
    return ldifEntry;
}
 
开发者ID:apache,项目名称:directory-ldap-api,代码行数:15,代码来源:LdifAnonymizer.java

示例2: anonymizeChangeModDn

import org.apache.directory.api.ldap.model.ldif.LdifEntry; //导入方法依赖的package包/类
/**
 * Anonymize a Delete change
 */
private LdifEntry anonymizeChangeModDn( LdifEntry ldifEntry ) throws LdapException
{
    Dn entryDn = ldifEntry.getDn();

    // Process the DN
    Dn anonymizedDn = anonymizeDn( entryDn );
    
    ldifEntry.setDn( anonymizedDn );
    
    // Anonymize the newRdn if any
    String newRdnStr = ldifEntry.getNewRdn();
    
    if ( newRdnStr != null )
    {
        Dn newRdn = new Dn( schemaManager, newRdnStr );
        Dn anonymizedRdn = anonymizeDn( newRdn );
        
        ldifEntry.setNewRdn( anonymizedRdn.toString() );
    }
    
    // Anonymize the neSuperior if any
    String newSuperiorStr = ldifEntry.getNewSuperior();
    
    if ( newSuperiorStr != null )
    {
        Dn newSuperior = new Dn( schemaManager, newSuperiorStr );
        
        Dn anonymizedSuperior = anonymizeDn( newSuperior );
        
        ldifEntry.setNewSuperior( anonymizedSuperior.toString() );
    }

    return ldifEntry;
}
 
开发者ID:apache,项目名称:directory-ldap-api,代码行数:38,代码来源:LdifAnonymizer.java

示例3: checkPartition

import org.apache.directory.api.ldap.model.ldif.LdifEntry; //导入方法依赖的package包/类
private void checkPartition(LdifEntry ldifEntry) throws Exception {
    Dn dn = ldifEntry.getDn();
    Dn parent = dn.getParent();
    try {
        directoryService.getAdminSession().exists(parent);
    } catch (Exception e) {
        System.out.println("Creating new partition for DN=" + dn + "\n");
        AvlPartition partition = new AvlPartition(directoryService.getSchemaManager());
        partition.setId(dn.getName());
        partition.setSuffixDn(dn);
        directoryService.addPartition(partition);
    }
}
 
开发者ID:kawasima,项目名称:bouncr,代码行数:14,代码来源:LdapStandaloneServer.java

示例4: anonymizeChangeAdd

import org.apache.directory.api.ldap.model.ldif.LdifEntry; //导入方法依赖的package包/类
/**
 * Anonymize a Add change
 */
private LdifEntry anonymizeChangeAdd( LdifEntry ldifEntry ) throws LdapException
{
    Dn entryDn = ldifEntry.getDn();
    LdifEntry newLdifEntry = new LdifEntry( schemaManager );
    newLdifEntry.setChangeType( ChangeType.Add );

    // Process the DN first
    Dn anonymizedDn = anonymizeDn( entryDn );
    
    newLdifEntry.setDn( anonymizedDn );
    
    // Now, process the entry's attributes
    for ( Attribute attribute : ldifEntry )
    {
        AttributeType attributeType = attribute.getAttributeType();
        Attribute anonymizedAttribute = new DefaultAttribute( attributeType );
        
        // Deal with the special case of a DN syntax
        
        if ( attributeType.getSyntax().getSyntaxChecker() instanceof DnSyntaxChecker )
        {
            for ( Value dnValue : attribute )
            {
                Dn dn = new Dn( schemaManager, dnValue.getValue() );
                Dn newdDn = anonymizeDn( dn );
                anonymizedAttribute.add( newdDn.toString() );
            }
            
            newLdifEntry.addAttribute( attribute );
        }
        else
        {
            Anonymizer anonymizer = attributeAnonymizers.get( attribute.getAttributeType().getOid() );

            if ( anonymizer == null )
            {
                newLdifEntry.addAttribute( attribute );
            }
            else
            {
                anonymizedAttribute = anonymizer.anonymize( valueMap, valueSet, attribute );
                
                if ( anonymizedAttribute != null )
                {
                    newLdifEntry.addAttribute( anonymizedAttribute );
                }
            }
        }
    }

    return newLdifEntry;
}
 
开发者ID:apache,项目名称:directory-ldap-api,代码行数:56,代码来源:LdifAnonymizer.java


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