if (validConnectionChecker.getClassName() != null) { managedConnectionFactory.setValidConnectionCheckerClassName(validConnectionChecker.getClassName()); if (validConnectionChecker.getConfigPropertiesMap() != null) { managedConnectionFactory .setValidConnectionCheckerProperties(buildConfigPropsString(validConnectionChecker .getConfigPropertiesMap())); if (exceptionSorter.getClassName() != null) { managedConnectionFactory.setExceptionSorterClassName(exceptionSorter.getClassName()); if (exceptionSorter.getConfigPropertiesMap() != null) { managedConnectionFactory.setExceptionSorterProperties(buildConfigPropsString(exceptionSorter .getConfigPropertiesMap())); if (staleConnectionChecker.getClassName() != null) { managedConnectionFactory.setStaleConnectionCheckerClassName(staleConnectionChecker.getClassName()); if (staleConnectionChecker.getConfigPropertiesMap() != null) { managedConnectionFactory .setStaleConnectionCheckerProperties(buildConfigPropsString(staleConnectionChecker .getConfigPropertiesMap()));
public static Extension extractExtension(final OperationContext operationContext, final ModelNode dataSourceNode, final SimpleAttributeDefinition className, final PropertiesAttributeDefinition propertyName) throws ValidateException, OperationFailedException { if (dataSourceNode.hasDefined(className.getName())) { String exceptionSorterClassName = getResolvedStringIfSetOrGetDefault(operationContext, dataSourceNode, className); Map<String, String> unwrapped = propertyName.unwrap(operationContext, dataSourceNode); Map<String, String> exceptionSorterProperty = unwrapped.size() > 0 ? unwrapped : null; return new Extension(exceptionSorterClassName, exceptionSorterProperty); } else { return null; } }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (!(obj instanceof Capacity)) return false; Capacity other = (Capacity) obj; if (incrementer == null) { if (other.incrementer != null) return false; } else if (!incrementer.equals(other.incrementer)) return false; if (decrementer == null) { if (other.decrementer != null) return false; } else if (!decrementer.equals(other.decrementer)) return false; return true; }
/** * Create a new JdbcAdapterExtension. * * @param className the className * @param configPropertiesMap configPropertiesMap * @throws ValidateException ValidateException */ public Extension(String className, Map<String, String> configPropertiesMap) throws ValidateException { super(); this.className = className; if (configPropertiesMap != null) { this.configPropertiesMap = new HashMap<String, String>(configPropertiesMap.size()); this.configPropertiesMap.putAll(configPropertiesMap); } else { this.configPropertiesMap = Collections.emptyMap(); } this.validate(); }
/** * {@inheritDoc} */ public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ((checkValidConnectionSql == null) ? 0 : checkValidConnectionSql.hashCode()); result = prime * result + ((exceptionSorter == null) ? 0 : exceptionSorter.hashCode()); result = prime * result + ((staleConnectionChecker == null) ? 0 : staleConnectionChecker.hashCode()); result = prime * result + ((validConnectionChecker == null) ? 0 : validConnectionChecker.hashCode()); return result; }
return false; else if (!recoverPlugin.equals(other.recoverPlugin)) return false; if (credential == null)
setStringIfNotNull(context, dataSource.getPool().getCapacity().getIncrementer().getClassName()); } else if (attributeName.equals(org.jboss.as.connector.subsystems.common.pool.Constants.CAPACITY_DECREMENTER_CLASS.getName())) { if (dataSource.getPool() == null || dataSource.getPool().getCapacity() == null || dataSource.getPool().getCapacity().getDecrementer() == null) { return; setStringIfNotNull(context, dataSource.getPool().getCapacity().getDecrementer().getClassName()); final Map<String, String> propertiesMap = pool.getCapacity().getIncrementer().getConfigPropertiesMap(); if (propertiesMap == null) { return; final Map<String, String> propertiesMap = pool.getCapacity().getDecrementer().getConfigPropertiesMap(); if (propertiesMap == null) { return; setStringIfNotNull(context, dataSource.getSecurity().getReauthPlugin().getClassName()); } else if (attributeName.equals(Constants.REAUTHPLUGIN_PROPERTIES.getName())) { if (dataSource.getSecurity() == null) { final Map<String, String> propertiesMap = dataSource.getSecurity().getReauthPlugin().getConfigPropertiesMap(); if (propertiesMap == null) { return; setStringIfNotNull(context, dataSource.getValidation().getExceptionSorter().getClassName()); } else if (attributeName.equals(Constants.EXCEPTION_SORTER_PROPERTIES.getName())) { if (dataSource.getValidation() == null) { final Map<String, String> propertiesMap = dataSource.getValidation().getExceptionSorter().getConfigPropertiesMap(); if (propertiesMap == null) {
@Override public Validation getValidationFor(Map<String, Object> config) throws Exception { Boolean backgroundValidation = false; Long backgroundValidationMillis = 0L; Boolean useFastFail = false; Extension validConnectionChecker = new Extension( "org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker", null ); String checkValidConnectionSql = null; Boolean validateOnMatch = false; Extension staleConnectionChecker = null; Extension exceptionSorter = new Extension( "org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLExceptionSorter", null ); return new ValidationImpl( backgroundValidation, backgroundValidationMillis, useFastFail, validConnectionChecker, checkValidConnectionSql, validateOnMatch, staleConnectionChecker, exceptionSorter ); }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((noRecovery == null) ? 0 : noRecovery.hashCode()); result = prime * result + ((recoverPlugin == null) ? 0 : recoverPlugin.hashCode()); result = prime * result + ((credential == null) ? 0 : credential.hashCode()); return result; }
return false; else if (!exceptionSorter.equals(other.exceptionSorter)) return false; if (staleConnectionChecker == null) return false; else if (!staleConnectionChecker.equals(other.staleConnectionChecker)) return false; if (validConnectionChecker == null) return false; else if (!validConnectionChecker.equals(other.validConnectionChecker)) return false; return true;
if (pool.getCapacity() != null) { if (pool.getCapacity().getIncrementer() != null) { setAttribute(model, CAPACITY_INCREMENTER_CLASS, pool.getCapacity().getIncrementer().getClassName()); if (pool.getCapacity().getIncrementer().getConfigPropertiesMap() != null) { for (Map.Entry<String, String> config : pool.getCapacity().getIncrementer().getConfigPropertiesMap().entrySet()) { model.get(CAPACITY_INCREMENTER_PROPERTIES.getName(), config.getKey()).set(config.getValue()); setAttribute(model, CAPACITY_DECREMENTER_CLASS, pool.getCapacity().getDecrementer().getClassName()); if (pool.getCapacity().getDecrementer().getConfigPropertiesMap() != null) { for (Map.Entry<String, String> config : pool.getCapacity().getDecrementer().getConfigPropertiesMap().entrySet()) { model.get(CAPACITY_DECREMENTER_PROPERTIES.getName(), config.getKey()).set(config.getValue()); final Extension recoverPlugin = recovery.getRecoverPlugin(); if (recoverPlugin != null) { setAttribute(model, RECOVERLUGIN_CLASSNAME, recoverPlugin.getClassName()); if (recoverPlugin.getConfigPropertiesMap() != null) { for (Map.Entry<String, String> config : recoverPlugin.getConfigPropertiesMap().entrySet()) { model.get(RECOVERLUGIN_PROPERTIES.getName(), config.getKey()).set(config.getValue());
public static Extension extractExtension(final OperationContext operationContext, final ModelNode dataSourceNode, final SimpleAttributeDefinition className, final PropertiesAttributeDefinition propertyName) throws ValidateException, OperationFailedException { if (dataSourceNode.hasDefined(className.getName())) { String exceptionSorterClassName = getResolvedStringIfSetOrGetDefault(operationContext, dataSourceNode, className); Map<String, String> unwrapped = propertyName.unwrap(operationContext, dataSourceNode); Map<String, String> exceptionSorterProperty = unwrapped.size() > 0 ? unwrapped : null; return new Extension(exceptionSorterClassName, exceptionSorterProperty); } else { return null; } }
/** * {@inheritDoc} */ public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ((allowMultipleUsers == null) ? 0 : allowMultipleUsers.hashCode()); result = prime * result + ((connectionListener == null) ? 7 : 7 * connectionListener.hashCode()); return result; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (!(obj instanceof DsSecurityImpl)) return false; DsSecurityImpl other = (DsSecurityImpl) obj; if (reauthPlugin == null) { if (other.reauthPlugin != null) return false; } else if (!reauthPlugin.equals(other.reauthPlugin)) return false; return true; }
setStringIfNotNull(context, dataSource.getXaPool().getCapacity().getIncrementer().getClassName()); } else if (attributeName.equals(org.jboss.as.connector.subsystems.common.pool.Constants.CAPACITY_DECREMENTER_CLASS.getName())) { if (dataSource.getXaPool() == null || dataSource.getXaPool().getCapacity() == null || dataSource.getXaPool().getCapacity().getDecrementer() == null) { return; setStringIfNotNull(context, dataSource.getXaPool().getCapacity().getDecrementer().getClassName()); final Map<String, String> propertiesMap = pool.getCapacity().getIncrementer().getConfigPropertiesMap(); if (propertiesMap == null) { return; final Map<String, String> propertiesMap = pool.getCapacity().getDecrementer().getConfigPropertiesMap(); if (propertiesMap == null) { return; setStringIfNotNull(context, dataSource.getRecovery().getRecoverPlugin().getClassName()); } else if (attributeName.equals(Constants.RECOVER_PLUGIN_PROPERTIES.getName())) { if(dataSource.getRecovery() == null) { final Map<String, String> propertiesMap = dataSource.getRecovery().getRecoverPlugin().getConfigPropertiesMap(); if (propertiesMap == null) { return; setStringIfNotNull(context, dataSource.getValidation().getExceptionSorter().getClassName()); } else if (attributeName.equals(Constants.EXCEPTION_SORTER_PROPERTIES.getName())) { if (dataSource.getValidation() == null) { final Map<String, String> propertiesMap = dataSource.getValidation().getExceptionSorter().getConfigPropertiesMap(); if (propertiesMap == null) {
public static Extension extractExtension(final OperationContext operationContext, final ModelNode dataSourceNode, final SimpleAttributeDefinition className, final PropertiesAttributeDefinition propertyName) throws ValidateException, OperationFailedException { if (dataSourceNode.hasDefined(className.getName())) { String exceptionSorterClassName = getResolvedStringIfSetOrGetDefault(operationContext, dataSourceNode, className); Map<String, String> unwrapped = propertyName.unwrap(operationContext, dataSourceNode); Map<String, String> exceptionSorterProperty = unwrapped.size() > 0 ? unwrapped : null; return new Extension(exceptionSorterClassName, exceptionSorterProperty); } else { return null; } } }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ((reauthPlugin == null) ? 0 : reauthPlugin.hashCode()); return result; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (!(obj instanceof DsXaPoolImpl)) return false; if (!super.equals(obj)) return false; DsXaPoolImpl other = (DsXaPoolImpl) obj; if (allowMultipleUsers == null) { if (other.allowMultipleUsers != null) return false; } else if (!allowMultipleUsers.equals(other.allowMultipleUsers)) return false; if (connectionListener == null) { if (other.connectionListener != null) return false; } else if (!connectionListener.equals(other.connectionListener)) return false; return true; }