/* Check that the properties have valid names and values. */
Enumeration propNames = props.propertyNames();
while (propNames.hasMoreElements()) {
String name = (String) propNames.nextElement();
/* Is this a valid property name? */
ConfigParam param =
EnvironmentParams.SUPPORTED_PARAMS.get(name);
if (param == null) {
/* See if the parameter is an multi-value parameter. */
String mvParamName = ConfigParam.multiValueParamName(name);
param = EnvironmentParams.SUPPORTED_PARAMS.get(mvParamName);
if (param == null) {
throw new IllegalArgumentException
(name +
" is not a valid BDBJE environment configuration");
}
}
/*
* Only verify that the parameter is "for replication" if this is
* being validated on behalf of a FooConfig class, not a
* je.properties file.
*/
if (configClassName != null) {
/* We're validating a config instance, not a file. */
if (isRepConfigInstance) {
if (!param.isForReplication()) {
throw new IllegalArgumentException
(name +
" is not a replication parameter and cannot " +
" be set through " + configClassName);
}
} else {
if (param.isForReplication()) {
throw new IllegalArgumentException
(name +
" is a replication parameter and cannot be set " +
" through " + configClassName);
}
}
}
/* Is this a valid property value? */
param.validateValue(props.getProperty(name));
}
}