Package org.ametys.core.datasource
Class SQLDatabaseTypeValidator
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.ametys.runtime.parameter.DefaultValidator
-
- org.ametys.core.datasource.SQLDatabaseTypeValidator
-
- All Implemented Interfaces:
Validator
,PluginAware
,Configurable
,LogEnabled
,Serviceable
public class SQLDatabaseTypeValidator extends DefaultValidator
This validator validates that a type of SQL data sources is an authorized database type
-
-
Field Summary
Fields Modifier and Type Field Description private Set<String>
_allowedDbTypes
-
Fields inherited from class org.ametys.runtime.parameter.DefaultValidator
_invalidText, _isMandatory, _pluginName, _regexp, _smanager
-
-
Constructor Summary
Constructors Constructor Description SQLDatabaseTypeValidator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private boolean
_isValidDatasource(String dataSourceId)
private void
_validateDataSource(String dataSourceId, Errors errors)
void
configure(Configuration configuration)
boolean
equals(Object obj)
Map<String,Object>
getConfiguration()
Retrieves the configuration of the validator.int
hashCode()
protected void
validateArrayValues(Object[] values, Errors errors)
Validates a array of values.protected void
validateSingleValue(Object value, Errors errors)
Validates a single value.-
Methods inherited from class org.ametys.runtime.parameter.DefaultValidator
service, setPluginInfo, validate
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Field Detail
-
_allowedDbTypes
private Set<String> _allowedDbTypes
-
-
Constructor Detail
-
SQLDatabaseTypeValidator
public SQLDatabaseTypeValidator()
-
-
Method Detail
-
configure
public void configure(Configuration configuration) throws ConfigurationException
- Specified by:
configure
in interfaceConfigurable
- Overrides:
configure
in classDefaultValidator
- Throws:
ConfigurationException
-
validateSingleValue
protected void validateSingleValue(Object value, Errors errors)
Validates a single value.- Overrides:
validateSingleValue
in classDefaultValidator
- Parameters:
value
- the value to validate (can benull
).errors
- the structure to populate if the validation failed.
-
validateArrayValues
protected void validateArrayValues(Object[] values, Errors errors)
Description copied from class:DefaultValidator
Validates a array of values.- Overrides:
validateArrayValues
in classDefaultValidator
- Parameters:
values
- the values to validateerrors
- the structure to populate if the validation failed.
-
_validateDataSource
private void _validateDataSource(String dataSourceId, Errors errors)
-
_isValidDatasource
private boolean _isValidDatasource(String dataSourceId)
-
getConfiguration
public Map<String,Object> getConfiguration()
Description copied from interface:Validator
Retrieves the configuration of the validator.- Specified by:
getConfiguration
in interfaceValidator
- Overrides:
getConfiguration
in classDefaultValidator
- Returns:
- a map containing the configuration information.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classDefaultValidator
-
equals
public boolean equals(Object obj)
- Overrides:
equals
in classDefaultValidator
-
-