}
else
{
isFirstStart = true;
Attributes attributes = new LockableAttributesImpl();
attributes.put( "objectClass", "top" );
attributes.put( "objectClass", "person" );
attributes.put( "objectClass", "organizationalPerson" );
attributes.put( "objectClass", "inetOrgPerson" );
attributes.put( "uid", SystemPartition.ADMIN_UID );
attributes.put( "userPassword", SystemPartition.ADMIN_PW );
attributes.put( "displayName", "Directory Superuser" );
attributes.put( "creatorsName", ADMIN );
attributes.put( "createTimestamp", DateUtils.getGeneralizedTime() );
attributes.put( "displayName", "Directory Superuser" );
nexus.add( ADMIN, ADMIN_NAME, attributes );
}
// -------------------------------------------------------------------
// 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 );
}