Package org.apache.ldap.server

Examples of org.apache.ldap.server.DirectoryService


    public void testNoBypass() throws NamingException
    {
        Name dn = new LdapName( "ou=system" );
        Context ctx = new DeadContext();
        DirectoryService ds = new MockDirectoryService();
        DirectoryPartitionNexusProxy proxy = new DirectoryPartitionNexusProxy( ctx, ds );
        Invocation i = new Invocation( proxy, ctx, "lookup", new Object[]{ dn } );
        InvocationStack.getInstance().push( i );

        try
View Full Code Here


    public void testSingleBypass() throws NamingException
    {
        Name dn = new LdapName( "ou=system" );
        Context ctx = new DeadContext();
        DirectoryService ds = new MockDirectoryService();
        DirectoryPartitionNexusProxy proxy = new DirectoryPartitionNexusProxy( ctx, ds );
        Invocation i = new Invocation( proxy, ctx, "lookup", new Object[]{ dn }, Collections.singleton( "0" ) );
        InvocationStack.getInstance().push( i );

        try
View Full Code Here

    public void testAdjacentDoubleBypass() throws NamingException
    {
        Name dn = new LdapName( "ou=system" );
        Context ctx = new DeadContext();
        DirectoryService ds = new MockDirectoryService();
        DirectoryPartitionNexusProxy proxy = new DirectoryPartitionNexusProxy( ctx, ds );
        Collection bypass = new HashSet();
        bypass.add( "0" );
        bypass.add( "1" );
        Invocation i = new Invocation( proxy, ctx, "lookup", new Object[]{ dn }, bypass );
View Full Code Here

    public void testFrontAndBackDoubleBypass() throws NamingException
    {
        Name dn = new LdapName( "ou=system" );
        Context ctx = new DeadContext();
        DirectoryService ds = new MockDirectoryService();
        DirectoryPartitionNexusProxy proxy = new DirectoryPartitionNexusProxy( ctx, ds );
        Collection bypass = new HashSet();
        bypass.add( "0" );
        bypass.add( "4" );
        Invocation i = new Invocation( proxy, ctx, "lookup", new Object[]{ dn }, bypass );
View Full Code Here

    public void testDoubleBypass() throws NamingException
    {
        Name dn = new LdapName( "ou=system" );
        Context ctx = new DeadContext();
        DirectoryService ds = new MockDirectoryService();
        DirectoryPartitionNexusProxy proxy = new DirectoryPartitionNexusProxy( ctx, ds );
        Collection bypass = new HashSet();
        bypass.add( "1" );
        bypass.add( "3" );
        Invocation i = new Invocation( proxy, ctx, "lookup", new Object[]{ dn }, bypass );
View Full Code Here

    public void testCompleteBypass() throws NamingException
    {
        Name dn = new LdapName( "ou=system" );
        Context ctx = new DeadContext();
        DirectoryService ds = new MockDirectoryService();
        DirectoryPartitionNexusProxy proxy = new DirectoryPartitionNexusProxy( ctx, ds );
        Invocation i = new Invocation( proxy, ctx, "lookup", new Object[]{ dn },
                DirectoryPartitionNexusProxy.BYPASS_ALL_COLLECTION );
        InvocationStack.getInstance().push( i );
View Full Code Here

        String principal = getPrincipal( env );
        byte[] credential = getCredential( env );
        String authentication = getAuthentication( env );
        String providerUrl = getProviderUrl( env );

        DirectoryService service = DirectoryService.getInstance( cfg.getInstanceId() );

        // Execute configuration
        if( cfg instanceof ShutdownConfiguration )
        {
            service.shutdown();
        }
        else if( cfg instanceof SyncConfiguration )
        {
            service.sync();
        }
        else if( cfg instanceof StartupConfiguration )
        {
            service.startup( this, env );
        }
        else if( cfg instanceof AddDirectoryPartitionConfiguration )
        {
            new DirectoryPartitionNexusProxy(
                    service.getJndiContext( principal, credential, authentication, providerUrl ),
                    service).addContextPartition( ( ( AddDirectoryPartitionConfiguration ) cfg ).getDirectoryPartitionConfiguration() );
        }
        else if( cfg instanceof RemoveDirectoryPartitionConfiguration )
        {
            new DirectoryPartitionNexusProxy(
                    service.getJndiContext( principal, credential, authentication, providerUrl ),
                    service).removeContextPartition( ( ( RemoveDirectoryPartitionConfiguration ) cfg ).getSuffix() );
        }
        else if( service == null )
        {
            throw new NamingException( "Unknown configuration: " + cfg );
        }
       
        return service.getJndiContext( principal, credential, authentication, providerUrl );
    }
View Full Code Here

TOP

Related Classes of org.apache.ldap.server.DirectoryService

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.