// -------------------------------------------------------------------
// 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;