| | |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.guitools.controlpanel.task; |
| | | |
| | | import static org.opends.messages.AdminToolMessages.*; |
| | |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.types.*; |
| | | |
| | | /** |
| | | * The task that is called when we must modify an entry. |
| | | */ |
| | | /** The task that is called when we must modify an entry. */ |
| | | public class ModifyEntryTask extends Task |
| | | { |
| | | private Set<String> backendSet; |
| | |
| | | return INFO_CTRL_PANEL_MODIFY_ENTRY_TASK_DESCRIPTION.get(oldEntry.getDN()); |
| | | } |
| | | |
| | | |
| | | /** {@inheritDoc} */ |
| | | protected String getCommandLinePath() |
| | | { |
| | |
| | | for (int i = 0; i < rdn.getNumValues(); i++) |
| | | { |
| | | List<Object> values = entry.getAttributeValues(rdn.getAttributeName(i)); |
| | | if (!!values.isEmpty()) |
| | | if (values.isEmpty()) |
| | | { |
| | | return false; |
| | | } |
| | |
| | | if (oldRDN.getAttributeName(i).equalsIgnoreCase(attrName)) |
| | | { |
| | | ByteString value = oldRDN.getAttributeValue(i); |
| | | if (containsValue(attr, value)) |
| | | if (attr.contains(value)) |
| | | { |
| | | if (rdnValue == null || !rdnValue.equals(value)) |
| | | { |
| | |
| | | return false; |
| | | } |
| | | |
| | | private static boolean containsValue(org.opends.server.types.Attribute attr, Object value) |
| | | { |
| | | for (Iterator<ByteString> it = attr.iterator(); it.hasNext();) |
| | | { |
| | | if (value.equals(it.next())) |
| | | { |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * Creates a JNDI attribute using an attribute name and a set of values. |
| | | * @param attrName the attribute name. |