Package net.shibboleth.idp.attribute.resolver.dc.rdbms.impl

# Class DataSourceValidator

java.lang.Object
net.shibboleth.idp.attribute.resolver.dc.rdbms.impl.DataSourceValidator

All Implemented Interfaces:
  `Validator`

public class DataSourceValidator extends Object implements Validator
Validator implementation that invokes `DataSource.getConnection()` to determine if the DataSource is properly configured.

## Field Summary

Fields
Modifier and Type
Field
Description
`private final org.slf4j.Logger`
`log`
Class logger.
`private boolean`
`throwOnValidateError`
Whether validate should throw, default value is `true`.

## Constructor Summary

Constructors
Constructor
Description
`DataSourceValidator()`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`isThrowValidateError()`
Returns whether `Validator.validate(DataConnector)` should throw or log errors.
`void`
`setThrowValidateError(boolean value)`
Sets whether `Validator.validate(DataConnector)` should throw or log errors.
`void`
`validate(DataConnector dataConnector)`
Probe the data connector and conditionally fails if it is not valid and ready for use.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### log

@Nonnull private final org.slf4j.Logger log
Class logger.

### throwOnValidateError

private boolean throwOnValidateError
Whether validate should throw, default value is `true`.

## Constructor Details

### DataSourceValidator

public DataSourceValidator()

## Method Details

### setThrowValidateError

public void setThrowValidateError(boolean value)
Sets whether `Validator.validate(DataConnector)` should throw or log errors.

Specified by:
  `setThrowValidateError` in interface `Validator`
Parameters:
  `value` - whether `Validator.validate(DataConnector)` should throw or log errors

### isThrowValidateError

public boolean isThrowValidateError()
Returns whether `Validator.validate(DataConnector)` should throw or log errors.

Specified by:
  `isThrowValidateError` in interface `Validator`
Returns:
  whether `Validator.validate(DataConnector)` should throw or log errors

### validate

public void validate(@Nonnull DataConnector dataConnector) throws ValidationException
Probe the data connector and conditionally fails if it is not valid and ready for use.

Specified by:
  `validate` in interface `Validator`
Parameters:
  `dataConnector` - data connector to validate
Throws:
  `ValidationException` - thrown if validation fails and `Validator.isThrowValidateError()` is true