{
checkPermissionToCreateBootstrapEntries();
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", ContextPartitionNexus.ADMIN_UID );
attributes.put( "userPassword", environment.get( Context.SECURITY_CREDENTIALS ) );
attributes.put( "displayName", "Directory Superuser" );
attributes.put( "cn", "system administrator" );
attributes.put( "sn", "administrator" );
attributes.put( "creatorsName", ContextPartitionNexus.ADMIN_PRINCIPAL );
attributes.put( "createTimestamp", DateUtils.getGeneralizedTime() );
attributes.put( "displayName", "Directory Superuser" );
partitionNexus.add( ContextPartitionNexus.ADMIN_PRINCIPAL, ContextPartitionNexus.getAdminName(), attributes );
}
// -------------------------------------------------------------------
// create system users area
// -------------------------------------------------------------------
if ( !partitionNexus.hasEntry( new LdapName( "ou=users,ou=system" ) ) )
{
firstStart = true;
checkPermissionToCreateBootstrapEntries();
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", ContextPartitionNexus.ADMIN_PRINCIPAL );
attributes.put( "createTimestamp", DateUtils.getGeneralizedTime() );
partitionNexus.add( "ou=users,ou=system", new LdapName( "ou=users,ou=system" ), attributes );
}
// -------------------------------------------------------------------
// create system groups area
// -------------------------------------------------------------------
if ( !partitionNexus.hasEntry( new LdapName( "ou=groups,ou=system" ) ) )
{
firstStart = true;
checkPermissionToCreateBootstrapEntries();
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", ContextPartitionNexus.ADMIN_PRINCIPAL );
attributes.put( "createTimestamp", DateUtils.getGeneralizedTime() );
partitionNexus.add( "ou=groups,ou=system", new LdapName( "ou=groups,ou=system" ), attributes );
}
// -------------------------------------------------------------------
// create system configuration area
// -------------------------------------------------------------------
if ( !partitionNexus.hasEntry( new LdapName( "ou=configuration,ou=system" ) ) )
{
firstStart = true;
checkPermissionToCreateBootstrapEntries();
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", ContextPartitionNexus.ADMIN_PRINCIPAL );
attributes.put( "createTimestamp", DateUtils.getGeneralizedTime() );
partitionNexus.add( "ou=configuration,ou=system", new LdapName( "ou=configuration,ou=system" ), attributes );
}
// -------------------------------------------------------------------
// create system configuration area for partition information
// -------------------------------------------------------------------
if ( !partitionNexus.hasEntry( new LdapName( "ou=partitions,ou=configuration,ou=system" ) ) )
{
firstStart = true;
checkPermissionToCreateBootstrapEntries();
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", ContextPartitionNexus.ADMIN_PRINCIPAL );
attributes.put( "createTimestamp", DateUtils.getGeneralizedTime() );
partitionNexus.add( "ou=partitions,ou=configuration,ou=system",
new LdapName( "ou=partitions,ou=configuration,ou=system" ), attributes );
}
// -------------------------------------------------------------------
// create system configuration area for services
// -------------------------------------------------------------------
if ( !partitionNexus.hasEntry( new LdapName( "ou=services,ou=configuration,ou=system" ) ) )
{
firstStart = true;
checkPermissionToCreateBootstrapEntries();
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", ContextPartitionNexus.ADMIN_PRINCIPAL );
attributes.put( "createTimestamp", DateUtils.getGeneralizedTime() );
partitionNexus.add( "ou=services,ou=configuration,ou=system",
new LdapName( "ou=services,ou=configuration,ou=system" ), attributes );
}
// -------------------------------------------------------------------
// create system configuration area for interceptors
// -------------------------------------------------------------------
if ( !partitionNexus.hasEntry( new LdapName( "ou=interceptors,ou=configuration,ou=system" ) ) )
{
firstStart = true;
checkPermissionToCreateBootstrapEntries();
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", ContextPartitionNexus.ADMIN_PRINCIPAL );
attributes.put( "createTimestamp", DateUtils.getGeneralizedTime() );
partitionNexus.add( "ou=interceptors,ou=configuration,ou=system",
new LdapName( "ou=interceptors,ou=configuration,ou=system" ), attributes );
}
// -------------------------------------------------------------------
// create system preferences area
// -------------------------------------------------------------------
if ( !partitionNexus.hasEntry( new LdapName( "prefNodeName=sysPrefRoot,ou=system" ) ) )
{
firstStart = true;
checkPermissionToCreateBootstrapEntries();
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", ContextPartitionNexus.ADMIN_PRINCIPAL );