| | |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.config; |
| | | import org.opends.messages.Message; |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | |
| | | |
| | | |
| | |
| | | * @param isMultiValued Indicates whether this configuration attribute may |
| | | * have multiple values. |
| | | */ |
| | | public ReadOnlyConfigAttribute(String name, Message description, |
| | | public ReadOnlyConfigAttribute(String name, LocalizableMessage description, |
| | | boolean isMultiValued) |
| | | { |
| | | super(name, description, false, isMultiValued, false); |
| | |
| | | * @param description The description for this configuration attribute. |
| | | * @param value The value for this configuration attribute. |
| | | */ |
| | | public ReadOnlyConfigAttribute(String name, Message description, String value) |
| | | public ReadOnlyConfigAttribute(String name, LocalizableMessage description, String value) |
| | | { |
| | | super(name, description, false, false, false, getValueSet(value)); |
| | | |
| | |
| | | * @param description The description for this configuration attribute. |
| | | * @param values The set of values for this configuration attribute. |
| | | */ |
| | | public ReadOnlyConfigAttribute(String name, Message description, |
| | | public ReadOnlyConfigAttribute(String name, LocalizableMessage description, |
| | | List<String> values) |
| | | { |
| | | super(name, description, false, true, false, getValueSet(values)); |
| | |
| | | { |
| | | if ((values == null) || values.isEmpty()) |
| | | { |
| | | Message message = ERR_CONFIG_ATTR_NO_STRING_VALUE.get(getName()); |
| | | LocalizableMessage message = ERR_CONFIG_ATTR_NO_STRING_VALUE.get(getName()); |
| | | throw new ConfigException(message); |
| | | } |
| | | |
| | | if (values.size() > 1) |
| | | { |
| | | Message message = ERR_CONFIG_ATTR_MULTIPLE_STRING_VALUES.get(getName()); |
| | | LocalizableMessage message = ERR_CONFIG_ATTR_MULTIPLE_STRING_VALUES.get(getName()); |
| | | throw new ConfigException(message); |
| | | } |
| | | |
| | |
| | | public void setValue(String value) |
| | | throws ConfigException |
| | | { |
| | | Message message = ERR_CONFIG_ATTR_READ_ONLY.get(getName()); |
| | | LocalizableMessage message = ERR_CONFIG_ATTR_READ_ONLY.get(getName()); |
| | | throw new ConfigException(message); |
| | | } |
| | | |
| | |
| | | public void setValues(List<String> values) |
| | | throws ConfigException |
| | | { |
| | | Message message = ERR_CONFIG_ATTR_READ_ONLY.get(getName()); |
| | | LocalizableMessage message = ERR_CONFIG_ATTR_READ_ONLY.get(getName()); |
| | | throw new ConfigException(message); |
| | | } |
| | | |
| | |
| | | public void setValue(javax.management.Attribute jmxAttribute) |
| | | throws ConfigException |
| | | { |
| | | Message message = ERR_CONFIG_ATTR_READ_ONLY.get(getName()); |
| | | LocalizableMessage message = ERR_CONFIG_ATTR_READ_ONLY.get(getName()); |
| | | throw new ConfigException(message); |
| | | } |
| | | |