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