* @param tp The timeout parameters
* @param vp The validation parameters
* @return The configuration
*/
protected PoolConfiguration createPoolConfiguration(final CommonPool pp, final CommonTimeOut tp, final CommonValidation vp) {
final PoolConfiguration pc = new PoolConfiguration();
if (pp != null) {
if (pp.getMinPoolSize() != null)
pc.setMinSize(pp.getMinPoolSize().intValue());
if (pp.getMaxPoolSize() != null)
pc.setMaxSize(pp.getMaxPoolSize().intValue());
if (pp.isPrefill() != null)
pc.setPrefill(pp.isPrefill());
if (pp.isUseStrictMin() != null)
pc.setStrictMin(pp.isUseStrictMin());
}
if (tp != null) {
if (tp.getBlockingTimeoutMillis() != null)
pc.setBlockingTimeout(tp.getBlockingTimeoutMillis().longValue());
if (tp.getIdleTimeoutMinutes() != null)
pc.setIdleTimeout(tp.getIdleTimeoutMinutes().longValue());
}
if (vp != null) {
if (vp.isBackgroundValidation() != null)
pc.setBackgroundValidation(vp.isBackgroundValidation().booleanValue());
if (vp.getBackgroundValidationMinutes() != null)
pc.setBackgroundValidationMinutes(vp.getBackgroundValidationMinutes().intValue());
if (vp.isUseFastFail() != null)
pc.setUseFastFail(vp.isUseFastFail());
}
return pc;
}