Package org.ametys.core.datasource
Class LDAPDataSourceManager
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.core.datasource.AbstractDataSourceManager
-
- org.ametys.core.datasource.LDAPDataSourceManager
-
- All Implemented Interfaces:
LogEnabled
,Disposable
,Initializable
,Component
,Serviceable
public class LDAPDataSourceManager extends AbstractDataSourceManager
This component handles SQL data sources. It is associated with the configuration file $AMETYS_HOME/config/datasources-ldap.xml
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.ametys.core.datasource.AbstractDataSourceManager
AbstractDataSourceManager.DataSourceDefinition
-
-
Field Summary
Fields Modifier and Type Field Description private static String
__filename
static String
LDAP_DATASOURCE_PREFIX
The id of the internal DataSourcestatic String
PARAM_ADMIN_DN
LDAP parameter's name for administrator DNstatic String
PARAM_ADMIN_PASSWORD
LDAP parameter's name for administration passwordstatic String
PARAM_ALIAS_DEREFERENCING
LDAP parameter's name for alias dereferencingstatic String
PARAM_AUTHENTICATION_METHOD
LDAP parameter's name for authentication methodstatic String
PARAM_BASE_DN
LDAP parameter's name for base DNstatic String
PARAM_BASE_URL
LDAP parameter's name for base URLstatic String
PARAM_FOLLOW_REFERRALS
LDAP parameter's name for follow referrals propertystatic String
PARAM_SERVER_SIDE_SORTING
LDAP parameter's name for enabling server side sortingstatic String
PARAM_USE_SSL
LDAP parameter's name for use SSLstatic String
ROLE
Avalon Role-
Fields inherited from class org.ametys.core.datasource.AbstractDataSourceManager
_currentUserProvider, _dataSourcesDef, _observationManager, DEFAULT_DATASOURCE_SUFFIX
-
-
Constructor Summary
Constructors Constructor Description LDAPDataSourceManager()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkParameters(Map<String,Object> parameters)
Checks the parameters of a data sourceprotected void
createDataSource(AbstractDataSourceManager.DataSourceDefinition dataSource)
Creates a data source from its configurationprotected void
deleteDataSource(AbstractDataSourceManager.DataSourceDefinition dataSource)
Deletes a data sourceprotected Map<String,AbstractDataSourceManager.DataSourceDefinition>
doReadConfiguration(File file)
Actually read configuration.protected void
editDataSource(AbstractDataSourceManager.DataSourceDefinition dataSource)
Edit a data source from its configurationprotected String
getDataSourcePrefixId()
Get the prefix for data source identifierFile
getFileConfiguration()
Get the file configuration of data sourcesprotected void
internalSetDefaultDataSource()
Set a default data source internallystatic void
setFilename(String filename)
Set the config filename.-
Methods inherited from class org.ametys.core.datasource.AbstractDataSourceManager
add, checkDataSources, delete, dispose, edit, getDataSourceDefinition, getDataSourceDefinitions, getDefaultDataSourceDefinition, getDefaultDataSourceId, initialize, readConfiguration, saveConfiguration, saxDataSource, service, setDefaultDataSource
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
PARAM_BASE_URL
public static final String PARAM_BASE_URL
LDAP parameter's name for base URL- See Also:
- Constant Field Values
-
PARAM_BASE_DN
public static final String PARAM_BASE_DN
LDAP parameter's name for base DN- See Also:
- Constant Field Values
-
PARAM_USE_SSL
public static final String PARAM_USE_SSL
LDAP parameter's name for use SSL- See Also:
- Constant Field Values
-
PARAM_ALIAS_DEREFERENCING
public static final String PARAM_ALIAS_DEREFERENCING
LDAP parameter's name for alias dereferencing- See Also:
- Constant Field Values
-
PARAM_FOLLOW_REFERRALS
public static final String PARAM_FOLLOW_REFERRALS
LDAP parameter's name for follow referrals property- See Also:
- Constant Field Values
-
PARAM_AUTHENTICATION_METHOD
public static final String PARAM_AUTHENTICATION_METHOD
LDAP parameter's name for authentication method- See Also:
- Constant Field Values
-
PARAM_ADMIN_DN
public static final String PARAM_ADMIN_DN
LDAP parameter's name for administrator DN- See Also:
- Constant Field Values
-
PARAM_ADMIN_PASSWORD
public static final String PARAM_ADMIN_PASSWORD
LDAP parameter's name for administration password- See Also:
- Constant Field Values
-
PARAM_SERVER_SIDE_SORTING
public static final String PARAM_SERVER_SIDE_SORTING
LDAP parameter's name for enabling server side sorting- See Also:
- Constant Field Values
-
LDAP_DATASOURCE_PREFIX
public static final String LDAP_DATASOURCE_PREFIX
The id of the internal DataSource- See Also:
- Constant Field Values
-
__filename
private static String __filename
-
-
Constructor Detail
-
LDAPDataSourceManager
public LDAPDataSourceManager()
-
-
Method Detail
-
setFilename
public static void setFilename(String filename)
Set the config filename. Only use for tests.- Parameters:
filename
- Name with path of the config file
-
getFileConfiguration
public File getFileConfiguration()
Description copied from class:AbstractDataSourceManager
Get the file configuration of data sources- Specified by:
getFileConfiguration
in classAbstractDataSourceManager
- Returns:
- the file
-
getDataSourcePrefixId
protected String getDataSourcePrefixId()
Description copied from class:AbstractDataSourceManager
Get the prefix for data source identifier- Specified by:
getDataSourcePrefixId
in classAbstractDataSourceManager
- Returns:
- the id prefix
-
doReadConfiguration
protected Map<String,AbstractDataSourceManager.DataSourceDefinition> doReadConfiguration(File file)
Description copied from class:AbstractDataSourceManager
Actually read configuration.- Specified by:
doReadConfiguration
in classAbstractDataSourceManager
- Parameters:
file
- the definitions file.- Returns:
- all definitions.
-
checkParameters
public void checkParameters(Map<String,Object> parameters) throws ItemCheckerTestFailureException
Description copied from class:AbstractDataSourceManager
Checks the parameters of a data source- Specified by:
checkParameters
in classAbstractDataSourceManager
- Parameters:
parameters
- the parameters of the data source- Throws:
ItemCheckerTestFailureException
- if the test failed
-
createDataSource
protected void createDataSource(AbstractDataSourceManager.DataSourceDefinition dataSource)
Description copied from class:AbstractDataSourceManager
Creates a data source from its configuration- Specified by:
createDataSource
in classAbstractDataSourceManager
- Parameters:
dataSource
- the data source configuration
-
deleteDataSource
protected void deleteDataSource(AbstractDataSourceManager.DataSourceDefinition dataSource)
Description copied from class:AbstractDataSourceManager
Deletes a data source- Specified by:
deleteDataSource
in classAbstractDataSourceManager
- Parameters:
dataSource
- the data source configuration
-
editDataSource
protected void editDataSource(AbstractDataSourceManager.DataSourceDefinition dataSource)
Description copied from class:AbstractDataSourceManager
Edit a data source from its configuration- Specified by:
editDataSource
in classAbstractDataSourceManager
- Parameters:
dataSource
- the data source configuration
-
internalSetDefaultDataSource
protected void internalSetDefaultDataSource()
Description copied from class:AbstractDataSourceManager
Set a default data source internally- Specified by:
internalSetDefaultDataSource
in classAbstractDataSourceManager
-
-