attributes.put( "uniqueMember", PartitionNexus.ADMIN_PRINCIPAL ); attributes.put( "creatorsName", PartitionNexus.ADMIN_PRINCIPAL );
attributes.put( "uniqueMember", PartitionNexus.ADMIN_PRINCIPAL_NORMALIZED ); attributes.put( "creatorsName", PartitionNexus.ADMIN_PRINCIPAL_NORMALIZED );
    private boolean createBootstrapEntries() throws NamingException    {        boolean firstStart = false;                // -------------------------------------------------------------------        // create admin entry        // -------------------------------------------------------------------        /*         * If the admin entry is there, then the database was already created         */        if ( !partitionNexus.hasEntry( PartitionNexus.getAdminName() ) )        {            firstStart = true;            Attributes attributes = new LockableAttributesImpl();            Attribute objectClass = new LockableAttributeImpl( "objectClass" );            objectClass.add( "top" );            objectClass.add( "person" );            objectClass.add( "organizationalPerson" );            objectClass.add( "inetOrgPerson" );            attributes.put( objectClass );            attributes.put( "uid", PartitionNexus.ADMIN_UID );            attributes.put( "userPassword", PartitionNexus.ADMIN_PASSWORD );            attributes.put( "displayName", "Directory Superuser" );            attributes.put( "cn", "system administrator" );            attributes.put( "sn", "administrator" );            attributes.put( "creatorsName", PartitionNexus.ADMIN_PRINCIPAL );            attributes.put( "createTimestamp", DateUtils.getGeneralizedTime() );            attributes.put( "displayName", "Directory Superuser" );            partitionNexus.add(PartitionNexus.getAdminName(),                attributes );        }        // -------------------------------------------------------------------        // create system users area        // -------------------------------------------------------------------        Map oidsMap = configuration.getGlobalRegistries().getAttributeTypeRegistry().getNormalizerMapping();        LdapDN userDn = new LdapDN( "ou=users,ou=system" );        userDn.normalize( oidsMap );                if ( !partitionNexus.hasEntry( userDn ) )        {            firstStart = true;            Attributes attributes = new LockableAttributesImpl();            Attribute objectClass = new LockableAttributeImpl( "objectClass" );            objectClass.add( "top" );            objectClass.add( "organizationalUnit" );            attributes.put( objectClass );            attributes.put( "ou", "users" );            attributes.put( "creatorsName", PartitionNexus.ADMIN_PRINCIPAL );            attributes.put( "createTimestamp", DateUtils.getGeneralizedTime() );            partitionNexus.add( userDn, attributes );        }        // -------------------------------------------------------------------        // create system groups area        // -------------------------------------------------------------------        LdapDN groupDn = new LdapDN( "ou=groups,ou=system" );        groupDn.normalize( oidsMap );                if ( !partitionNexus.hasEntry( groupDn ) )        {            firstStart = true;            Attributes attributes = new LockableAttributesImpl();            Attribute objectClass = new LockableAttributeImpl( "objectClass" );            objectClass.add( "top" );            objectClass.add( "organizationalUnit" );            attributes.put( objectClass );            attributes.put( "ou", "groups" );            attributes.put( "creatorsName", PartitionNexus.ADMIN_PRINCIPAL );            attributes.put( "createTimestamp", DateUtils.getGeneralizedTime() );            partitionNexus.add( groupDn, attributes );        }        // -------------------------------------------------------------------        // create administrator group        // -------------------------------------------------------------------        String upName = "cn=Administrators,ou=groups,ou=system";        LdapDN normName = new LdapDN( "cn=administrators,ou=groups,ou=system" );        normName.normalize( oidsMap );                if ( !partitionNexus.hasEntry( normName ) )        {            firstStart = true;            Attributes attributes = new LockableAttributesImpl();            Attribute objectClass = new LockableAttributeImpl( "objectClass" );            objectClass.add( "top" );            objectClass.add( "groupOfUniqueNames" );            attributes.put( objectClass );            attributes.put( "cn", "Administrators" );            attributes.put( "uniqueMember", PartitionNexus.ADMIN_PRINCIPAL );            attributes.put( "creatorsName", PartitionNexus.ADMIN_PRINCIPAL );            attributes.put( "createTimestamp", DateUtils.getGeneralizedTime() );            partitionNexus.add(normName, attributes );            AuthorizationService authzSrvc = ( AuthorizationService ) interceptorChain.get( "authorizationService" );            authzSrvc.cacheNewGroup( upName, normName, attributes );        }        // -------------------------------------------------------------------        // create system configuration area        // -------------------------------------------------------------------        LdapDN configurationDn = new LdapDN( "ou=configuration,ou=system" );        configurationDn.normalize( oidsMap );                if ( !partitionNexus.hasEntry( configurationDn ) )        {            firstStart = true;            Attributes attributes = new LockableAttributesImpl();            Attribute objectClass = new LockableAttributeImpl( "objectClass" );            objectClass.add( "top" );            objectClass.add( "organizationalUnit" );            attributes.put( objectClass );            attributes.put( "ou", "configuration" );            attributes.put( "creatorsName", PartitionNexus.ADMIN_PRINCIPAL );            attributes.put( "createTimestamp", DateUtils.getGeneralizedTime() );            partitionNexus.add( configurationDn, attributes );        }        // -------------------------------------------------------------------        // create system configuration area for partition information        // -------------------------------------------------------------------        LdapDN partitionsDn = new LdapDN( "ou=partitions,ou=configuration,ou=system" );        partitionsDn.normalize( oidsMap );                if ( !partitionNexus.hasEntry( partitionsDn ) )         {            firstStart = true;            Attributes attributes = new LockableAttributesImpl();            Attribute objectClass = new LockableAttributeImpl( "objectClass" );            objectClass.add( "top" );            objectClass.add( "organizationalUnit" );            attributes.put( objectClass );            attributes.put( "ou", "partitions" );            attributes.put( "creatorsName", PartitionNexus.ADMIN_PRINCIPAL );            attributes.put( "createTimestamp", DateUtils.getGeneralizedTime() );            partitionNexus.add( partitionsDn, attributes );        }        // -------------------------------------------------------------------        // create system configuration area for services        // -------------------------------------------------------------------        LdapDN servicesDn = new LdapDN( "ou=services,ou=configuration,ou=system" );        servicesDn.normalize( oidsMap );                if ( !partitionNexus.hasEntry( servicesDn ) )        {            firstStart = true;            Attributes attributes = new LockableAttributesImpl();            Attribute objectClass = new LockableAttributeImpl( "objectClass" );            objectClass.add( "top" );            objectClass.add( "organizationalUnit" );            attributes.put( objectClass );            attributes.put( "ou", "services" );            attributes.put( "creatorsName", PartitionNexus.ADMIN_PRINCIPAL );            attributes.put( "createTimestamp", DateUtils.getGeneralizedTime() );            partitionNexus.add( servicesDn, attributes );        }        // -------------------------------------------------------------------        // create system configuration area for interceptors        // -------------------------------------------------------------------        LdapDN interceptorsDn = new LdapDN( "ou=interceptors,ou=configuration,ou=system" );        interceptorsDn.normalize( oidsMap );                if ( !partitionNexus.hasEntry( interceptorsDn ) )        {            firstStart = true;            Attributes attributes = new LockableAttributesImpl();            Attribute objectClass = new LockableAttributeImpl( "objectClass" );            objectClass.add( "top" );            objectClass.add( "organizationalUnit" );            attributes.put( objectClass );            attributes.put( "ou", "interceptors" );            attributes.put( "creatorsName", PartitionNexus.ADMIN_PRINCIPAL );            attributes.put( "createTimestamp", DateUtils.getGeneralizedTime() );            partitionNexus.add( interceptorsDn, attributes );        }        // -------------------------------------------------------------------        // create system preferences area        // -------------------------------------------------------------------        LdapDN sysPrefRootDn = new LdapDN( "prefNodeName=sysPrefRoot,ou=system");        sysPrefRootDn.normalize( oidsMap );                if ( !partitionNexus.hasEntry( sysPrefRootDn ) )        {            firstStart = true;            Attributes attributes = new LockableAttributesImpl();            Attribute objectClass = new LockableAttributeImpl( "objectClass" );            objectClass.add( "top" );            objectClass.add( "organizationalUnit" );            attributes.put( objectClass );            attributes.put( "objectClass", "extensibleObject" );            attributes.put( "prefNodeName", "sysPrefRoot" );            attributes.put( "creatorsName", PartitionNexus.ADMIN_PRINCIPAL );            attributes.put( "createTimestamp", DateUtils.getGeneralizedTime() );            partitionNexus.add( sysPrefRootDn, attributes );        }        return firstStart;    }