From 758fa048a39b3c362776400a9373ebeef86700af Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Thu, 04 Feb 2016 16:43:42 +0000
Subject: [PATCH] Removed Attribute.getOptions()
---
opendj-server-legacy/src/main/java/org/opends/server/util/LDIFReader.java | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/util/LDIFReader.java b/opendj-server-legacy/src/main/java/org/opends/server/util/LDIFReader.java
index 367c482..d1c2f61 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/util/LDIFReader.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/util/LDIFReader.java
@@ -47,9 +47,11 @@
import org.forgerock.i18n.LocalizableMessage;
import org.forgerock.i18n.LocalizableMessageBuilder;
import org.forgerock.i18n.slf4j.LocalizedLogger;
+import org.forgerock.opendj.ldap.AttributeDescription;
import org.forgerock.opendj.ldap.ByteString;
import org.forgerock.opendj.ldap.ByteStringBuilder;
import org.forgerock.opendj.ldap.ModificationType;
+import org.forgerock.opendj.ldap.schema.AttributeType;
import org.opends.server.api.plugin.PluginResult;
import org.opends.server.core.DirectoryServer;
import org.opends.server.core.PluginConfigManager;
@@ -58,7 +60,6 @@
import org.opends.server.types.AcceptRejectWarn;
import org.opends.server.types.Attribute;
import org.opends.server.types.AttributeBuilder;
-import org.forgerock.opendj.ldap.schema.AttributeType;
import org.opends.server.types.Attributes;
import org.opends.server.types.DN;
import org.opends.server.types.DirectoryException;
@@ -799,7 +800,9 @@
int colonPos = parseColonPosition(lines, line);
String attrDescr = line.substring(0, colonPos);
final Attribute attribute = parseAttrDescription(attrDescr);
- final String attrName = attribute.getName();
+ final AttributeDescription attrDesc = attribute.getAttributeDescription();
+ final AttributeType attrType = attrDesc.getAttributeType();
+ final String attrName = attrType.getNameOrOID();
// Now parse the attribute value.
ByteString value = parseSingleValue(lines, line, entryDN, colonPos, attrName);
@@ -838,7 +841,6 @@
}
else
{
- AttributeType attrType = DirectoryServer.getAttributeType(attrName);
if (! importConfig.includeAttribute(attrType))
{
if (logger.isTraceEnabled())
@@ -903,7 +905,7 @@
// options. If so, then try to add a value to that attribute.
for (AttributeBuilder a : attrList)
{
- if (a.optionsEqual(attribute.getOptions()))
+ if (a.optionsEqual(attrDesc))
{
if (!a.add(attributeValue) && checkSchema)
{
--
Gitblit v1.10.0