}
private void initializeSystemPartition() throws Exception
{
Partition system = getSystemPartition();
// Add root context entry for system partition
Dn systemSuffixDn = getDnFactory().create( ServerDNConstants.SYSTEM_DN );
CoreSession adminSession = getAdminSession();
if ( !system.hasEntry( new HasEntryOperationContext( adminSession, systemSuffixDn ) ) )
{
Entry systemEntry = new DefaultEntry( schemaManager, systemSuffixDn );
// Add the ObjectClasses
systemEntry.put( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.TOP_OC,
SchemaConstants.ORGANIZATIONAL_UNIT_OC, SchemaConstants.EXTENSIBLE_OBJECT_OC );
// Add some operational attributes
systemEntry.put( SchemaConstants.CREATORS_NAME_AT, ServerDNConstants.ADMIN_SYSTEM_DN );
systemEntry.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
systemEntry.add( SchemaConstants.ENTRY_CSN_AT, getCSN().toString() );
systemEntry.add( SchemaConstants.ENTRY_UUID_AT, UUID.randomUUID().toString() );
systemEntry.put( DnUtils.getRdnAttributeType( ServerDNConstants.SYSTEM_DN ), DnUtils
.getRdnValue( ServerDNConstants.SYSTEM_DN ) );
AddOperationContext addOperationContext = new AddOperationContext( adminSession, systemEntry );
system.add( addOperationContext );
}
}