本文整理了Java中org.apache.directory.shared.ldap.name.DN.getNormName()
方法的一些代码示例,展示了DN.getNormName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DN.getNormName()
方法的具体详情如下:
包路径:org.apache.directory.shared.ldap.name.DN
类名称:DN
方法名:getNormName
[英]Get the normalized DN
[中]获取规范化的DN
代码示例来源:origin: org.apache.directory.shared/shared-ldap
/**
* Get the matched DN
*
* @return Returns the matchedDN.
*/
public String getMatchedDN()
{
return ( ( matchedDN == null ) ? "" : matchedDN.getNormName() );
}
代码示例来源:origin: org.apache.directory.server/apacheds-avl-partition
/**
* {@inheritDoc}
*/
public DN getSuffix()
{
if ( suffixDn == null )
{
return null;
}
try
{
return new DN( suffixDn.getNormName() );
}
catch ( LdapInvalidDnException e )
{
// shouldn't happen
LOG.error( "", e );
}
return null;
}
代码示例来源:origin: org.apache.directory.server/apacheds-avl-partition
public void modify( DN dn, List<Modification> mods ) throws Exception
{
Long id = getEntryId( dn.getNormName() );
modify( id, mods );
}
代码示例来源:origin: org.apache.directory.shared/shared-ldap
/**
* Get a String representation of a BindRequest
*
* @return A BindRequest String
*/
public String toString()
{
StringBuilder sb = new StringBuilder();
sb.append( " BindRequest\n" );
sb.append( " Version : '" ).append( version ).append( "'\n" );
if ( ( null == name ) || StringTools.isEmpty( name.getNormName() ) )
{
sb.append( " Name : anonymous" );
}
else
{
sb.append( " Name : '" ).append( name ).append( "'\n" );
if ( authentication instanceof SimpleAuthentication )
{
sb.append( " Simple authentication : '" ).append( authentication ).append( '\'' );
}
else
{
sb.append( authentication );
}
}
return toString( sb.toString() );
}
代码示例来源:origin: org.apache.directory.server/apacheds-xdbm-base
public boolean hasEntry( EntryOperationContext opContext ) throws Exception
{
return null != getEntryId( opContext.getDn().getNormName() );
}
代码示例来源:origin: org.apache.directory.shared/shared-ldap
sb.append( " Version : '" ).append( isVersion3 ? "3" : "2" ).append( "'\n" );
if ( StringTools.isEmpty( name.getNormName() ) && isSimple )
代码示例来源: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
/**
* 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
return dn.getNormName() + '#' + uid;
return new DN( value ).normalize( schemaManager.getNormalizerMapping() ).getNormName();
代码示例来源: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.server/apacheds-avl-partition
public void move( DN oldChildDn, DN newParentDn ) throws Exception
{
Long childId = getEntryId( oldChildDn.getNormName() );
DN newUpdn = move( oldChildDn, childId, newParentDn );
// Update the current entry
ServerEntry entry = lookup( childId );
entry.setDn( newUpdn );
master.put( childId, entry );
}
代码示例来源:origin: org.apache.directory.server/apacheds-avl-partition
Long movedBaseId = getEntryId( movedBase.getNormName() );
代码示例来源:origin: org.apache.directory.server/apacheds-avl-partition
public void move( DN oldChildDn, DN newParentDn, RDN newRdn, boolean deleteOldRdn ) throws Exception
{
Long childId = getEntryId( oldChildDn.getNormName() );
rename( oldChildDn, newRdn, deleteOldRdn );
DN newUpdn = move( oldChildDn, childId, newParentDn );
// Update the current entry
ServerEntry entry = lookup( childId );
entry.setDn( newUpdn );
master.put( childId, entry );
}
代码示例来源:origin: org.apache.directory.server/apacheds-xdbm-base
public EntryFilteringCursor list( ListOperationContext opContext ) throws Exception
{
return new BaseEntryFilteringCursor( new ServerEntryCursorAdaptor<ID>( this, list( getEntryId( opContext
.getDn().getNormName() ) ) ), opContext );
}
代码示例来源:origin: org.apache.directory.server/apacheds-xdbm-tools
if ( null == partition.getEntryId( ndn.getNormName() ) )
代码示例来源:origin: org.apache.directory.server/apacheds-xdbm-base
public ClonedServerEntry lookup( LookupOperationContext opContext ) throws Exception
{
ID id = getEntryId( opContext.getDn().getNormName() );
if ( id == null )
{
return null;
}
ClonedServerEntry entry = lookup( id );
if ( ( opContext.getAttrsId() == null ) || ( opContext.getAttrsId().size() == 0 ) )
{
return entry;
}
for ( AttributeType attributeType : ( ( ServerEntry ) entry.getOriginalEntry() ).getAttributeTypes() )
{
if ( !opContext.getAttrsId().contains( attributeType.getOid() ) )
{
entry.removeAttributes( attributeType );
}
}
return entry;
}
代码示例来源:origin: org.apache.directory.server/apacheds-avl-partition
public void modify( DN dn, ModificationOperation modOp, ServerEntry mods ) throws Exception
{
if ( mods instanceof ClonedServerEntry )
{
throw new Exception( I18n.err( I18n.ERR_215 ) );
}
Long id = getEntryId( dn.getNormName() );
ServerEntry entry = ( ServerEntry ) master.get( id );
for ( AttributeType attributeType : mods.getAttributeTypes() )
{
EntryAttribute attr = mods.get( attributeType );
switch ( modOp )
{
case ADD_ATTRIBUTE:
add( id, entry, attr );
break;
case REMOVE_ATTRIBUTE:
remove( id, entry, attr );
break;
case REPLACE_ATTRIBUTE:
replace( id, entry, attr );
break;
default:
throw new Exception( I18n.err( I18n.ERR_221 ) );
}
}
master.put( id, entry );
}
代码示例来源:origin: org.apache.directory.server/apacheds-avl-partition
Long ancestorId = getEntryId( ancestorDn.getNormName() );
ancestorId = getEntryId( ancestorDn.getNormName() );
代码示例来源:origin: org.apache.directory.shared/shared-ldap
/**
* {@inheritDoc}
*/
public DN addAll( int posn, DN dn ) throws LdapInvalidDnException
{
if ( ( dn == null ) || ( dn.size() == 0 ) )
{
return this;
}
// Concatenate the rdns
rdns.addAll( size() - posn, dn.rdns );
// Regenerate the normalized name and the original string
if ( this.isNormalized() && dn.isNormalized() )
{
if ( this.size() != 0 )
{
normName = dn.getNormName() + "," + normName;
bytes = StringTools.getBytesUtf8( normName );
upName = dn.getName() + "," + upName;
}
}
else
{
normalizeInternal();
toUpName();
}
return this;
}
代码示例来源:origin: org.apache.directory.server/apacheds-xdbm-base
/**
* {@inheritDoc}
*/
public void delete( DeleteOperationContext opContext ) throws Exception
{
DN dn = opContext.getDn();
ID id = getEntryId( dn.getNormName() );
// don't continue if id is null
if ( id == null )
{
throw new LdapNoSuchObjectException( I18n.err( I18n.ERR_699, dn ) );
}
if ( getChildCount( id ) > 0 )
{
LdapContextNotEmptyException cnee = new LdapContextNotEmptyException( I18n.err( I18n.ERR_700, dn ) );
//cnee.setRemainingName( dn );
throw cnee;
}
delete( id );
}
内容来源于网络,如有侵权,请联系作者删除!