Package org.apache.ldap.server.invocation

Examples of org.apache.ldap.server.invocation.Invocation


    public static final SearchControls DEFUALT_SEARCH_CONTROLS = new SearchControls();

    public NamingEnumeration list( NextInterceptor next, Name base ) throws NamingException
    {
        Invocation invocation = InvocationStack.getInstance().peek();
        ServerLdapContext ctx = ( ServerLdapContext ) invocation.getCaller();
        LdapPrincipal user = ctx.getPrincipal();
        NamingEnumeration e = next.list( base );
        if ( user.getName().equalsIgnoreCase( DirectoryPartitionNexus.ADMIN_PRINCIPAL ) || ! enabled )
        {
            return e;
View Full Code Here



    public NamingEnumeration search( NextInterceptor next, Name base, Map env, ExprNode filter,
                                     SearchControls searchCtls ) throws NamingException
    {
        Invocation invocation = InvocationStack.getInstance().peek();
        ServerLdapContext ctx = ( ServerLdapContext ) invocation.getCaller();
        LdapPrincipal user = ctx.getPrincipal();
        NamingEnumeration e = next.search( base, env, filter, searchCtls );
        if ( user.getName().equalsIgnoreCase( DirectoryPartitionNexus.ADMIN_PRINCIPAL ) || ! enabled )
        {
            return e;
View Full Code Here


    public boolean compare( NextInterceptor next, Name name, String oid, Object value ) throws NamingException
    {
        // Access the principal requesting the operation, and bypass checks if it is the admin
        Invocation invocation = InvocationStack.getInstance().peek();
        DirectoryPartitionNexusProxy proxy = invocation.getProxy();
        Attributes entry = proxy.lookup( name, DirectoryPartitionNexusProxy.LOOKUP_BYPASS );
        LdapPrincipal user = ( ( ServerContext ) invocation.getCaller() ).getPrincipal();
        if ( user.getName().equalsIgnoreCase( DirectoryPartitionNexus.ADMIN_PRINCIPAL ) || ! enabled )
        {
            return next.compare( name, oid, value );
        }
View Full Code Here


    public Name getMatchedName( NextInterceptor next, Name dn, boolean normalized ) throws NamingException
    {
        // Access the principal requesting the operation, and bypass checks if it is the admin
        Invocation invocation = InvocationStack.getInstance().peek();
        DirectoryPartitionNexusProxy proxy = invocation.getProxy();
        LdapPrincipal user = ( ( ServerContext ) invocation.getCaller() ).getPrincipal();
        if ( user.getName().equalsIgnoreCase( DirectoryPartitionNexus.ADMIN_PRINCIPAL ) || ! enabled )
        {
            return next.getMatchedName( dn, normalized );
        }
View Full Code Here

        if ( InvocationStack.getInstance().isEmpty() )
        {
            return head;
        }

        Invocation invocation = InvocationStack.getInstance().peek();
        if ( ! invocation.hasBypass() )
        {
            return head;
        }

        if ( invocation.isBypassed( DirectoryPartitionNexusProxy.BYPASS_ALL ) )
        {
            return tail;
        }

        Entry next = head;
        while ( next != tail )
        {
            if ( invocation.isBypassed( next.configuration.getName() ) )
            {
                next = next.nextEntry;
            }
            else
            {
View Full Code Here

                    if ( InvocationStack.getInstance().isEmpty() )
                    {
                        return Entry.this.nextEntry;
                    }

                    Invocation invocation = InvocationStack.getInstance().peek();
                    if ( ! invocation.hasBypass() )
                    {
                        return Entry.this.nextEntry;
                    }

//  I don't think we really need this since this check is performed by the chain when
//  getting the interceptor head to use.
//
//                    if ( invocation.isBypassed( DirectoryPartitionNexusProxy.BYPASS_ALL ) )
//                    {
//                        return tail;
//                    }

                    Entry next = Entry.this.nextEntry;
                    while ( next != tail )
                    {
                        if ( invocation.isBypassed( next.configuration.getName() ) )
                        {
                            next = next.nextEntry;
                        }
                        else
                        {
View Full Code Here

        //if ( searchCtls.getReturningAttributes() != null )
        //{
        //    return null;
        //}
       
        Invocation invocation = InvocationStack.getInstance().peek();
        return new SearchResultFilteringEnumeration( e, searchCtls, invocation,
            new SearchResultFilter()
            {
                public boolean accept( Invocation invocation, SearchResult result, SearchControls controls )
                        throws NamingException
View Full Code Here

        if ( !enabled )
        {
            return e;
        }

        Invocation invocation = InvocationStack.getInstance().peek();
        return new SearchResultFilteringEnumeration( e, null, invocation,
            new SearchResultFilter()
            {
                public boolean accept( Invocation invocation, SearchResult result, SearchControls controls )
                        throws NamingException
View Full Code Here

        }
    }

    public void modify( NextInterceptor next, Name name, int modOp, Attributes mods ) throws NamingException
    {
        Invocation invocation = InvocationStack.getInstance().peek();
        DirectoryPartitionNexusProxy proxy = invocation.getProxy();
        Attributes oriEntry = proxy.lookup( name, DirectoryPartitionNexusProxy.LOOKUP_BYPASS );
        super.modify( next, name, modOp, mods );

        // package modifications in ModItem format for event delivery
        ModificationItem[] modItems = new ModificationItem[mods.size()];
View Full Code Here

    }


    public void modify( NextInterceptor next, Name name, ModificationItem[] mods ) throws NamingException
    {
        Invocation invocation = InvocationStack.getInstance().peek();
        DirectoryPartitionNexusProxy proxy = invocation.getProxy();
        Attributes oriEntry = proxy.lookup( name, DirectoryPartitionNexusProxy.LOOKUP_BYPASS );
        super.modify( next, name, mods );
        notifyOnModify( name, mods, oriEntry );
    }
View Full Code Here

TOP

Related Classes of org.apache.ldap.server.invocation.Invocation

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.