*/
if ( !partitionNexus.hasEntry( new EntryOperationContext( adminSession, adminDn ) ) )
{
firstStart = true;
Entry serverEntry = new DefaultEntry( schemaManager, adminDn );
serverEntry.put( SchemaConstants.OBJECT_CLASS_AT,
SchemaConstants.TOP_OC,
SchemaConstants.PERSON_OC,
SchemaConstants.ORGANIZATIONAL_PERSON_OC,
SchemaConstants.INET_ORG_PERSON_OC );
serverEntry.put( SchemaConstants.UID_AT, PartitionNexus.ADMIN_UID );
serverEntry.put( SchemaConstants.USER_PASSWORD_AT, PartitionNexus.ADMIN_PASSWORD_BYTES );
serverEntry.put( SchemaConstants.DISPLAY_NAME_AT, "Directory Superuser" );
serverEntry.put( SchemaConstants.CN_AT, "system administrator" );
serverEntry.put( SchemaConstants.SN_AT, "administrator" );
serverEntry.put( SchemaConstants.CREATORS_NAME_AT, ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
serverEntry.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
serverEntry.put( SchemaConstants.DISPLAY_NAME_AT, "Directory Superuser" );
serverEntry.add( SchemaConstants.ENTRY_CSN_AT, getCSN().toString() );
serverEntry.add( SchemaConstants.ENTRY_UUID_AT, UUID.randomUUID().toString() );
TlsKeyGenerator.addKeyPair( serverEntry );
partitionNexus.add( new AddOperationContext( adminSession, serverEntry ) );
}
// -------------------------------------------------------------------
// create system users area
// -------------------------------------------------------------------
Dn userDn = getDnFactory().create( ServerDNConstants.USERS_SYSTEM_DN );
if ( !partitionNexus.hasEntry( new EntryOperationContext( adminSession, userDn ) ) )
{
firstStart = true;
Entry serverEntry = new DefaultEntry( schemaManager, userDn );
serverEntry.put( SchemaConstants.OBJECT_CLASS_AT,
SchemaConstants.TOP_OC,
SchemaConstants.ORGANIZATIONAL_UNIT_OC );
serverEntry.put( SchemaConstants.OU_AT, "users" );
serverEntry.put( SchemaConstants.CREATORS_NAME_AT, ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
serverEntry.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
serverEntry.add( SchemaConstants.ENTRY_CSN_AT, getCSN().toString() );
serverEntry.add( SchemaConstants.ENTRY_UUID_AT, UUID.randomUUID().toString() );
partitionNexus.add( new AddOperationContext( adminSession, serverEntry ) );
}
// -------------------------------------------------------------------
// create system groups area
// -------------------------------------------------------------------
Dn groupDn = getDnFactory().create( ServerDNConstants.GROUPS_SYSTEM_DN );
if ( !partitionNexus.hasEntry( new EntryOperationContext( adminSession, groupDn ) ) )
{
firstStart = true;
Entry serverEntry = new DefaultEntry( schemaManager, groupDn );
serverEntry.put( SchemaConstants.OBJECT_CLASS_AT,
SchemaConstants.TOP_OC,
SchemaConstants.ORGANIZATIONAL_UNIT_OC );
serverEntry.put( SchemaConstants.OU_AT, "groups" );
serverEntry.put( SchemaConstants.CREATORS_NAME_AT, ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
serverEntry.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
serverEntry.add( SchemaConstants.ENTRY_CSN_AT, getCSN().toString() );
serverEntry.add( SchemaConstants.ENTRY_UUID_AT, UUID.randomUUID().toString() );
partitionNexus.add( new AddOperationContext( adminSession, serverEntry ) );
}
// -------------------------------------------------------------------
// create administrator group
// -------------------------------------------------------------------
Dn name = getDnFactory().create( ServerDNConstants.ADMINISTRATORS_GROUP_DN );
if ( !partitionNexus.hasEntry( new EntryOperationContext( adminSession, name ) ) )
{
firstStart = true;
Entry serverEntry = new DefaultEntry( schemaManager, name );
serverEntry.put( SchemaConstants.OBJECT_CLASS_AT,
SchemaConstants.TOP_OC,
SchemaConstants.GROUP_OF_UNIQUE_NAMES_OC );
serverEntry.put( SchemaConstants.CN_AT, "Administrators" );
serverEntry.put( SchemaConstants.UNIQUE_MEMBER_AT, ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
serverEntry.put( SchemaConstants.CREATORS_NAME_AT, ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
serverEntry.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
serverEntry.add( SchemaConstants.ENTRY_CSN_AT, getCSN().toString() );
serverEntry.add( SchemaConstants.ENTRY_UUID_AT, UUID.randomUUID().toString() );
partitionNexus.add( new AddOperationContext( adminSession, serverEntry ) );
}
// -------------------------------------------------------------------
// create system configuration area
// -------------------------------------------------------------------
Dn configurationDn = getDnFactory().create( "ou=configuration,ou=system" );
if ( !partitionNexus.hasEntry( new EntryOperationContext( adminSession, configurationDn ) ) )
{
firstStart = true;
Entry serverEntry = new DefaultEntry( schemaManager, configurationDn );
serverEntry.put( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.TOP_OC, SchemaConstants.ORGANIZATIONAL_UNIT_OC );
serverEntry.put( SchemaConstants.OU_AT, "configuration" );
serverEntry.put( SchemaConstants.CREATORS_NAME_AT, ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
serverEntry.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
serverEntry.add( SchemaConstants.ENTRY_CSN_AT, getCSN().toString() );
serverEntry.add( SchemaConstants.ENTRY_UUID_AT, UUID.randomUUID().toString() );
partitionNexus.add( new AddOperationContext( adminSession, serverEntry ) );
}
// -------------------------------------------------------------------
// create system configuration area for partition information
// -------------------------------------------------------------------
Dn partitionsDn = getDnFactory().create( "ou=partitions,ou=configuration,ou=system" );
if ( !partitionNexus.hasEntry( new EntryOperationContext( adminSession, partitionsDn ) ) )
{
firstStart = true;
Entry serverEntry = new DefaultEntry( schemaManager, partitionsDn );
serverEntry.put( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.TOP_OC, SchemaConstants.ORGANIZATIONAL_UNIT_OC );
serverEntry.put( SchemaConstants.OU_AT, "partitions" );
serverEntry.put( SchemaConstants.CREATORS_NAME_AT, ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
serverEntry.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
serverEntry.add( SchemaConstants.ENTRY_CSN_AT, getCSN().toString() );
serverEntry.add( SchemaConstants.ENTRY_UUID_AT, UUID.randomUUID().toString() );
partitionNexus.add( new AddOperationContext( adminSession, serverEntry ) );
}
// -------------------------------------------------------------------
// create system configuration area for services
// -------------------------------------------------------------------
Dn servicesDn = getDnFactory().create( "ou=services,ou=configuration,ou=system" );
if ( !partitionNexus.hasEntry( new EntryOperationContext( adminSession, servicesDn ) ) )
{
firstStart = true;
Entry serverEntry = new DefaultEntry( schemaManager, servicesDn );
serverEntry.put( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.TOP_OC, SchemaConstants.ORGANIZATIONAL_UNIT_OC );
serverEntry.put( SchemaConstants.OU_AT, "services" );
serverEntry.put( SchemaConstants.CREATORS_NAME_AT, ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
serverEntry.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
serverEntry.add( SchemaConstants.ENTRY_CSN_AT, getCSN().toString() );
serverEntry.add( SchemaConstants.ENTRY_UUID_AT, UUID.randomUUID().toString() );
partitionNexus.add( new AddOperationContext( adminSession, serverEntry ) );
}
// -------------------------------------------------------------------
// create system configuration area for interceptors
// -------------------------------------------------------------------
Dn interceptorsDn = getDnFactory().create( "ou=interceptors,ou=configuration,ou=system" );
if ( !partitionNexus.hasEntry( new EntryOperationContext( adminSession, interceptorsDn ) ) )
{
firstStart = true;
Entry serverEntry = new DefaultEntry( schemaManager, interceptorsDn );
serverEntry.put( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.TOP_OC, SchemaConstants.ORGANIZATIONAL_UNIT_OC );
serverEntry.put( SchemaConstants.OU_AT, "interceptors" );
serverEntry.put( SchemaConstants.CREATORS_NAME_AT, ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
serverEntry.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
serverEntry.add( SchemaConstants.ENTRY_CSN_AT, getCSN().toString() );
serverEntry.add( SchemaConstants.ENTRY_UUID_AT, UUID.randomUUID().toString() );
partitionNexus.add( new AddOperationContext( adminSession, serverEntry ) );
}
// -------------------------------------------------------------------
// create system preferences area
// -------------------------------------------------------------------
Dn sysPrefRootDn = getDnFactory().create( ServerDNConstants.SYSPREFROOT_SYSTEM_DN );
if ( !partitionNexus.hasEntry( new EntryOperationContext( adminSession, sysPrefRootDn ) ) )
{
firstStart = true;
Entry serverEntry = new DefaultEntry( schemaManager, sysPrefRootDn );
serverEntry.put( SchemaConstants.OBJECT_CLASS_AT,
SchemaConstants.TOP_OC,
SchemaConstants.ORGANIZATIONAL_UNIT_OC,
SchemaConstants.EXTENSIBLE_OBJECT_OC );
serverEntry.put( "prefNodeName", "sysPrefRoot" );
serverEntry.put( SchemaConstants.CREATORS_NAME_AT, ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
serverEntry.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
serverEntry.add( SchemaConstants.ENTRY_CSN_AT, getCSN().toString() );
serverEntry.add( SchemaConstants.ENTRY_UUID_AT, UUID.randomUUID().toString() );
partitionNexus.add( new AddOperationContext( adminSession, serverEntry ) );
}
return firstStart;