Package org.apache.ldap.common.name

Examples of org.apache.ldap.common.name.LdapName


                        attributes.put( "createTimestamp", DateUtils.getGeneralizedTime() );

                        Attribute dn = attributes.remove( "dn" );

                        nexus.add( ( String ) dn.get(), new LdapName( ( String ) dn.get() ), attributes );
                    }
                }
            }
        }
View Full Code Here


        // -------------------------------------------------------------------
        // create system users area
        // -------------------------------------------------------------------

        if ( nexus.hasEntry( new LdapName( "ou=users,ou=system" ) ) )
        {
            isFirstStart = false;
        }
        else
        {
            isFirstStart = true;

            Attributes attributes = new LockableAttributesImpl();

            attributes.put( "objectClass", "top" );

            attributes.put( "objectClass", "organizationalUnit" );

            attributes.put( "ou", "users" );

            attributes.put( "creatorsName", ADMIN );

            attributes.put( "createTimestamp", DateUtils.getGeneralizedTime() );

            nexus.add( "ou=users,ou=system", new LdapName( "ou=users,ou=system" ), attributes );
        }

        // -------------------------------------------------------------------
        // create system groups area
        // -------------------------------------------------------------------

        if ( nexus.hasEntry( new LdapName( "ou=groups,ou=system" ) ) )
        {
            isFirstStart = false;
        }
        else
        {
            isFirstStart = true;

            Attributes attributes = new LockableAttributesImpl();

            attributes.put( "objectClass", "top" );

            attributes.put( "objectClass", "organizationalUnit" );

            attributes.put( "ou", "groups" );

            attributes.put( "creatorsName", ADMIN );

            attributes.put( "createTimestamp", DateUtils.getGeneralizedTime() );

            nexus.add( "ou=groups,ou=system", new LdapName( "ou=groups,ou=system" ), attributes );
        }

        // -------------------------------------------------------------------
        // create system preferences area
        // -------------------------------------------------------------------

        if ( nexus.hasEntry( new LdapName( "prefNodeName=sysPrefRoot,ou=system" ) ) )
        {
            isFirstStart = false;
        }
        else
        {
            isFirstStart = true;

            Attributes attributes = new LockableAttributesImpl();

            attributes.put( "objectClass", "top" );

            attributes.put( "objectClass", "prefNode" );

            attributes.put( "objectClass", "extensibleObject" );

            attributes.put( "prefNodeName", "sysPrefRoot" );

            attributes.put( "creatorsName", ADMIN );

            attributes.put( "createTimestamp", DateUtils.getGeneralizedTime() );

            LdapName dn = new LdapName( "prefNodeName=sysPrefRoot,ou=system" );

            nexus.add( "prefNodeName=sysPrefRoot,ou=system", dn, attributes );
        }

        return isFirstStart;
View Full Code Here

            File current = new File( "." );

            mkdirs( current.getAbsolutePath(), wkdir );
        }

        LdapName suffix = new LdapName();

        suffix.add( SystemPartition.SUFFIX );

        Database db = new JdbmDatabase( suffix, suffix, wkdir );

        AttributeTypeRegistry attributeTypeRegistry;
View Full Code Here

            // ----------------------------------------------------------------
            // create the database/store
            // ----------------------------------------------------------------

            Name upSuffix = new LdapName( configs[ii].getSuffix() );

            Normalizer dnNorm = reg.lookup( "distinguishedNameMatch" ) .getNormalizer();

            Name normSuffix = new LdapName( ( String ) dnNorm.normalize( configs[ii].getSuffix() ) );

            Database db = new JdbmDatabase( upSuffix, normSuffix, wkdir );

            // ----------------------------------------------------------------
            // create the search engine using db, enumerators and evaluators
View Full Code Here

        if ( baseStr == null )
        {
            throw new LdapConfigurationException( "Trying to start kerberos service without setting " + JndiPrincipalStoreImpl.KDC_STORE_SEARCHBASE );
        }

        LdapName base = new LdapName( ( String ) baseStr );

        PrincipalStore store = new JndiPrincipalStoreImpl( ctx, base );

        try
        {
View Full Code Here

    {
        StringBuffer buf = new StringBuffer();
       
        try
        {
            LdapName dn = new LdapName( db.getEntryDn( id ) );
            buf.append( "(" ).append( id ).append( ") " );
            buf.append( dn.getRdn() );
        }
        catch( NamingException e )
        {
            e.printStackTrace();
            buf.append( "ERROR: " + e.getMessage() );
View Full Code Here

        Name normName = call.getNormalizedName();
        String upName = call.getUserProvidedName();
        if ( nexus.hasEntry( normName ) )
        {
            NamingException ne = new LdapNameAlreadyBoundException();
            ne.setResolvedName( new LdapName( upName ) );
            throw ne;
        }

        Name parentDn = new LdapName( upName );
        parentDn = parentDn.getSuffix( 1 );

        // check if we don't have the parent to add to
        assertHasEntry( "Attempt to add under non-existant parent: ", parentDn );

        // check if we're trying to add to a parent that is an alias
View Full Code Here

            {
                String dif = ( String ) list.next();
                LockableAttributesImpl attrs = new LockableAttributesImpl();
                parser.parse( attrs, dif );
                String updn = ( String ) attrs.get( "dn" ).get();
                LdapName ndn =
                    new LdapName( StringTools.deepTrimToLower( updn ) );
                attrs.remove( "dn" );

                if ( null == database.getEntryId( ndn.toString() ) )
                {
                    database.add( updn, ndn, attrs );
                    load();
                }
            }
View Full Code Here

        Hashtable env = new Hashtable();

        env.put( DerefAliasesEnum.JNDI_PROP,
            DerefAliasesEnum.DEREFALWAYS_NAME );

        NamingEnumeration cursor = eng.search( new LdapName( base ),
                env, root, ctls );
        String [] cols = new String [2];
        cols[0] = "id";
        cols[1] = "dn";
        DefaultTableModel tableModel = new DefaultTableModel( cols, 0 );
View Full Code Here

    private void dropAliasIndices( BigInteger aliasId ) throws NamingException
    {
        String targetDn = ( String ) aliasIdx.reverseLookup( aliasId );
        BigInteger targetId = getEntryId( targetDn );
        String aliasDn = getEntryDn( aliasId );
        Name ancestorDn = new LdapName( aliasDn ).getSuffix( 1 );
        BigInteger ancestorId = getEntryId( ancestorDn.toString() );
       
        /*
         * We cannot just drop all tuples in the one level and subtree indices
         * linking baseIds to the targetId.  If more than one alias refers to
View Full Code Here

TOP

Related Classes of org.apache.ldap.common.name.LdapName

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.