Package org.apache.directory.server.core.entry

Examples of org.apache.directory.server.core.entry.ServerEntry


        if ( idx != null )
        {
            return idx.reverseLessOrEq( indexEntry.getId(), node.getValue().get() );
        }

        ServerEntry entry = indexEntry.getObject();

        // resuscitate the entry if it has not been and set entry in IndexEntry
        if ( null == entry )
        {
            entry = db.lookup( indexEntry.getId() );
            indexEntry.setObject( entry );
        }

        if ( null == entry )
        {
            return false;
        }

        // get the attribute
        ServerAttribute attr = ( ServerAttribute ) entry.get( type );

        // if the attribute does not exist just return false
        //noinspection unchecked
        if ( attr != null && evaluate( ( IndexEntry<Object, ServerEntry, ID> ) indexEntry, attr ) )
        {
            return true;
        }

        // If we do not have the attribute, loop through the sub classes of
        // the attributeType.  Perhaps the entry has an attribute value of a
        // subtype (descendant) that will produce a match
        if ( schemaManager.getAttributeTypeRegistry().hasDescendants( node.getAttribute() ) )
        {
            // TODO check to see if descendant handling is necessary for the
            // index so we can match properly even when for example a name
            // attribute is used instead of more specific commonName
            Iterator<AttributeType> descendants = schemaManager.getAttributeTypeRegistry().descendants(
                node.getAttribute() );

            while ( descendants.hasNext() )
            {
                AttributeType descendant = descendants.next();

                attr = ( ServerAttribute ) entry.get( descendant );

                //noinspection unchecked
                if ( attr != null && evaluate( ( IndexEntry<Object, ServerEntry, ID> ) indexEntry, attr ) )
                {
                    return true;
View Full Code Here


     * entryAlreadyExists error.
     * 
     */
    public void add( NextInterceptor next, AddOperationContext opContext ) throws Exception
    {
        ServerEntry entry = opContext.getEntry();
       
        // Check if the entry is a referral itself
        boolean isReferral = isReferral( entry );

        // We add the entry into the server
View Full Code Here

     *
     * If the entry does not exist in the server, we will get a NoSuchObject error
     */
    public void delete( NextInterceptor next, DeleteOperationContext opContext ) throws Exception
    {
        ServerEntry entry = opContext.getEntry();

        // First delete the entry into the server
        next.delete( opContext );
       
        // Check if the entry exists and is a referral itself
View Full Code Here

        if ( isReferral )
        {
            // Update the referralManager
            LookupOperationContext lookupContext = new LookupOperationContext( opContext.getSession(), newName );
           
            ServerEntry newEntry = nexus.lookup( lookupContext );
           
            referralManager.lockWrite();
           
            referralManager.addReferral( newEntry );
            referralManager.removeReferral( opContext.getEntry() );
View Full Code Here

        if ( isReferral )
        {
            // Update the referralManager
            LookupOperationContext lookupContext = new LookupOperationContext( opContext.getSession(), newName );
           
            ServerEntry newEntry = nexus.lookup( lookupContext );
           
            referralManager.lockWrite();
           
            referralManager.addReferral( newEntry );
            referralManager.removeReferral( opContext.getEntry() );
View Full Code Here

        if ( isReferral )
        {
            // Update the referralManager
            LookupOperationContext lookupContext = new LookupOperationContext( opContext.getSession(), opContext.getNewDn() );
           
            ServerEntry newEntry = nexus.lookup( lookupContext );
           
            referralManager.lockWrite();
           
            referralManager.addReferral( newEntry );
            referralManager.removeReferral( opContext.getEntry().getOriginalEntry() );
View Full Code Here

        // as it has been modified, before updating the ReferralManager
        // TODO: this can be spare, as we build the entry later.
        // But we will have to store the modified entry into the opContext
        LookupOperationContext lookupContext = new LookupOperationContext( opContext.getSession(), name );
       
        ServerEntry newEntry = nexus.lookup( lookupContext );

        // Check that we have the entry, just in case
        // TODO : entries should be locked until the operation is done on it.
        if ( newEntry != null )
        {
            referralManager.lockWrite();

            if ( referralManager.isReferral( newEntry.getDn() ) )
            {
                referralManager.removeReferral( opContext.getEntry() );
                referralManager.addReferral( newEntry );
            }
           
View Full Code Here

            // We have to deal with the referral first
            directoryService.getReferralManager().lockRead();

            if ( directoryService.getReferralManager().hasParentReferral( dn ) )
            {
                ServerEntry parentEntry = directoryService.getReferralManager().getParentReferral( dn );
                DN childDn = (DN)dn.getSuffix( parentEntry.getDn().size() );

                // Depending on the Context.REFERRAL property value, we will throw
                // a different exception.
                if ( opContext.isReferralIgnored() )
                {
View Full Code Here

        if ( idx != null )
        {
            return idx.forward( node.getValue().get(), indexEntry.getId() );
        }

        ServerEntry entry = indexEntry.getObject();

        // resuscitate the entry if it has not been and set entry in IndexEntry
        if ( null == entry )
        {
            entry = db.lookup( indexEntry.getId() );
View Full Code Here

            // We have to deal with the referral first
            directoryService.getReferralManager().lockRead();

            // Check if we have an ancestor for this DN
            ServerEntry parentEntry = directoryService.getReferralManager().getParentReferral( dn );
           
            if ( parentEntry != null )
            {
                // We have found a parent referral for the current DN
                DN childDn = (DN)dn.getSuffix( parentEntry.getDn().size() );
   
                if ( directoryService.getReferralManager().isReferral( dn ) )
                {
                    // This is a referral. We can delete it if the ManageDsaIt flag is true
                    // Otherwise, we just throw a LdapReferralException
View Full Code Here

TOP

Related Classes of org.apache.directory.server.core.entry.ServerEntry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.