Package org.apache.directory.server.core.api.interceptor

Examples of org.apache.directory.server.core.api.interceptor.Interceptor


    /**
     * Remove an interceptor to the list of interceptors to call for each operation
     */
    private void removeOperationsList( String interceptorName )
    {
        Interceptor interceptor = interceptorNames.get( interceptorName );

        writeLock.lock();

        try
        {
            for ( OperationEnum operation : OperationEnum.getOperations() )
            {
                List<String> operationList = operationInterceptors.get( operation );

                Method[] methods = interceptor.getClass().getDeclaredMethods();

                for ( Method method : methods )
                {
                    if ( method.getName().equals( operation.getMethodName() ) )
                    {
                        operationList.remove( interceptor.getName() );

                        break;
                    }
                }
            }
View Full Code Here


     * op2 -> [B, C, E]<br/>
     * then assuming that we have stopped at D, then op1.next -> F and op2.next -> E.
     */
    private Interceptor findNextInterceptor( OperationEnum operation, DirectoryService directoryService )
    {
        Interceptor interceptor = null;

        List<Interceptor> allInterceptors = directoryService.getInterceptors();
        List<String> operationInterceptors = directoryService.getInterceptors( operation );
        int position = 0;
        String addInterceptor = operationInterceptors.get( position );
View Full Code Here

        DirectoryService directoryService = modifyContext.getSession().getDirectoryService();

        // Compute the next interceptor for the Add and Delete operation, starting from
        // the schemaInterceptor. We also need to get the position of this next interceptor
        // in the operation's list.
        Interceptor nextAdd = findNextInterceptor( OperationEnum.ADD, directoryService );
        int positionAdd = findPosition( OperationEnum.ADD, nextAdd, directoryService );
        Interceptor nextDelete = findNextInterceptor( OperationEnum.DELETE, directoryService );
        int positionDelete = findPosition( OperationEnum.DELETE, nextDelete, directoryService );

        for ( Modification mod : modifyContext.getModItems() )
        {
            String opAttrOid = schemaManager.getAttributeTypeRegistry().getOidByName( mod.getAttribute().getId() );
View Full Code Here

    {
        try
        {
            // Inject the interceptor that waits 1 second when binding
            // in order to be able to send a request before we get the response
            Interceptor interceptor = new BaseInterceptor( "test" )
            {
                /**
                 * Wait 1 second before going any further
                 */
                public void bind( BindOperationContext bindContext ) throws LdapException
View Full Code Here

        {
            try
            {
                LOG.debug( "loading the interceptor class {} and instantiating",
                    interceptorBean.getInterceptorClassName() );
                Interceptor interceptor = ( Interceptor ) Class.forName( interceptorBean.getInterceptorClassName() )
                    .newInstance();

                if ( interceptorBean instanceof AuthenticationInterceptorBean )
                {
                    // Transports
View Full Code Here

            // Unlock the referral manager
            directoryService.getReferralManager().unlock();
        }
           
        // Call the Add method
        Interceptor head = directoryService.getInterceptor( addContext.getNextInterceptor() );

        lockWrite();

        try
        {
            head.add( addContext );
        }
        finally
        {
            unlockWrite();
        }
View Full Code Here

        }

        ensureStarted();

        // Call the Delete method
        Interceptor head = directoryService.getInterceptor( bindContext.getNextInterceptor() );

        lockRead();

        try
        {
            head.bind( bindContext );
        }
        finally
        {
            unlockRead();
        }
View Full Code Here

        // populate the context with the old entry
        compareContext.setOriginalEntry( getOriginalEntry( compareContext ) );

        // Call the Compare method
        Interceptor head = directoryService.getInterceptor( compareContext.getNextInterceptor() );

        boolean result = false;

        lockRead();

        try
        {
            result = head.compare( compareContext );
        }
        finally
        {
            unlockRead();
        }
View Full Code Here

        try
        {
            eagerlyPopulateFields( deleteContext );

            // Call the Delete method
            Interceptor head = directoryService.getInterceptor( deleteContext.getNextInterceptor() );

            head.delete( deleteContext );
        }
        finally
        {
            unlockWrite();
        }
View Full Code Here

            LOG.debug( ">> GetRootDseOperation : {}", getRootDseContext );
        }

        ensureStarted();

        Interceptor head = directoryService.getInterceptor( getRootDseContext.getNextInterceptor() );

        Entry root = head.getRootDse( getRootDseContext );

        if ( IS_DEBUG )
        {
            LOG.debug( "<< getRootDseOperation successful" );
        }
View Full Code Here

TOP

Related Classes of org.apache.directory.server.core.api.interceptor.Interceptor

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.