Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Now we can create as many partitions as we need
- // Create some new partitions named 'foo', 'bar' and 'apache'.
- Partition mfPartition = addPartition( "mforg", "dc=mydomain,dc=org", service.getDnFactory() );
- // Index some attributes on the apache partition
- addIndex( mfPartition, "objectClass", "ou", "uid" );
- // And start the service
- service.startup();
- // Inject the context entry for dc=Apache,dc=Org partition
- if ( !service.getAdminSession().exists( mfPartition.getSuffixDn() ) )
- {
- createDC(service, "dc=mydomain,dc=com");
- createOU(service, "ou=User,dc=mydomain,dc=com");
- createOU(service, "ou=WebLDAP,dc=mydomain,dc=com");
- createOU(service, "ou=Account,ou=WebLDAP,dc=mydomain,dc=com");
- createOU(service, "ou=Stammdaten,ou=WebLDAP,dc=mydomain,dc=com");
- }
- createPerson(service);
- // We are all done !
- }
- private static void createDC(DirectoryService service, String dn) throws Exception{
- DefaultEntry entry = new DefaultEntry(dn,
- "objectClass: top",
- "objectClass: domain",
- "objectClass: extensibleObject",
- "dc: mydomain"
- );
- service.getAdminSession().add(entry);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement