/** * Get the matched DN * * @return Returns the matchedDN. */ public String getMatchedDN() { return ( ( matchedDN == null ) ? "" : matchedDN.getNormName() ); }
/** * {@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; }
public void modify( DN dn, List<Modification> mods ) throws Exception { Long id = getEntryId( dn.getNormName() ); modify( id, mods ); }
/** * 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() ); }
public boolean hasEntry( EntryOperationContext opContext ) throws Exception { return null != getEntryId( opContext.getDn().getNormName() ); }
sb.append( " Version : '" ).append( isVersion3 ? "3" : "2" ).append( "'\n" ); if ( StringTools.isEmpty( name.getNormName() ) && isSimple )
/** * {@inheritDoc} */ public String normalize( String value ) throws LdapException { DN dn = null; dn = new DN( value ); dn.normalize( schemaManager.getNormalizerMapping() ); return dn.getNormName(); }
/** * 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(); }
return dn.getNormName() + '#' + uid; return new DN( value ).normalize( schemaManager.getNormalizerMapping() ).getNormName();
/** * {@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() ); }
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 ); }
Long movedBaseId = getEntryId( movedBase.getNormName() );
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 ); }
public EntryFilteringCursor list( ListOperationContext opContext ) throws Exception { return new BaseEntryFilteringCursor( new ServerEntryCursorAdaptor<ID>( this, list( getEntryId( opContext .getDn().getNormName() ) ) ), opContext ); }
if ( null == partition.getEntryId( ndn.getNormName() ) )
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; }
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 ); }
Long ancestorId = getEntryId( ancestorDn.getNormName() ); ancestorId = getEntryId( ancestorDn.getNormName() );
/** * {@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; }
/** * {@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 ); }