| | |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.forgerock.opendj.ldap.AttributeDescription; |
| | | import org.forgerock.opendj.ldap.ByteString; |
| | | import org.forgerock.opendj.ldap.DN; |
| | | import org.forgerock.opendj.ldap.schema.Syntax; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.types.Attribute; |
| | | import org.forgerock.opendj.ldap.DN; |
| | | |
| | | /** |
| | | * This class defines a DN configuration attribute, which can hold zero or more |
| | |
| | | if (pendingValues != null) |
| | | { |
| | | // We cannot have multiple pending value sets. |
| | | LocalizableMessage message = |
| | | ERR_CONFIG_ATTR_MULTIPLE_PENDING_VALUE_SETS.get(attrDesc.getNameOrOID()); |
| | | throw new ConfigException(message); |
| | | throw new ConfigException(ERR_CONFIG_ATTR_MULTIPLE_PENDING_VALUE_SETS.get(attrDesc)); |
| | | } |
| | | |
| | | |
| | |
| | | if (isRequired()) |
| | | { |
| | | // This is illegal -- it must have a value. |
| | | throw new ConfigException(ERR_CONFIG_ATTR_IS_REQUIRED.get(attrDesc.getNameOrOID())); |
| | | throw new ConfigException(ERR_CONFIG_ATTR_IS_REQUIRED.get(attrDesc)); |
| | | } |
| | | // This is fine. The pending value set can be empty. |
| | | pendingValues = new ArrayList<>(0); |
| | |
| | | if (numValues > 1 && !isMultiValued()) |
| | | { |
| | | // This is illegal -- the attribute is single-valued. |
| | | throw new ConfigException(ERR_CONFIG_ATTR_SET_VALUES_IS_SINGLE_VALUED.get(attrDesc.getNameOrOID())); |
| | | throw new ConfigException(ERR_CONFIG_ATTR_SET_VALUES_IS_SINGLE_VALUED.get(attrDesc)); |
| | | } |
| | | |
| | | pendingValues = new ArrayList<>(numValues); |
| | |
| | | { |
| | | // This is illegal -- only the pending option is allowed for |
| | | // configuration attributes. |
| | | throw new ConfigException( |
| | | ERR_CONFIG_ATTR_OPTIONS_NOT_ALLOWED.get(attrDesc.getNameOrOID())); |
| | | throw new ConfigException(ERR_CONFIG_ATTR_OPTIONS_NOT_ALLOWED.get(attrDesc)); |
| | | } |
| | | } |
| | | else |
| | |
| | | if (activeValues!= null) |
| | | { |
| | | // We cannot have multiple active value sets. |
| | | throw new ConfigException( |
| | | ERR_CONFIG_ATTR_MULTIPLE_ACTIVE_VALUE_SETS.get(attrDesc.getNameOrOID())); |
| | | throw new ConfigException(ERR_CONFIG_ATTR_MULTIPLE_ACTIVE_VALUE_SETS.get(attrDesc)); |
| | | } |
| | | |
| | | |
| | |
| | | if (isRequired()) |
| | | { |
| | | // This is illegal -- it must have a value. |
| | | throw new ConfigException(ERR_CONFIG_ATTR_IS_REQUIRED.get(attrDesc.getNameOrOID())); |
| | | throw new ConfigException(ERR_CONFIG_ATTR_IS_REQUIRED.get(attrDesc)); |
| | | } |
| | | // This is fine. The active value set can be empty. |
| | | activeValues = new ArrayList<>(0); |
| | |
| | | if (numValues > 1 && !isMultiValued()) |
| | | { |
| | | // This is illegal -- the attribute is single-valued. |
| | | throw new ConfigException(ERR_CONFIG_ATTR_SET_VALUES_IS_SINGLE_VALUED.get(attrDesc.getNameOrOID())); |
| | | throw new ConfigException(ERR_CONFIG_ATTR_SET_VALUES_IS_SINGLE_VALUED.get(attrDesc)); |
| | | } |
| | | |
| | | activeValues = new ArrayList<>(numValues); |