private void createRoot ( final Partition partition ) throws Exception { try { service . getAdminSession ( ) . lookup ( partition . getSuffixDn ( ) ) ; } catch ( final LdapNameNotFoundException e ) { final LdapDN dn = new LdapDN ( getRoot ( ) ) ; final String dc = getRoot ( ) . substring ( 3 , getRoot ( ) . indexOf ( ' ' ) ) ; final ServerEntry entry = service . newEntry ( dn ) ; entry . add ( "objectClass" , "top" , "domain" , "extensibleObject" ) ; entry . add ( "dc" , dc ) ; service . getAdminSession ( ) . add ( entry ) ; } }
Create the root DN .