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

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


            else if ( isSublevelScope )
            {
                List<EntryFilteringCursor> cursors = new ArrayList<EntryFilteringCursor>();
                for ( Partition p : partitions.values() )
                {
                    ClonedServerEntry entry = p.lookup( new LookupOperationContext( directoryService.getAdminSession(), p.getSuffixDn() ) );
                    if( entry != null )
                    {
                        Partition backend = getPartition( entry.getDn() );
                        opContext.setDn( entry.getDn() );
                        cursors.add( backend.search( opContext ) );
                    }
                }
               
                // don't feed the above Cursors' list to a BaseEntryFilteringCursor it is skipping the naming context entry of each partition
View Full Code Here


    /* (non-Javadoc)
     * @see org.apache.directory.server.core.partition.PartitionNexus#getRootDSE(org.apache.directory.server.core.interceptor.context.GetRootDSEOperationContext)
     */
    public ClonedServerEntry getRootDSE( GetRootDSEOperationContext getRootDSEContext )
    {
        return new ClonedServerEntry( rootDSE );
    }
View Full Code Here

            throw e;
        }
       
        CertGenerationObject certGenObj = container.getCertGenerationObject();
       
        ClonedServerEntry entry = session.getCoreSession().lookup( new DN( certGenObj.getTargetDN() ) );
        if( entry != null )
        {
            TlsKeyGenerator.addKeyPair( entry.getOriginalEntry(), certGenObj.getIssuerDN(), certGenObj.getSubjectDN(), certGenObj.getKeyAlgorithm() );
        }
    }
View Full Code Here

    public void handleExtendedOperation( LdapSession session, InternalExtendedRequest req ) throws Exception
    {
        StoredProcedure spBean = decodeBean( req.getPayload() );
       
        String procedure = StringTools.utf8ToString( spBean.getProcedure() );
        ClonedServerEntry spUnit = manager.findStoredProcUnit( session.getCoreSession(), procedure );
        StoredProcEngine engine = manager.getStoredProcEngineInstance( spUnit );
       
        List<Object> valueList = new ArrayList<Object>( spBean.getParameters().size() );
       
        for ( StoredProcedureParameter pPojo:spBean.getParameters() )
View Full Code Here

                    LOG.error( I18n.err( I18n.ERR_167 ) );
                }
                else
                {
                    hasRootDSE = true;
                    ClonedServerEntry entry = cursor.get();
                    session.getIoSession().write( generateResponse( session, req, entry ) );
                }
            }
   
            // write the SearchResultDone message
View Full Code Here

                LOG.debug( "Request terminated by an AbandonRequest for message {}",
                    req.getMessageId() );
                break;
            }
           
            ClonedServerEntry entry = cursor.get();
            session.getIoSession().write( generateResponse( session, req, entry ) );
            LOG.debug( "Sending {}", entry.getDn() );
            count++;
        }
       
        // DO NOT WRITE THE RESPONSE - JUST RETURN IT
        ldapResult.setResultCode( ResultCodeEnum.SUCCESS );
View Full Code Here

            if ( session.getIoSession().isClosing() )
            {
                break;
            }
           
            ClonedServerEntry entry = cursor.get();
            session.getIoSession().write( generateResponse( session, req, entry ) );
            count++;
            pageCount++;
        }
       
View Full Code Here

     * Handles processing with referrals without ManageDsaIT control.
     */
    public void handleWithReferrals( LdapSession session, DN reqTargetDn, InternalSearchRequest req ) throws NamingException
    {
        InternalLdapResult result = req.getResultResponse().getLdapResult();
        ClonedServerEntry entry = null;
        boolean isReferral = false;
        boolean isparentReferral = false;
        ReferralManager referralManager = session.getCoreSession().getDirectoryService().getReferralManager();
       
        reqTargetDn.normalize( session.getCoreSession().getDirectoryService().
            getSchemaManager().getNormalizerMapping() );
       
        // Check if the entry itself is a referral
        referralManager.lockRead();
       
        isReferral = referralManager.isReferral( reqTargetDn );
       
        if ( !isReferral )
        {
            // Check if the entry has a parent which is a referral
            isparentReferral = referralManager.hasParentReferral( reqTargetDn );
        }
       
        referralManager.unlock();
       
        if ( !isReferral && !isparentReferral )
        {
            // This is not a referral and it does not have a parent which
            // is a referral : standard case, just deal with the request
            LOG.debug( "Entry {} is NOT a referral.", reqTargetDn );
            handleIgnoringReferrals( session, req );
            return;
        }
        else
        {
            // -------------------------------------------------------------------
            // Lookup Entry
            // -------------------------------------------------------------------
           
            // try to lookup the entry but ignore exceptions when it does not  
            // exist since entry may not exist but may have an ancestor that is a
            // referral - would rather attempt a lookup that fails then do check
            // for existence than have to do another lookup to get entry info
            try
            {
                entry = session.getCoreSession().lookup( reqTargetDn );
                LOG.debug( "Entry for {} was found: ", reqTargetDn, entry );
            }
            catch ( NameNotFoundException e )
            {
                /* ignore */
                LOG.debug( "Entry for {} not found.", reqTargetDn );
            }
            catch ( Exception e )
            {
                /* serious and needs handling */
                handleException( session, req, e );
                return;
            }
           
            // -------------------------------------------------------------------
            // Handle Existing Entry
            // -------------------------------------------------------------------
           
            if ( entry != null )
            {
                try
                {
                    LOG.debug( "Entry is a referral: {}", entry );
                   
                    handleReferralEntryForSearch( session, ( InternalSearchRequest ) req, entry );

                    return;
                }
                catch ( Exception e )
                {
                    handleException( session, req, e );
                }
            }
   
            // -------------------------------------------------------------------
            // Handle Non-existing Entry
            // -------------------------------------------------------------------
           
            // if the entry is null we still have to check for a referral ancestor
            // also the referrals need to be adjusted based on the ancestor's ref
            // values to yield the correct path to the entry in the target DSAs
           
            else
            {
                // The entry is null : it has a parent referral.
                ClonedServerEntry referralAncestor = null;
   
                try
                {
                    referralAncestor = getFarthestReferralAncestor( session, reqTargetDn );
                }
View Full Code Here

        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;
    }
View Full Code Here

        Long id = getEntryId( modifyContext.getDn().getNormName() );

        wrappedPartition.modify( id, modifyContext.getModItems() );

        // Get the modified entry and store it in the context for post usage
        ClonedServerEntry modifiedEntry = lookup( id );
        modifyContext.setAlteredEntry( modifiedEntry );

        // just overwrite the existing file
        DN dn = modifyContext.getDn();
View Full Code Here

TOP

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

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.