org.apache.directory.server.integ
Class ServerIntegrationUtils

java.lang.Object
  extended by org.apache.directory.server.core.integ.IntegrationUtils
      extended by org.apache.directory.server.integ.ServerIntegrationUtils

public class ServerIntegrationUtils
extends org.apache.directory.server.core.integ.IntegrationUtils


Constructor Summary
ServerIntegrationUtils()
           
 
Method Summary
static org.apache.directory.ldap.client.api.LdapConnection getAdminConnection(org.apache.directory.server.ldap.LdapServer ldapServer)
          Gets a LDAP connection instance on a server.
static org.apache.directory.ldap.client.api.LdapConnection getLdapConnection(org.apache.directory.server.ldap.LdapServer ldapServer)
          Gets a LDAP connection instance on a server.
static netscape.ldap.LDAPConnection getNsdkWiredConnection(org.apache.directory.server.ldap.LdapServer ldapServer)
           
static netscape.ldap.LDAPConnection getNsdkWiredConnection(org.apache.directory.server.ldap.LdapServer ldapServer, String principalDn, String password)
          Gets a LDAP connection instance on a server, authenticating a user.
static org.apache.directory.ldap.client.api.LdapConnection getWiredConnection(org.apache.directory.server.ldap.LdapServer ldapServer)
           
static org.apache.directory.ldap.client.api.LdapConnection getWiredConnection(org.apache.directory.server.ldap.LdapServer ldapServer, String principalDn, String password)
          Gets a LDAP connection instance on a server, authenticating a user.
static LdapContext getWiredContext(org.apache.directory.server.ldap.LdapServer ldapServer)
          Creates a JNDI LdapContext with a connection over the wire using the SUN LDAP provider.
static LdapContext getWiredContext(org.apache.directory.server.ldap.LdapServer ldapServer, org.apache.directory.shared.ldap.model.message.Control[] controls)
          Creates a JNDI LdapContext with a connection over the wire using the SUN LDAP provider.
static LdapContext getWiredContext(org.apache.directory.server.ldap.LdapServer ldapServer, String principalDn, String password)
          Creates a JNDI LdapContext with a connection over the wire using the SUN LDAP provider.
static LdapContext getWiredContextFollowOnRefferal(org.apache.directory.server.ldap.LdapServer ldapServer)
          Creates a JNDI LdapContext with a connection over the wire using the SUN LDAP provider.
static LdapContext getWiredContextRefferalIgnore(org.apache.directory.server.ldap.LdapServer ldapServer)
          Creates a JNDI LdapContext with a connection over the wire using the SUN LDAP provider.
static LdapContext getWiredContextThrowOnRefferal(org.apache.directory.server.ldap.LdapServer ldapServer)
          Creates a JNDI LdapContext with a connection over the wire using the SUN LDAP provider.
 
Methods inherited from class org.apache.directory.server.core.integ.IntegrationUtils
apply, closeConnections, disableSchema, doDelete, enableSchema, getAdminConnection, getAdminNetworkConnection, getConnectionAs, getConnectionAs, getContext, getCoreSession, getNetworkConnectionAs, getNetworkConnectionAs, getRootContext, getSchemaContext, getSystemContext, getUserAddLdif, getUserAddLdif, injectEntries, isDisabled, isEnabled, isLoaded
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServerIntegrationUtils

public ServerIntegrationUtils()
Method Detail

getWiredContext

public static LdapContext getWiredContext(org.apache.directory.server.ldap.LdapServer ldapServer)
                                   throws Exception
Creates a JNDI LdapContext with a connection over the wire using the SUN LDAP provider. The connection is made using the administrative user as the principalDN. The context is to the rootDSE.

Parameters:
ldapServer - the LDAP server to get the connection to
Returns:
an LdapContext as the administrative user to the RootDSE
Throws:
Exception - if there are problems creating the context

getWiredContext

public static LdapContext getWiredContext(org.apache.directory.server.ldap.LdapServer ldapServer,
                                          String principalDn,
                                          String password)
                                   throws Exception
Creates a JNDI LdapContext with a connection over the wire using the SUN LDAP provider. The connection is made using the administrative user as the principalDN. The context is to the rootDSE.

Parameters:
ldapServer - the LDAP server to get the connection to
Returns:
an LdapContext as the administrative user to the RootDSE
Throws:
Exception - if there are problems creating the context

getWiredContext

public static LdapContext getWiredContext(org.apache.directory.server.ldap.LdapServer ldapServer,
                                          org.apache.directory.shared.ldap.model.message.Control[] controls)
                                   throws Exception
Creates a JNDI LdapContext with a connection over the wire using the SUN LDAP provider. The connection is made using the administrative user as the principalDN. The context is to the rootDSE.

Parameters:
ldapServer - the LDAP server to get the connection to
Returns:
an LdapContext as the administrative user to the RootDSE
Throws:
Exception - if there are problems creating the context

getWiredContextThrowOnRefferal

public static LdapContext getWiredContextThrowOnRefferal(org.apache.directory.server.ldap.LdapServer ldapServer)
                                                  throws Exception
Creates a JNDI LdapContext with a connection over the wire using the SUN LDAP provider. The connection is made using the administrative user as the principalDN. The context is to the rootDSE.

Parameters:
ldapServer - the LDAP server to get the connection to
Returns:
an LdapContext as the administrative user to the RootDSE
Throws:
Exception - if there are problems creating the context

getWiredContextRefferalIgnore

public static LdapContext getWiredContextRefferalIgnore(org.apache.directory.server.ldap.LdapServer ldapServer)
                                                 throws Exception
Creates a JNDI LdapContext with a connection over the wire using the SUN LDAP provider. The connection is made using the administrative user as the principalDN. The context is to the rootDSE.

Parameters:
ldapServer - the LDAP server to get the connection to
Returns:
an LdapContext as the administrative user to the RootDSE
Throws:
Exception - if there are problems creating the context

getWiredContextFollowOnRefferal

public static LdapContext getWiredContextFollowOnRefferal(org.apache.directory.server.ldap.LdapServer ldapServer)
                                                   throws Exception
Creates a JNDI LdapContext with a connection over the wire using the SUN LDAP provider. The connection is made using the administrative user as the principalDN. The context is to the rootDSE.

Parameters:
ldapServer - the LDAP server to get the connection to
Returns:
an LdapContext as the administrative user to the RootDSE
Throws:
Exception - if there are problems creating the context

getWiredConnection

public static org.apache.directory.ldap.client.api.LdapConnection getWiredConnection(org.apache.directory.server.ldap.LdapServer ldapServer)
                                                                              throws Exception
Throws:
Exception

getNsdkWiredConnection

public static netscape.ldap.LDAPConnection getNsdkWiredConnection(org.apache.directory.server.ldap.LdapServer ldapServer)
                                                           throws Exception
Throws:
Exception

getWiredConnection

public static org.apache.directory.ldap.client.api.LdapConnection getWiredConnection(org.apache.directory.server.ldap.LdapServer ldapServer,
                                                                                     String principalDn,
                                                                                     String password)
                                                                              throws Exception
Gets a LDAP connection instance on a server, authenticating a user.

Parameters:
ldapServer - The server we want to connect to
principalDn - The user's DN
password - The user's password
Returns:
A LdapConnection instance if we got one
Throws:
Exception - If the connection cannot be created

getLdapConnection

public static org.apache.directory.ldap.client.api.LdapConnection getLdapConnection(org.apache.directory.server.ldap.LdapServer ldapServer)
                                                                             throws Exception
Gets a LDAP connection instance on a server. We won't bind on the server.

Parameters:
ldapServer - The server we want to connect to
Returns:
A LdapConnection instance if we got one
Throws:
Exception - If the connection cannot be created

getNsdkWiredConnection

public static netscape.ldap.LDAPConnection getNsdkWiredConnection(org.apache.directory.server.ldap.LdapServer ldapServer,
                                                                  String principalDn,
                                                                  String password)
                                                           throws Exception
Gets a LDAP connection instance on a server, authenticating a user.

Parameters:
ldapServer - The server we want to connect to
principalDn - The user's DN
password - The user's password
Returns:
A LdapConnection instance if we got one
Throws:
Exception - If the connection cannot be created

getAdminConnection

public static org.apache.directory.ldap.client.api.LdapConnection getAdminConnection(org.apache.directory.server.ldap.LdapServer ldapServer)
                                                                              throws Exception
Gets a LDAP connection instance on a server. We will bind as Admin

Parameters:
ldapServer - The server we want to connect to
Returns:
A LdapConnection instance if we got one
Throws:
Exception - If the connection cannot be created


Copyright © 2003-2012 The Apache Software Foundation. All Rights Reserved.