public class IntegrationUtils extends Object
Constructor and Description |
---|
IntegrationUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
apply(DirectoryService service,
org.apache.directory.shared.ldap.ldif.LdifEntry entry) |
static void |
closeConections() |
static void |
disableSchema(DirectoryService service,
String schemaName) |
static void |
doDelete(File wkdir)
Deletes the working directory.
|
static void |
enableSchema(DirectoryService service,
String schemaName) |
static org.apache.directory.ldap.client.api.LdapConnection |
getAdminConnection(LdapServer ldapServer)
gets a LdapConnection bound using the default admin DN uid=admin,ou=system and password "secret"
|
static org.apache.directory.ldap.client.api.LdapConnection |
getConnectionAs(LdapServer ldapServer,
org.apache.directory.shared.ldap.name.DN dn,
String password) |
static org.apache.directory.ldap.client.api.LdapConnection |
getConnectionAs(LdapServer ldapServer,
String dn,
String password) |
static org.apache.directory.ldap.client.api.LdapConnection |
getConnectionAs(String host,
int port,
String dn,
String password) |
static LdapContext |
getContext(String principalDn,
DirectoryService service,
String dn) |
static CoreSession |
getCoreSession(String principalDn,
DirectoryService service,
String dn) |
static LdapContext |
getRootContext(DirectoryService service) |
static LdapContext |
getSchemaContext(DirectoryService service) |
static LdapContext |
getSystemContext(DirectoryService service) |
static org.apache.directory.shared.ldap.ldif.LdifEntry |
getUserAddLdif() |
static org.apache.directory.shared.ldap.ldif.LdifEntry |
getUserAddLdif(String dnstr,
byte[] password,
String cn,
String sn) |
static void |
injectEntries(DirectoryService service,
String ldif)
Inject an ldif String into the server.
|
static boolean |
isDisabled(DirectoryService service,
String schemaName)
A helper method which tells if a schema is disabled.
|
static boolean |
isEnabled(DirectoryService service,
String schemaName)
A helper method which tells if a schema is enabled.
|
static boolean |
isLoaded(DirectoryService service,
String schemaName)
A helper method which tells if a schema is loaded.
|
public static void doDelete(File wkdir) throws IOException
wkdir
- the working directory to deleteIOException
- if the working directory cannot be deletedpublic static void injectEntries(DirectoryService service, String ldif) throws Exception
service
- the directory service to useldif
- the ldif containing entries to add to the server.NamingException
- if there is a problem adding the entries from the LDIFException
public static org.apache.directory.shared.ldap.ldif.LdifEntry getUserAddLdif() throws org.apache.directory.shared.ldap.exception.LdapException
org.apache.directory.shared.ldap.exception.LdapException
public static LdapContext getContext(String principalDn, DirectoryService service, String dn) throws Exception
Exception
public static CoreSession getCoreSession(String principalDn, DirectoryService service, String dn) throws Exception
Exception
public static LdapContext getSystemContext(DirectoryService service) throws Exception
Exception
public static LdapContext getSchemaContext(DirectoryService service) throws Exception
Exception
public static LdapContext getRootContext(DirectoryService service) throws Exception
Exception
public static void apply(DirectoryService service, org.apache.directory.shared.ldap.ldif.LdifEntry entry) throws Exception
Exception
public static org.apache.directory.shared.ldap.ldif.LdifEntry getUserAddLdif(String dnstr, byte[] password, String cn, String sn) throws org.apache.directory.shared.ldap.exception.LdapException
org.apache.directory.shared.ldap.exception.LdapException
public static void enableSchema(DirectoryService service, String schemaName) throws Exception
Exception
public static void disableSchema(DirectoryService service, String schemaName) throws Exception
Exception
public static boolean isDisabled(DirectoryService service, String schemaName)
public static boolean isLoaded(DirectoryService service, String schemaName)
public static boolean isEnabled(DirectoryService service, String schemaName)
public static org.apache.directory.ldap.client.api.LdapConnection getAdminConnection(LdapServer ldapServer) throws Exception
Exception
public static org.apache.directory.ldap.client.api.LdapConnection getConnectionAs(LdapServer ldapServer, String dn, String password) throws Exception
Exception
public static org.apache.directory.ldap.client.api.LdapConnection getConnectionAs(LdapServer ldapServer, org.apache.directory.shared.ldap.name.DN dn, String password) throws Exception
Exception
public static org.apache.directory.ldap.client.api.LdapConnection getConnectionAs(String host, int port, String dn, String password) throws Exception
Exception
public static void closeConections()
Copyright © 2003-2012 Apache Software Foundation. All Rights Reserved.