| | |
| | | { |
| | | // We cannot have multiple pending value sets. |
| | | LocalizableMessage message = |
| | | ERR_CONFIG_ATTR_MULTIPLE_PENDING_VALUE_SETS.get(a.getName()); |
| | | ERR_CONFIG_ATTR_MULTIPLE_PENDING_VALUE_SETS.get(a.getAttributeDescription().getNameOrOID()); |
| | | throw new ConfigException(message); |
| | | } |
| | | |
| | |
| | | if (isRequired()) |
| | | { |
| | | // This is illegal -- it must have a value. |
| | | LocalizableMessage message = ERR_CONFIG_ATTR_IS_REQUIRED.get(a.getName()); |
| | | LocalizableMessage message = ERR_CONFIG_ATTR_IS_REQUIRED.get(a.getAttributeDescription().getNameOrOID()); |
| | | throw new ConfigException(message); |
| | | } |
| | | else |
| | |
| | | { |
| | | // This is illegal -- the attribute is single-valued. |
| | | LocalizableMessage message = |
| | | ERR_CONFIG_ATTR_SET_VALUES_IS_SINGLE_VALUED.get(a.getName()); |
| | | ERR_CONFIG_ATTR_SET_VALUES_IS_SINGLE_VALUED.get(a.getAttributeDescription().getNameOrOID()); |
| | | throw new ConfigException(message); |
| | | } |
| | | |
| | |
| | | catch (Exception e) |
| | | { |
| | | LocalizableMessage message = ERR_CONFIG_ATTR_INT_COULD_NOT_PARSE.get( |
| | | v, a.getName(), e); |
| | | v, a.getAttributeDescription().getNameOrOID(), e); |
| | | throw new ConfigException(message, e); |
| | | } |
| | | |
| | |
| | | if (hasLowerBound && longValue < lowerBound) |
| | | { |
| | | LocalizableMessage message = ERR_CONFIG_ATTR_INT_BELOW_LOWER_BOUND.get( |
| | | a.getName(), longValue, lowerBound); |
| | | a.getAttributeDescription().getNameOrOID(), longValue, lowerBound); |
| | | throw new ConfigException(message); |
| | | } |
| | | |
| | | if (hasUpperBound && longValue > upperBound) |
| | | { |
| | | LocalizableMessage message = ERR_CONFIG_ATTR_INT_ABOVE_UPPER_BOUND.get( |
| | | a.getName(), longValue, upperBound); |
| | | a.getAttributeDescription().getNameOrOID(), longValue, upperBound); |
| | | throw new ConfigException(message); |
| | | } |
| | | |
| | |
| | | // configuration attributes. |
| | | LocalizableMessage message = |
| | | ERR_CONFIG_ATTR_OPTIONS_NOT_ALLOWED.get( |
| | | a.getName()); |
| | | a.getAttributeDescription().getNameOrOID()); |
| | | throw new ConfigException(message); |
| | | } |
| | | } |
| | |
| | | { |
| | | // We cannot have multiple active value sets. |
| | | LocalizableMessage message = |
| | | ERR_CONFIG_ATTR_MULTIPLE_ACTIVE_VALUE_SETS.get(a.getName()); |
| | | ERR_CONFIG_ATTR_MULTIPLE_ACTIVE_VALUE_SETS.get(a.getAttributeDescription().getNameOrOID()); |
| | | throw new ConfigException(message); |
| | | } |
| | | |
| | |
| | | if (isRequired()) |
| | | { |
| | | // This is illegal -- it must have a value. |
| | | LocalizableMessage message = ERR_CONFIG_ATTR_IS_REQUIRED.get(a.getName()); |
| | | LocalizableMessage message = ERR_CONFIG_ATTR_IS_REQUIRED.get(a.getAttributeDescription().getNameOrOID()); |
| | | throw new ConfigException(message); |
| | | } |
| | | else |
| | |
| | | { |
| | | // This is illegal -- the attribute is single-valued. |
| | | LocalizableMessage message = |
| | | ERR_CONFIG_ATTR_SET_VALUES_IS_SINGLE_VALUED.get(a.getName()); |
| | | ERR_CONFIG_ATTR_SET_VALUES_IS_SINGLE_VALUED.get(a.getAttributeDescription().getNameOrOID()); |
| | | throw new ConfigException(message); |
| | | } |
| | | |
| | |
| | | catch (Exception e) |
| | | { |
| | | LocalizableMessage message = ERR_CONFIG_ATTR_INT_COULD_NOT_PARSE.get( |
| | | v, a.getName(), e); |
| | | v, a.getAttributeDescription().getNameOrOID(), e); |
| | | throw new ConfigException(message, e); |
| | | } |
| | | |
| | |
| | | if (hasLowerBound && longValue < lowerBound) |
| | | { |
| | | LocalizableMessage message = ERR_CONFIG_ATTR_INT_BELOW_LOWER_BOUND.get( |
| | | a.getName(), longValue, lowerBound); |
| | | a.getAttributeDescription().getNameOrOID(), longValue, lowerBound); |
| | | throw new ConfigException(message); |
| | | } |
| | | |
| | | if (hasUpperBound && longValue > upperBound) |
| | | { |
| | | LocalizableMessage message = ERR_CONFIG_ATTR_INT_ABOVE_UPPER_BOUND.get( |
| | | a.getName(), longValue, upperBound); |
| | | a.getAttributeDescription().getNameOrOID(), longValue, upperBound); |
| | | throw new ConfigException(message); |
| | | } |
| | | |