return;
}
setStringIfNotNull(context, dataSource.getPool().getCapacity().getDecrementer().getClassName());
} else if (attributeName.equals(org.jboss.as.connector.subsystems.common.pool.Constants.CAPACITY_INCREMENTER_PROPERTIES.getName())) {
Pool pool = dataSource.getPool();
if (pool == null || ((DsPool) pool).getCapacity() == null || ((DsPool) pool).getCapacity().getIncrementer() == null)
return;
final Map<String, String> propertiesMap = ((DsPool) pool).getCapacity().getIncrementer().getConfigPropertiesMap();
if (propertiesMap == null) {
return;
}
for (final Map.Entry<String, String> entry : propertiesMap.entrySet()) {
context.getResult().asPropertyList().add(new ModelNode().set(entry.getKey(), entry.getValue()).asProperty());
}
} else if (attributeName.equals(org.jboss.as.connector.subsystems.common.pool.Constants.CAPACITY_DECREMENTER_PROPERTIES.getName())) {
Pool pool = dataSource.getPool();
if (pool == null || ((DsPool) pool).getCapacity() == null || ((DsPool) pool).getCapacity().getDecrementer() == null)
return;
final Map<String, String> propertiesMap = ((DsPool) pool).getCapacity().getDecrementer().getConfigPropertiesMap();
if (propertiesMap == null) {
return;
}
for (final Map.Entry<String, String> entry : propertiesMap.entrySet()) {
context.getResult().asPropertyList().add(new ModelNode().set(entry.getKey(), entry.getValue()).asProperty());
}
} else if (attributeName.equals(Constants.USERNAME.getName())) {
if (dataSource.getSecurity() == null) {
return;
}
setStringIfNotNull(context, dataSource.getSecurity().getUserName());
} else if (attributeName.equals(Constants.PASSWORD.getName())) {
//don't give out the password
} else if (attributeName.equals(Constants.SECURITY_DOMAIN.getName())) {
if (dataSource.getSecurity() == null) {
return;
}
setStringIfNotNull(context, dataSource.getSecurity().getSecurityDomain());
} else if (attributeName.equals(Constants.REAUTH_PLUGIN_CLASSNAME.getName())) {
if (dataSource.getSecurity() == null) {
return;
}
if (dataSource.getSecurity().getReauthPlugin() == null) {
return;
}
setStringIfNotNull(context, dataSource.getSecurity().getReauthPlugin().getClassName());
} else if (attributeName.equals(Constants.REAUTHPLUGIN_PROPERTIES.getName())) {
if (dataSource.getSecurity() == null) {
return;
}
if (dataSource.getSecurity().getReauthPlugin() == null) {
return;
}
final Map<String, String> propertiesMap = dataSource.getSecurity().getReauthPlugin().getConfigPropertiesMap();
if (propertiesMap == null) {
return;
}
for (final Map.Entry<String, String> entry : propertiesMap.entrySet()) {
context.getResult().asPropertyList().add(new ModelNode().set(entry.getKey(), entry.getValue()).asProperty());
}
} else if (attributeName.equals(org.jboss.as.connector.subsystems.common.pool.Constants.POOL_FLUSH_STRATEGY.getName())) {
if (dataSource.getPool() == null) {
return;
}
setStringIfNotNull(context, dataSource.getPool().getFlushStrategy().getName());
} else if (attributeName.equals(Constants.PREPARED_STATEMENTS_CACHE_SIZE.getName())) {
if (dataSource.getStatement() == null) {
return;
}
setLongIfNotNull(context, dataSource.getStatement().getPreparedStatementsCacheSize());
} else if (attributeName.equals(Constants.SHARE_PREPARED_STATEMENTS.getName())) {
if (dataSource.getStatement() == null) {
return;
}
setBooleanIfNotNull(context, dataSource.getStatement().isSharePreparedStatements());
} else if (attributeName.equals(Constants.TRACK_STATEMENTS.getName())) {
if (dataSource.getStatement() == null) {
return;
}
if (dataSource.getStatement().getTrackStatements() == null) {
return;
}
setStringIfNotNull(context, dataSource.getStatement().getTrackStatements().name());
} else if (attributeName.equals(Constants.ALLOCATION_RETRY.getName())) {
if (dataSource.getTimeOut() == null) {
return;
}
setIntIfNotNull(context, dataSource.getTimeOut().getAllocationRetry());
} else if (attributeName.equals(Constants.ALLOCATION_RETRY_WAIT_MILLIS.getName())) {
if (dataSource.getTimeOut() == null) {
return;
}
setLongIfNotNull(context, dataSource.getTimeOut().getAllocationRetryWaitMillis());
} else if (attributeName.equals(org.jboss.as.connector.subsystems.common.pool.Constants.BLOCKING_TIMEOUT_WAIT_MILLIS.getName())) {
if (dataSource.getTimeOut() == null) {
return;
}
setLongIfNotNull(context, dataSource.getTimeOut().getBlockingTimeoutMillis());
} else if (attributeName.equals(org.jboss.as.connector.subsystems.common.pool.Constants.IDLETIMEOUTMINUTES.getName())) {
if (dataSource.getTimeOut() == null) {
return;
}
setLongIfNotNull(context, dataSource.getTimeOut().getIdleTimeoutMinutes());
} else if (attributeName.equals(Constants.QUERY_TIMEOUT.getName())) {
if (dataSource.getTimeOut() == null) {
return;
}
setLongIfNotNull(context, dataSource.getTimeOut().getQueryTimeout());
} else if (attributeName.equals(Constants.USE_TRY_LOCK.getName())) {
if (dataSource.getTimeOut() == null) {
return;
}
setLongIfNotNull(context, dataSource.getTimeOut().getUseTryLock());
} else if (attributeName.equals(Constants.SET_TX_QUERY_TIMEOUT.getName())) {
if (dataSource.getTimeOut() == null) {
return;
}
setBooleanIfNotNull(context, dataSource.getTimeOut().isSetTxQueryTimeout());
} else if (attributeName.equals(Constants.TRANSACTION_ISOLATION.getName())) {
if (dataSource.getTransactionIsolation() == null) {
return;
}
setStringIfNotNull(context, dataSource.getTransactionIsolation().name());
} else if (attributeName.equals(Constants.CHECK_VALID_CONNECTION_SQL.getName())) {
if (dataSource.getValidation() == null) {
return;
}
setStringIfNotNull(context, dataSource.getValidation().getCheckValidConnectionSql());
} else if (attributeName.equals(Constants.EXCEPTION_SORTER_CLASSNAME.getName())) {
if (dataSource.getValidation() == null) {
return;
}
if (dataSource.getValidation().getExceptionSorter() == null) {
return;
}
setStringIfNotNull(context, dataSource.getValidation().getExceptionSorter().getClassName());
} else if (attributeName.equals(Constants.EXCEPTION_SORTER_PROPERTIES.getName())) {
if (dataSource.getValidation() == null) {
return;
}
if (dataSource.getValidation().getExceptionSorter() == null) {
return;
}
final Map<String, String> propertiesMap = dataSource.getValidation().getExceptionSorter().getConfigPropertiesMap();
if (propertiesMap == null) {
return;
}
for (final Map.Entry<String, String> entry : propertiesMap.entrySet()) {
context.getResult().asPropertyList().add(new ModelNode().set(entry.getKey(), entry.getValue()).asProperty());
}
} else if (attributeName.equals(Constants.STALE_CONNECTION_CHECKER_CLASSNAME.getName())) {
if (dataSource.getValidation() == null) {
return;
}
if (dataSource.getValidation().getStaleConnectionChecker() == null) {
return;
}
setStringIfNotNull(context, dataSource.getValidation().getStaleConnectionChecker().getClassName());
} else if (attributeName.equals(Constants.STALE_CONNECTION_CHECKER_PROPERTIES.getName())) {
if (dataSource.getValidation() == null) {
return;
}
if (dataSource.getValidation().getStaleConnectionChecker() == null) {
return;
}
final Map<String, String> propertiesMap = dataSource.getValidation().getStaleConnectionChecker().getConfigPropertiesMap();
if (propertiesMap == null) {
return;
}
for (final Map.Entry<String, String> entry : propertiesMap.entrySet()) {
context.getResult().asPropertyList().add(new ModelNode().set(entry.getKey(), entry.getValue()).asProperty());
}
} else if (attributeName.equals(Constants.VALID_CONNECTION_CHECKER_CLASSNAME.getName())) {
if (dataSource.getValidation() == null) {
return;
}
if (dataSource.getValidation().getValidConnectionChecker() == null) {
return;
}
setStringIfNotNull(context, dataSource.getValidation().getValidConnectionChecker().getClassName());
} else if (attributeName.equals(Constants.VALID_CONNECTION_CHECKER_PROPERTIES.getName())) {
if (dataSource.getValidation() == null) {
return;
}
if (dataSource.getValidation().getValidConnectionChecker() == null) {
return;
}
final Map<String, String> propertiesMap = dataSource.getValidation().getValidConnectionChecker().getConfigPropertiesMap();
if (propertiesMap == null) {
return;
}
for (final Map.Entry<String, String> entry : propertiesMap.entrySet()) {
context.getResult().asPropertyList().add(new ModelNode().set(entry.getKey(), entry.getValue()).asProperty());
}
} else if (attributeName.equals(org.jboss.as.connector.subsystems.common.pool.Constants.BACKGROUNDVALIDATIONMILLIS.getName())) {
if (dataSource.getValidation() == null) {
return;
}
setLongIfNotNull(context, dataSource.getValidation().getBackgroundValidationMillis());
} else if (attributeName.equals(org.jboss.as.connector.subsystems.common.pool.Constants.BACKGROUNDVALIDATION.getName())) {
if (dataSource.getValidation() == null) {
return;
}
setBooleanIfNotNull(context, dataSource.getValidation().isBackgroundValidation());
} else if (attributeName.equals(org.jboss.as.connector.subsystems.common.pool.Constants.USE_FAST_FAIL.getName())) {
if (dataSource.getValidation() == null) {
return;
}
setBooleanIfNotNull(context, dataSource.getValidation().isUseFastFail());
} else if (attributeName.equals(Constants.VALIDATE_ON_MATCH.getName())) {
if (dataSource.getValidation() == null) {
return;
}
setBooleanIfNotNull(context, dataSource.getValidation().isValidateOnMatch());
} else if (attributeName.equals(Constants.SPY.getName())) {
setBooleanIfNotNull(context, dataSource.isSpy());
} else if (attributeName.equals(Constants.USE_CCM.getName())) {
setBooleanIfNotNull(context, dataSource.isUseCcm());
} else if (attributeName.equals(Constants.ALLOW_MULTIPLE_USERS.getName())) {
Pool pool = dataSource.getPool();
if (!(pool instanceof DsPool)) {
return;
}
setBooleanIfNotNull(context, ((DsPool) pool).isAllowMultipleUsers());
} else if (attributeName.equals(Constants.CONNECTION_LISTENER_CLASS.getName())) {
Pool pool = dataSource.getPool();
if (!(pool instanceof DsPool) || ((DsPool) pool).getConnectionListener() == null) {
return;
}
setStringIfNotNull(context, ((DsPool) pool).getConnectionListener().getClassName());
} else if (attributeName.equals(Constants.CONNECTION_LISTENER_PROPERTIES.getName())) {
Pool pool = dataSource.getPool();
if (!(pool instanceof DsPool) || ((DsPool) pool).getConnectionListener() == null) {
return;
}
final Map<String, String> propertiesMap = ((DsPool) pool).getConnectionListener().getConfigPropertiesMap();
if (propertiesMap == null) {