org.ametys.plugins.datainclusion.data.ldap
Class LdapDataSource

java.lang.Object
  extended by org.ametys.plugins.datainclusion.data.AbstractDataSource
      extended by org.ametys.plugins.datainclusion.data.ldap.LdapDataSource
All Implemented Interfaces:
DataSource

public class LdapDataSource
extends AbstractDataSource

LDAP data source.


Field Summary
protected  String _adminDn
          The LDAP admin DN.
protected  String _adminPassword
          The LDAP admin password.
protected  String _authMethod
          The LDAP server auth method.
protected  String _baseUrl
          The LDAP server base URL.
protected  String _filter
          The LDAP filter.
protected  Map<String,LdapQuery> _queries
          This data source SQL queries.
protected  String _scope
          The LDAP scope.
protected  boolean _useSsl
          Indicates if the server is to be connected to via SSL.
 
Fields inherited from class org.ametys.plugins.datainclusion.data.AbstractDataSource
_description, _id, _name
 
Constructor Summary
LdapDataSource()
          Constructor.
 
Method Summary
protected  Hashtable<String,String> _getContextEnv()
          Get the parameters for connecting to the LDAP server.
 DirContext connect()
          Connect to the LDAP server.
 Map<String,String> getAdditionalValues(boolean exceptPassword)
          Get the additional datasource configuration information.
 String getAdminDn()
          Get the LDAP admin DN.
 String getAdminPassword()
          Get the LDAP admin password.
 String getAuthMethod()
          Get the LDAP server auth method.
 String getBaseUrl()
          Get the LDAP server base URL.
 String getFilter()
          Get the LDAP filter.
 Map<String,LdapQuery> getQueries()
          Get the queries on this datasource.
 String getScope()
          Get the LDAP scope.
 String getType()
          Get the datasource type.
 void setAdminDn(String adminDn)
          Set the LDAP admin DN.
 void setAdminPassword(String adminPassword)
          Set the LDAP admin password.
 void setAuthMethod(String authMethod)
          Set the LDAP server auth method.
 void setBaseUrl(String baseUrl)
          Set the LDAP server base URL.
 void setFilter(String filter)
          Set the LDAP filter.
 void setScope(String scope)
          Set the LDAP scope.
 void setUseSsl(boolean useSsl)
          Set if the server uses SSL.
 boolean useSsl()
          Get if the server uses SSL.
 
Methods inherited from class org.ametys.plugins.datainclusion.data.AbstractDataSource
getDescription, getId, getName, setDescription, setId, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_baseUrl

protected String _baseUrl
The LDAP server base URL.


_filter

protected String _filter
The LDAP filter.


_scope

protected String _scope
The LDAP scope.


_adminDn

protected String _adminDn
The LDAP admin DN.


_adminPassword

protected String _adminPassword
The LDAP admin password.


_authMethod

protected String _authMethod
The LDAP server auth method.


_useSsl

protected boolean _useSsl
Indicates if the server is to be connected to via SSL.


_queries

protected Map<String,LdapQuery> _queries
This data source SQL queries.

Constructor Detail

LdapDataSource

public LdapDataSource()
Constructor.

Method Detail

getType

public String getType()
Description copied from interface: DataSource
Get the datasource type.

Returns:
the datasource type.

getBaseUrl

public String getBaseUrl()
Get the LDAP server base URL.

Returns:
the LDAP server base URL

setBaseUrl

public void setBaseUrl(String baseUrl)
Set the LDAP server base URL.

Parameters:
baseUrl - the LDAP server base URL to set

getFilter

public String getFilter()
Get the LDAP filter.

Returns:
the LDAP filter

setFilter

public void setFilter(String filter)
Set the LDAP filter.

Parameters:
filter - the LDAP filter to set

getScope

public String getScope()
Get the LDAP scope.

Returns:
the LDAP scope

setScope

public void setScope(String scope)
Set the LDAP scope.

Parameters:
scope - the LDAP scope to set

getAdminDn

public String getAdminDn()
Get the LDAP admin DN.

Returns:
the LDAP admin DN

setAdminDn

public void setAdminDn(String adminDn)
Set the LDAP admin DN.

Parameters:
adminDn - the LDAP admin DN to set

getAdminPassword

public String getAdminPassword()
Get the LDAP admin password.

Returns:
the LDAP admin password

setAdminPassword

public void setAdminPassword(String adminPassword)
Set the LDAP admin password.

Parameters:
adminPassword - the LDAP admin password to set

getAuthMethod

public String getAuthMethod()
Get the LDAP server auth method.

Returns:
the LDAP server auth method

setAuthMethod

public void setAuthMethod(String authMethod)
Set the LDAP server auth method.

Parameters:
authMethod - the LDAP server auth method to set

useSsl

public boolean useSsl()
Get if the server uses SSL.

Returns:
the true if the server is to be connected to via SSL, false otherwise.

setUseSsl

public void setUseSsl(boolean useSsl)
Set if the server uses SSL.

Parameters:
useSsl - if the server is to be connected to via SSL.

getAdditionalValues

public Map<String,String> getAdditionalValues(boolean exceptPassword)
Description copied from interface: DataSource
Get the additional datasource configuration information.

Parameters:
exceptPassword - true to do not return password values
Returns:
the additional datasource information as a Map of Id -> Value.

getQueries

public Map<String,LdapQuery> getQueries()
Description copied from interface: DataSource
Get the queries on this datasource.

Returns:
the the queries on this datasource as a Map.

connect

public DirContext connect()
                   throws NamingException,
                          DataInclusionException
Connect to the LDAP server.

Returns:
the directory context.
Throws:
NamingException
DataInclusionException

_getContextEnv

protected Hashtable<String,String> _getContextEnv()
Get the parameters for connecting to the LDAP server.

Returns:
Parameters for connecting as a hashtable.


Copyright © 2010 Anyware Services. All Rights Reserved.