From 4ed3b08887c800fb6f02ecc90df9092691b78208 Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Wed, 30 Mar 2016 08:51:11 +0000
Subject: [PATCH] Prep work for OPENDJ-2803 Migrate Attribute
---
opendj-server-legacy/src/main/java/org/opends/server/config/DNConfigAttribute.java | 20 ++++++++------------
1 files changed, 8 insertions(+), 12 deletions(-)
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/config/DNConfigAttribute.java b/opendj-server-legacy/src/main/java/org/opends/server/config/DNConfigAttribute.java
index 34e528e..5208045 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/config/DNConfigAttribute.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/config/DNConfigAttribute.java
@@ -33,10 +33,10 @@
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
@@ -710,9 +710,7 @@
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));
}
@@ -721,7 +719,7 @@
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);
@@ -732,7 +730,7 @@
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);
@@ -759,8 +757,7 @@
{
// 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
@@ -769,8 +766,7 @@
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));
}
@@ -779,7 +775,7 @@
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);
@@ -790,7 +786,7 @@
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);
--
Gitblit v1.10.0