opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/browser/BrowserController.java
@@ -52,7 +52,6 @@ import org.forgerock.opendj.ldap.responses.SearchResultEntry; import org.opends.admin.ads.ADSContext; import org.opends.admin.ads.util.ConnectionWrapper; import org.opends.guitools.controlpanel.datamodel.CustomSearchResult; import org.opends.guitools.controlpanel.datamodel.ServerDescriptor; import org.opends.guitools.controlpanel.event.BrowserEvent; import org.opends.guitools.controlpanel.event.BrowserEventListener; @@ -1780,18 +1779,6 @@ return getNumSubOrdinates(entry) > 0; } /** * Get the value of the numSubordinates attribute. * If numSubordinates is not present, returns 0. * @param entry the entry to analyze. * @return the value of the numSubordinates attribute. 0 if the attribute * could not be found. */ private static int getNumSubOrdinates(CustomSearchResult entry) { return getNumSubOrdinates(entry.getSdkEntry()); } private static int toInt(String v) { if (v == null) @@ -1809,19 +1796,6 @@ } /** * Returns whether the entry has subordinates or not. It uses an algorithm * based in hasSubordinates and numSubordinates attributes. * @param entry the entry to analyze. * @return {@code true} if the entry has subordinates according to the values * of hasSubordinates and numSubordinates, returns {@code false} if none of * the attributes could be found. */ public static boolean getHasSubOrdinates(CustomSearchResult entry) { return getHasSubOrdinates(entry.getSdkEntry()); } /** * Returns the value of the 'ref' attribute. * {@code null} if the attribute is not present. * @param entry the entry to analyze. opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/datamodel/CustomSearchResult.java
File was deleted opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/event/EntryReadEvent.java
@@ -12,28 +12,27 @@ * information: "Portions Copyright [year] [name of copyright owner]". * * Copyright 2008 Sun Microsystems, Inc. * Portions Copyright 2016 ForgeRock AS. */ package org.opends.guitools.controlpanel.event; import org.opends.guitools.controlpanel.datamodel.CustomSearchResult; import org.forgerock.opendj.ldap.Entry; /** * The class used to notify that a new entry has been successfully read. Used * in the LDAP entry browser. * */ public class EntryReadEvent { private Object source; private CustomSearchResult sr; private Entry sr; /** * The event constructor. * @param source the source of the event. * @param sr the search result containing the entry that was read. */ public EntryReadEvent(Object source, CustomSearchResult sr) public EntryReadEvent(Object source, Entry sr) { this.source = source; this.sr = sr; @@ -52,7 +51,7 @@ * Returns the search result containing the entry that was read. * @return the search result containing the entry that was read. */ public CustomSearchResult getSearchResult() public Entry getSearchResult() { return sr; } opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/DeleteEntryTask.java
@@ -14,7 +14,6 @@ * Copyright 2008-2010 Sun Microsystems, Inc. * Portions Copyright 2013-2016 ForgeRock AS. */ package org.opends.guitools.controlpanel.task; import static org.forgerock.opendj.ldap.SearchScope.*; @@ -51,7 +50,6 @@ import org.opends.guitools.controlpanel.datamodel.BackendDescriptor; import org.opends.guitools.controlpanel.datamodel.BaseDNDescriptor; import org.opends.guitools.controlpanel.datamodel.ControlPanelInfo; import org.opends.guitools.controlpanel.datamodel.CustomSearchResult; import org.opends.guitools.controlpanel.ui.ColorAndFontConstants; import org.opends.guitools.controlpanel.ui.ProgressDialog; import org.opends.guitools.controlpanel.ui.nodes.BasicNode; @@ -322,8 +320,7 @@ SearchResultEntry sr = entryDNs.readEntry(); if (!sr.getName().equals("")) { CustomSearchResult res = new CustomSearchResult(sr); deleteSubtreeRecursively(conn, res.getName(), null, toNotify); deleteSubtreeRecursively(conn, sr.getName(), null, toNotify); } } } opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/ModifyEntryTask.java
@@ -47,7 +47,6 @@ import org.opends.guitools.controlpanel.datamodel.BaseDNDescriptor; import org.opends.guitools.controlpanel.datamodel.CannotRenameException; import org.opends.guitools.controlpanel.datamodel.ControlPanelInfo; import org.opends.guitools.controlpanel.datamodel.CustomSearchResult; import org.opends.guitools.controlpanel.ui.ColorAndFontConstants; import org.opends.guitools.controlpanel.ui.ProgressDialog; import org.opends.guitools.controlpanel.ui.StatusGenericPanel; @@ -64,7 +63,7 @@ private Set<String> backendSet; private boolean mustRename; private boolean hasModifications; private CustomSearchResult oldEntry; private org.forgerock.opendj.ldap.Entry oldEntry; private DN oldDn; private ArrayList<ModificationItem> modifications; private ModificationItem passwordModification; @@ -84,7 +83,7 @@ * want to modify. */ public ModifyEntryTask(ControlPanelInfo info, ProgressDialog dlg, Entry newEntry, CustomSearchResult oldEntry, Entry newEntry, org.forgerock.opendj.ldap.Entry oldEntry, BrowserController controller, TreePath path) { super(info, dlg); @@ -323,9 +322,9 @@ * @throws NamingException if an error performing the modification occurs. */ private void modifyAndRename(ConnectionWrapper conn, final DN oldDN, CustomSearchResult originalEntry, final Entry newEntry, final ArrayList<ModificationItem> originalMods) throws CannotRenameException, NamingException org.forgerock.opendj.ldap.Entry originalEntry, final Entry newEntry, final ArrayList<ModificationItem> originalMods) throws CannotRenameException, NamingException { RDN oldRDN = oldDN.rdn(); RDN newRDN = newEntry.getName().rdn(); @@ -450,7 +449,7 @@ return false; } private boolean entryContainsRdnTypes(CustomSearchResult entry, RDN rdn) private boolean entryContainsRdnTypes(org.forgerock.opendj.ldap.Entry entry, RDN rdn) { for (AVA ava : rdn) { @@ -471,7 +470,7 @@ * @return the modifications to apply between two entries. */ public static ArrayList<ModificationItem> getModifications(Entry newEntry, CustomSearchResult oldEntry, ControlPanelInfo info) { org.forgerock.opendj.ldap.Entry oldEntry, ControlPanelInfo info) { ArrayList<ModificationItem> modifications = new ArrayList<>(); Schema schema = info.getServerDescriptor().getSchema(); opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/BrowseEntriesPanel.java
@@ -63,12 +63,12 @@ import org.forgerock.i18n.LocalizableMessage; import org.forgerock.opendj.ldap.DN; import org.forgerock.opendj.ldap.Entry; import org.forgerock.opendj.ldap.schema.AttributeType; import org.forgerock.opendj.ldap.schema.ObjectClass; import org.opends.admin.ads.util.ConnectionWrapper; import org.opends.guitools.controlpanel.browser.NodeRefresher; import org.opends.guitools.controlpanel.datamodel.ControlPanelInfo; import org.opends.guitools.controlpanel.datamodel.CustomSearchResult; import org.opends.guitools.controlpanel.datamodel.ServerDescriptor; import org.opends.guitools.controlpanel.event.ConfigurationChangeEvent; import org.opends.guitools.controlpanel.event.EntryReadErrorEvent; @@ -580,7 +580,7 @@ entryReaderThread = new Thread(new Runnable() { LDAPEntryReader reader; CustomSearchResult sr; Entry sr; Throwable t; @Override public void run() opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/DuplicateEntryPanel.java
@@ -43,9 +43,9 @@ import org.forgerock.opendj.ldap.AttributeDescription; import org.forgerock.opendj.ldap.ByteString; import org.forgerock.opendj.ldap.DN; import org.forgerock.opendj.ldap.Entry; import org.opends.admin.ads.util.ConnectionWrapper; import org.opends.guitools.controlpanel.browser.BrowserController; import org.opends.guitools.controlpanel.datamodel.CustomSearchResult; import org.opends.guitools.controlpanel.ui.nodes.BasicNode; import org.opends.guitools.controlpanel.util.BackgroundTask; import org.opends.guitools.controlpanel.util.LDAPEntryReader; @@ -71,7 +71,7 @@ private GenericDialog browseDlg; private LDAPEntrySelectionPanel browsePanel; private CustomSearchResult entryToDuplicate; private Entry entryToDuplicate; private String rdnAttribute; /** Default constructor. */ @@ -444,11 +444,10 @@ private void readEntry(final BasicNode node) { final long t1 = System.currentTimeMillis(); BackgroundTask<CustomSearchResult> task = new BackgroundTask<CustomSearchResult>() BackgroundTask<Entry> task = new BackgroundTask<Entry>() { @Override public CustomSearchResult processBackgroundTask() throws Throwable public Entry processBackgroundTask() throws Throwable { ConnectionWrapper conn = controller.findConnectionForDisplayedEntry(node); LDAPEntryReader reader = new LDAPEntryReader(node.getDN(), conn); @@ -457,8 +456,7 @@ } @Override public void backgroundTaskCompleted(CustomSearchResult sr, Throwable throwable) public void backgroundTaskCompleted(Entry sr, Throwable throwable) { if (throwable != null) { opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/LDAPEntryPanel.java
@@ -37,10 +37,10 @@ import org.forgerock.i18n.LocalizableMessage; import org.forgerock.opendj.ldap.DN; import org.forgerock.opendj.ldap.Entry; import org.opends.guitools.controlpanel.browser.BasicNodeError; import org.opends.guitools.controlpanel.browser.BrowserController; import org.opends.guitools.controlpanel.datamodel.ControlPanelInfo; import org.opends.guitools.controlpanel.datamodel.CustomSearchResult; import org.opends.guitools.controlpanel.datamodel.ServerDescriptor; import org.opends.guitools.controlpanel.event.ConfigurationChangeEvent; import org.opends.guitools.controlpanel.event.EntryReadErrorEvent; @@ -53,7 +53,6 @@ import org.opends.guitools.controlpanel.task.Task; import org.opends.guitools.controlpanel.util.Utilities; import org.opends.server.config.ConfigConstants; import org.opends.server.types.Entry; import org.opends.server.types.OpenDsException; import org.opends.server.util.ServerConstants; @@ -74,7 +73,7 @@ private ViewEntryPanel displayedEntryPanel; private CustomSearchResult searchResult; private Entry searchResult; private BrowserController controller; private TreePath treePath; @@ -247,8 +246,7 @@ * @param searchResult the search result corresponding to the selected node. * @param treePath the tree path of the selected node. */ private void updateEntryView(CustomSearchResult searchResult, TreePath treePath) private void updateEntryView(Entry searchResult, TreePath treePath) { boolean isReadOnly = isReadOnly(searchResult.getName()); boolean canDelete = canDelete(searchResult.getName()); @@ -499,9 +497,8 @@ Utilities.getFrame(this), INFO_CTRL_PANEL_MODIFYING_ENTRY_CHANGES_TITLE.get(), getInfo()); dlg.setModal(modal); Entry entry = displayedEntryPanel.getEntry(); newTask = new ModifyEntryTask(getInfo(), dlg, entry, searchResult, controller, treePath); org.opends.server.types.Entry entry = displayedEntryPanel.getEntry(); newTask = new ModifyEntryTask(getInfo(), dlg, entry, searchResult, controller, treePath); for (Task task : getInfo().getTasks()) { task.canLaunch(newTask, errors); opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/LDIFViewEntryPanel.java
@@ -36,10 +36,9 @@ import org.forgerock.i18n.LocalizableMessage; import org.forgerock.opendj.ldap.Attribute; import org.forgerock.opendj.ldap.ByteString; import org.opends.guitools.controlpanel.datamodel.CustomSearchResult; import org.forgerock.opendj.ldap.Entry; import org.opends.guitools.controlpanel.task.OfflineUpdateException; import org.opends.guitools.controlpanel.util.Utilities; import org.opends.server.types.Entry; import org.opends.server.types.LDIFImportConfig; import org.opends.server.types.OpenDsException; import org.opends.server.util.Base64; @@ -76,7 +75,7 @@ private JScrollPane readOnlyScroll; private JTextArea editableAttributes; private JTextArea readOnlyAttributes; private CustomSearchResult searchResult; private Entry searchResult; /** Default constructor. */ public LDIFViewEntryPanel() @@ -151,7 +150,7 @@ } @Override public void update(CustomSearchResult sr, boolean isReadOnly, TreePath path) public void update(Entry sr, boolean isReadOnly, TreePath path) { boolean sameEntry = false; if (searchResult != null && sr != null) @@ -261,16 +260,13 @@ } @Override public Entry getEntry() throws OpenDsException public org.opends.server.types.Entry getEntry() throws OpenDsException { LDIFImportConfig ldifImportConfig = null; try String ldif = getLDIF(); try (LDIFImportConfig ldifImportConfig = new LDIFImportConfig(new StringReader(ldif)); LDIFReader reader = new LDIFReader(ldifImportConfig)) { String ldif = getLDIF(); ldifImportConfig = new LDIFImportConfig(new StringReader(ldif)); LDIFReader reader = new LDIFReader(ldifImportConfig); Entry entry = reader.readEntry(checkSchema()); org.opends.server.types.Entry entry = reader.readEntry(checkSchema()); addValuesInRDN(entry); return entry; } @@ -279,13 +275,6 @@ throw new OfflineUpdateException( ERR_CTRL_PANEL_ERROR_CHECKING_ENTRY.get(ioe), ioe); } finally { if (ldifImportConfig != null) { ldifImportConfig.close(); } } } /** opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/ManageTasksPanel.java
@@ -51,11 +51,10 @@ import org.forgerock.i18n.LocalizableMessage; import org.forgerock.i18n.slf4j.LocalizedLogger; import org.forgerock.opendj.adapter.server3x.Converters; import org.forgerock.opendj.ldap.DN; import org.forgerock.opendj.ldap.Entry; import org.forgerock.opendj.ldap.LinkedAttribute; import org.forgerock.opendj.ldap.LinkedHashMapEntry; import org.opends.guitools.controlpanel.datamodel.ControlPanelInfo; import org.opends.guitools.controlpanel.datamodel.CustomSearchResult; import org.opends.guitools.controlpanel.datamodel.ServerDescriptor; import org.opends.guitools.controlpanel.datamodel.TaskTableModel; import org.opends.guitools.controlpanel.event.ConfigurationChangeEvent; @@ -459,7 +458,7 @@ int numberTasks = r.nextInt(10); for (int i= 0; i<numberTasks; i++) { CustomSearchResult csr = new CustomSearchResult(DN.valueOf("cn=mytask" + i + ",cn=tasks")); Entry csr = new LinkedHashMapEntry("cn=mytask" + i + ",cn=tasks"); String p = "ds-task-"; String[] attrNames = { @@ -499,13 +498,12 @@ { final LinkedAttribute attr = new LinkedAttribute(attrNames[j]); attr.add(values[j] + r.nextInt()); Entry entry = csr.getSdkEntry(); entry.removeAttribute(attr.getAttributeDescription()); entry.addAttribute(attr); csr.removeAttribute(attr.getAttributeDescription()); csr.addAttribute(attr); } try { list.add(new TaskEntry(Converters.to(csr.getSdkEntry()))); list.add(new TaskEntry(Converters.to(csr))); } catch (Throwable t) { @@ -525,7 +523,7 @@ Set<TaskEntry> list = new HashSet<>(); for (int i= 0; i<10; i++) { CustomSearchResult csr = new CustomSearchResult(DN.valueOf("cn=mytask" + i + ",cn=tasks")); Entry csr = new LinkedHashMapEntry("cn=mytask" + i + ",cn=tasks"); String p = "ds-task-"; String[] attrNames = { @@ -565,13 +563,12 @@ { final LinkedAttribute attr = new LinkedAttribute(attrNames[j]); attr.add(values[j]); Entry entry = csr.getSdkEntry(); entry.removeAttribute(attr.getAttributeDescription()); entry.addAttribute(attr); csr.removeAttribute(attr.getAttributeDescription()); csr.addAttribute(attr); } try { list.add(new TaskEntry(Converters.to(csr.getSdkEntry()))); list.add(new TaskEntry(Converters.to(csr))); } catch (Throwable t) { opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/SimplifiedViewEntryPanel.java
@@ -77,14 +77,15 @@ import org.forgerock.opendj.ldap.AttributeDescription; import org.forgerock.opendj.ldap.ByteString; import org.forgerock.opendj.ldap.DN; import org.forgerock.opendj.ldap.Entry; import org.forgerock.opendj.ldap.LinkedAttribute; import org.forgerock.opendj.ldap.LinkedHashMapEntry; import org.forgerock.opendj.ldap.RDN; import org.forgerock.opendj.ldap.schema.AttributeType; import org.forgerock.opendj.ldap.schema.ObjectClass; import org.forgerock.opendj.ldap.schema.Syntax; import org.opends.guitools.controlpanel.datamodel.BinaryValue; import org.opends.guitools.controlpanel.datamodel.CheckEntrySyntaxException; import org.opends.guitools.controlpanel.datamodel.CustomSearchResult; import org.opends.guitools.controlpanel.datamodel.ObjectClassValue; import org.opends.guitools.controlpanel.event.ScrollPaneBorderListener; import org.opends.guitools.controlpanel.task.OnlineUpdateException; @@ -94,7 +95,6 @@ import org.opends.guitools.controlpanel.ui.nodes.DndBrowserNodes; import org.opends.guitools.controlpanel.util.Utilities; import org.opends.server.schema.SchemaConstants; import org.opends.server.types.Entry; import org.opends.server.types.LDIFImportConfig; import org.opends.server.types.OpenDsException; import org.opends.server.types.Schema; @@ -123,7 +123,7 @@ private final Map<String, List<String>> lastUserPasswords = new HashMap<>(); private CustomSearchResult searchResult; private Entry searchResult; private boolean isReadOnly; private TreePath treePath; private JScrollPane scrollAttributes; @@ -406,7 +406,7 @@ } @Override public void update(CustomSearchResult sr, boolean isReadOnly, TreePath path) public void update(Entry sr, boolean isReadOnly, TreePath path) { boolean sameEntry = false; if (searchResult != null && sr != null) @@ -614,7 +614,7 @@ return GridBagConstraints.WEST; } private JLabel getLabelForAttribute(String attrName, CustomSearchResult sr) private JLabel getLabelForAttribute(String attrName, Entry sr) { int index = attrName.indexOf(";"); String basicAttrName; @@ -666,12 +666,12 @@ return Utilities.createPrimaryLabel(l.toMessage()); } private LinkedHashSet<AttributeDescription> getSortedAttributes(CustomSearchResult sr, boolean isReadOnly) private LinkedHashSet<AttributeDescription> getSortedAttributes(Entry sr, boolean isReadOnly) { // Get all attributes that the entry can have List<AttributeDescription> entryAttrs = new ArrayList<>(); List<String> attrsWithNoOptions = new ArrayList<>(); for (Attribute attr : sr.getSdkEntry().getAllAttributes()) for (Attribute attr : sr.getAllAttributes()) { AttributeDescription attrDesc = attr.getAttributeDescription(); entryAttrs.add(attrDesc); @@ -1139,7 +1139,7 @@ return false; } private boolean isRequired(AttributeDescription attrDesc, CustomSearchResult sr) private boolean isRequired(AttributeDescription attrDesc, Entry sr) { Schema schema = getInfo().getServerDescriptor().getSchema(); if (schema != null) @@ -1167,7 +1167,7 @@ } @Override public Entry getEntry() throws OpenDsException public org.opends.server.types.Entry getEntry() throws OpenDsException { final List<LocalizableMessage> errors = new ArrayList<>(); @@ -1219,7 +1219,7 @@ try (LDIFImportConfig ldifImportConfig = new LDIFImportConfig(new StringReader(ldif)); LDIFReader reader = new LDIFReader(ldifImportConfig)) { final Entry entry = reader.readEntry(checkSchema()); final org.opends.server.types.Entry entry = reader.readEntry(checkSchema()); addValuesInRDN(entry); return entry; } @@ -1337,7 +1337,7 @@ return sb.toString(); } private boolean isAttrName(String attrName, CustomSearchResult sr) private boolean isAttrName(String attrName, Entry sr) { for (ByteString ocName : sr.getAttribute(OBJECTCLASS_ATTRIBUTE_TYPE_NAME)) { @@ -1591,8 +1591,8 @@ private void updatePanel(ObjectClassValue newValue) { CustomSearchResult oldResult = searchResult; CustomSearchResult newResult = new CustomSearchResult(searchResult.getName()); Entry oldResult = searchResult; Entry newResult = new LinkedHashMapEntry(searchResult.getName()); for (String attrName : schemaReadOnlyAttributesLowerCase) { @@ -1600,9 +1600,8 @@ if (attr != null && !attr.isEmpty()) { final Attribute newAttr = new LinkedAttribute(attr); org.forgerock.opendj.ldap.Entry entry = newResult.getSdkEntry(); entry.removeAttribute(newAttr.getAttributeDescription()); entry.addAttribute(newAttr); newResult.removeAttribute(newAttr.getAttributeDescription()); newResult.addAttribute(newAttr); } } ignoreEntryChangeEvents = true; @@ -1654,9 +1653,8 @@ Attribute oldValues = searchResult.getAttribute(attrName); final Attribute newAttr = oldValues != null ? new LinkedAttribute(oldValues) : new LinkedAttribute(attrName); org.forgerock.opendj.ldap.Entry entry = newResult.getSdkEntry(); entry.removeAttribute(newAttr.getAttributeDescription()); entry.addAttribute(newAttr); newResult.removeAttribute(newAttr.getAttributeDescription()); newResult.addAttribute(newAttr); } else { opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/TableViewEntryPanel.java
@@ -51,19 +51,19 @@ import org.forgerock.opendj.ldap.AttributeDescription; import org.forgerock.opendj.ldap.ByteString; import org.forgerock.opendj.ldap.DN; import org.forgerock.opendj.ldap.Entry; import org.forgerock.opendj.ldap.LinkedAttribute; import org.forgerock.opendj.ldap.LinkedHashMapEntry; import org.forgerock.opendj.ldap.RDN; import org.forgerock.opendj.ldap.schema.AttributeType; import org.forgerock.opendj.ldap.schema.ObjectClass; import org.opends.guitools.controlpanel.datamodel.BinaryValue; import org.opends.guitools.controlpanel.datamodel.CustomSearchResult; import org.opends.guitools.controlpanel.datamodel.ObjectClassValue; import org.opends.guitools.controlpanel.datamodel.SortableTableModel; import org.opends.guitools.controlpanel.task.OnlineUpdateException; import org.opends.guitools.controlpanel.ui.renderer.AttributeCellEditor; import org.opends.guitools.controlpanel.ui.renderer.LDAPEntryTableCellRenderer; import org.opends.guitools.controlpanel.util.Utilities; import org.opends.server.types.Entry; import org.opends.server.types.LDIFImportConfig; import org.opends.server.types.OpenDsException; import org.opends.server.types.Schema; @@ -74,7 +74,7 @@ class TableViewEntryPanel extends ViewEntryPanel { private static final long serialVersionUID = 2135331526526472175L; private CustomSearchResult searchResult; private Entry searchResult; private LDAPEntryTableModel tableModel; private LDAPEntryTableCellRenderer renderer; private JTable table; @@ -158,7 +158,7 @@ } @Override public void update(CustomSearchResult sr, boolean isReadOnly, TreePath path) public void update(Entry sr, boolean isReadOnly, TreePath path) { boolean sameEntry = false; if (searchResult != null && sr != null) @@ -200,7 +200,7 @@ } @Override public Entry getEntry() throws OpenDsException public org.opends.server.types.Entry getEntry() throws OpenDsException { if (SwingUtilities.isEventDispatchThread()) { @@ -228,7 +228,7 @@ try (LDIFImportConfig ldifImportConfig = new LDIFImportConfig(new StringReader(ldif)); LDIFReader reader = new LDIFReader(ldifImportConfig)) { Entry entry = reader.readEntry(checkSchema()); org.opends.server.types.Entry entry = reader.readEntry(checkSchema()); addValuesInRDN(entry); return entry; } @@ -717,8 +717,8 @@ private void updateObjectClass(ObjectClassValue newValue) { CustomSearchResult oldResult = searchResult; CustomSearchResult newResult = new CustomSearchResult(searchResult.getName()); Entry oldResult = searchResult; Entry newResult = new LinkedHashMapEntry(searchResult.getName()); for (String attrName : schemaReadOnlyAttributesLowerCase) { @@ -726,9 +726,8 @@ if (attr != null && !attr.isEmpty()) { final Attribute newAttr = new LinkedAttribute(attr); org.forgerock.opendj.ldap.Entry entry = newResult.getSdkEntry(); entry.removeAttribute(newAttr.getAttributeDescription()); entry.addAttribute(newAttr); newResult.removeAttribute(newAttr.getAttributeDescription()); newResult.addAttribute(newAttr); } } ignoreEntryChangeEvents = true; opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/ViewEntryPanel.java
@@ -40,12 +40,12 @@ import org.forgerock.opendj.ldap.AttributeDescription; import org.forgerock.opendj.ldap.ByteString; import org.forgerock.opendj.ldap.DN; import org.forgerock.opendj.ldap.Entry; import org.forgerock.opendj.ldap.LinkedAttribute; import org.forgerock.opendj.ldap.schema.AttributeType; import org.forgerock.opendj.ldap.schema.ObjectClass; import org.forgerock.opendj.ldap.schema.ObjectClassType; import org.opends.guitools.controlpanel.datamodel.BinaryValue; import org.opends.guitools.controlpanel.datamodel.CustomSearchResult; import org.opends.guitools.controlpanel.datamodel.ObjectClassValue; import org.opends.guitools.controlpanel.event.ConfigurationChangeEvent; import org.opends.guitools.controlpanel.event.LDAPEntryChangedEvent; @@ -54,7 +54,6 @@ import org.opends.guitools.controlpanel.util.Utilities; import org.opends.server.schema.SchemaConstants; import org.opends.server.types.Attributes; import org.opends.server.types.Entry; import org.opends.server.types.OpenDsException; import org.opends.server.types.Schema; import org.opends.server.util.Base64; @@ -94,7 +93,7 @@ * @throws OpenDsException if the entry cannot be generated (in particular if * the user provided invalid data). */ public abstract Entry getEntry() throws OpenDsException; public abstract org.opends.server.types.Entry getEntry() throws OpenDsException; /** * Updates the contents of the panel. @@ -102,7 +101,7 @@ * @param isReadOnly whether the entry is read-only or not. * @param path the tree path associated with the entry in the tree. */ public abstract void update(CustomSearchResult sr, boolean isReadOnly, TreePath path); public abstract void update(Entry sr, boolean isReadOnly, TreePath path); /** * Adds a title panel to the container. @@ -182,7 +181,7 @@ * @param path the path to the node of the entry selected in the tree. Used * to display the same icon as in the tree. */ protected void updateTitle(CustomSearchResult sr, TreePath path) protected void updateTitle(Entry sr, TreePath path) { final DN dn = sr.getName(); if (dn != null && dn.size() > 0) @@ -275,7 +274,7 @@ * Adds the values in the RDN to the entry definition. * @param entry the entry to be updated. */ protected void addValuesInRDN(Entry entry) protected void addValuesInRDN(org.opends.server.types.Entry entry) { // Add the values in the RDN if they are not there for (AVA ava : entry.getName().rdn()) @@ -441,7 +440,7 @@ * @param sr the search result to be updated. * @param attrName the attribute name. */ protected void setValues(CustomSearchResult sr, String attrName) protected void setValues(Entry sr, String attrName) { List<Object> values = getValues(attrName); final LinkedAttribute attr = new LinkedAttribute(attrName); @@ -486,9 +485,8 @@ } if (!attr.isEmpty()) { org.forgerock.opendj.ldap.Entry entry = sr.getSdkEntry(); entry.removeAttribute(attr.getAttributeDescription()); entry.addAttribute(attr); sr.removeAttribute(attr.getAttributeDescription()); sr.addAttribute(attr); } } opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/util/LDAPEntryReader.java
@@ -23,12 +23,12 @@ import java.util.Set; import org.forgerock.opendj.ldap.DN; import org.forgerock.opendj.ldap.Entry; import org.forgerock.opendj.ldap.Filter; import org.forgerock.opendj.ldap.requests.Requests; import org.forgerock.opendj.ldap.requests.SearchRequest; import org.forgerock.opendj.ldap.responses.SearchResultEntry; import org.opends.admin.ads.util.ConnectionWrapper; import org.opends.guitools.controlpanel.datamodel.CustomSearchResult; import org.opends.guitools.controlpanel.event.EntryReadErrorEvent; import org.opends.guitools.controlpanel.event.EntryReadEvent; import org.opends.guitools.controlpanel.event.EntryReadListener; @@ -38,7 +38,7 @@ * entries browser. When the entry is read it notifies to the EntryReadListener * objects that have been registered. */ public class LDAPEntryReader extends BackgroundTask<CustomSearchResult> public class LDAPEntryReader extends BackgroundTask<Entry> { private final DN dn; private final ConnectionWrapper conn; @@ -59,7 +59,7 @@ } @Override public CustomSearchResult processBackgroundTask() throws Throwable public Entry processBackgroundTask() throws Throwable { isOver = false; final Filter filter = Filter.valueOf("(|(objectclass=*)(objectclass=ldapsubentry))"); @@ -69,12 +69,11 @@ { isOver = true; } return new CustomSearchResult(sr); return sr; } @Override public void backgroundTaskCompleted(CustomSearchResult sr, Throwable throwable) public void backgroundTaskCompleted(Entry sr, Throwable throwable) { if (!isInterrupted() && isNotifyListeners()) { @@ -127,7 +126,7 @@ * Notifies listeners that a new entry was read. * @param sr the new entry in form of CustomSearchResult. */ private void notifyListeners(CustomSearchResult sr) private void notifyListeners(Entry sr) { EntryReadEvent ev = new EntryReadEvent(this, sr); for (EntryReadListener listener : listeners) opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/util/Utilities.java
@@ -98,6 +98,7 @@ import org.forgerock.opendj.ldap.AttributeDescription; import org.forgerock.opendj.ldap.ByteString; import org.forgerock.opendj.ldap.DN; import org.forgerock.opendj.ldap.Entry; import org.forgerock.opendj.ldap.requests.SearchRequest; import org.forgerock.opendj.ldap.responses.SearchResultEntry; import org.forgerock.opendj.ldap.schema.AttributeType; @@ -113,7 +114,6 @@ import org.opends.guitools.controlpanel.datamodel.CategorizedComboBoxElement; import org.opends.guitools.controlpanel.datamodel.ConfigReadException; import org.opends.guitools.controlpanel.datamodel.ControlPanelInfo; import org.opends.guitools.controlpanel.datamodel.CustomSearchResult; import org.opends.guitools.controlpanel.datamodel.MonitoringAttributes; import org.opends.guitools.controlpanel.datamodel.SortableTableModel; import org.opends.guitools.controlpanel.datamodel.VLVIndexDescriptor; @@ -2263,7 +2263,7 @@ public static void deleteConfigSubtree(ConfigurationHandler confHandler, DN dn) throws OpenDsException, ConfigException { org.forgerock.opendj.ldap.Entry confEntry = confHandler.getEntry(dn); Entry confEntry = confHandler.getEntry(dn); if (confEntry != null) { // Copy the values to avoid problems with this recursive method. @@ -2416,7 +2416,7 @@ * @return the first value as a String for a given attribute in the provided * entry. */ public static String getFirstValueAsString(CustomSearchResult sr, String attrName) public static String getFirstValueAsString(Entry sr, String attrName) { if (sr != null) {