Esri Geoportal Server
1.0

com.esri.gpt.framework.security.identity.ldap
Class LdapClient

java.lang.Object
  extended by com.esri.gpt.framework.security.identity.ldap.LdapClient

public class LdapClient
extends Object

A client for connection to an LDAP identity store.


Constructor Summary
protected LdapClient()
          Default constructor.
protected LdapClient(LdapConfiguration configuration)
          Construct with a supplied configuration.
protected LdapClient(LdapConfiguration configuration, Credentials credentials)
          Construct with a supplied configuration and credentials.
 
Method Summary
protected  void authenticate(RequestContext requestContext, User user)
          Authenticates a user.
 void close()
          Closes the connected directory context (if open).
protected  String connect()
          Establishes an LDAP connection.
protected  void finalize()
          Finalize on garbage collection.
 LdapConfiguration getConfiguration()
          Gets the LDAP configuration.
protected  DirContext getConnectedContext()
          Gets the connected directory context.
 Credentials getCredentials()
          Gets the credentials for the connection.
protected  LdapEditFunctions getEditFunctions()
          Gets the edit functions.
protected  LdapQueryFunctions getQueryFunctions()
          Gets the query functions.
 void setConfiguration(LdapConfiguration configuration)
          Sets the LDAP configuration.
protected  void setConnectedContext(DirContext connectedContext)
          Sets the connected directory context.
 void setCredentials(Credentials credentials)
          Sets the credentials for the connection.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LdapClient

protected LdapClient()
Default constructor.


LdapClient

protected LdapClient(LdapConfiguration configuration)
Construct with a supplied configuration.

Parameters:
configuration - the configuration

LdapClient

protected LdapClient(LdapConfiguration configuration,
                     Credentials credentials)
Construct with a supplied configuration and credentials.

Parameters:
configuration - the configuration
credentials - the connection credentials
Method Detail

getConfiguration

public LdapConfiguration getConfiguration()
Gets the LDAP configuration.

Returns:
the configuration

setConfiguration

public void setConfiguration(LdapConfiguration configuration)
Sets the LDAP configuration.

Parameters:
configuration - the configuration

getConnectedContext

protected final DirContext getConnectedContext()
                                        throws NamingException
Gets the connected directory context.

Returns:
the connected directory context
Throws:
NamingException - if a connection has not been established

setConnectedContext

protected final void setConnectedContext(DirContext connectedContext)
Sets the connected directory context.

Parameters:
connectedContext - the connected directory context

getCredentials

public Credentials getCredentials()
Gets the credentials for the connection.

Returns:
the credentials

setCredentials

public void setCredentials(Credentials credentials)
Sets the credentials for the connection.

Parameters:
credentials - the credentials

getEditFunctions

protected LdapEditFunctions getEditFunctions()
Gets the edit functions.

Returns:
the edit functions

getQueryFunctions

protected LdapQueryFunctions getQueryFunctions()
Gets the query functions.

Returns:
the query functions

authenticate

protected void authenticate(RequestContext requestContext,
                            User user)
                     throws CredentialsDeniedException,
                            IdentityException,
                            SQLException
Authenticates a user.

Parameters:
requestContext - the context associated with the request
user - the subject user
Throws:
CredentialsDeniedException - if credentials are denied
IdentityException - if a system error occurs preventing authentication
SQLException - if a database communication exception occurs

close

public final void close()
Closes the connected directory context (if open).


connect

protected String connect()
                  throws AuthenticationException,
                         NamingException
Establishes an LDAP connection.

Returns:
the SECURITY_PRINCIPAL associated with the connection
Throws:
AuthenticationException - if an authentication exception occurs
NamingException - if a naming exception occurs

finalize

protected void finalize()
                 throws Throwable
Finalize on garbage collection.

Overrides:
finalize in class Object
Throws:
Throwable - if an exception occurs

Esri Geoportal Server
1.0

Copyright 2011 Environmental Systems Research Institute. All rights reserved. Use is subject to license terms.