From 45a05a46b927f19865e6a748873d70efe9a99ac5 Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Fri, 05 Aug 2016 18:41:17 +0000
Subject: [PATCH] Partial OPENDJ-2625 Convert all code that uses JNDI to use the SDK instead

---
 opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/BrowseEntriesPanel.java |   38 ++++++++------------------------------
 1 files changed, 8 insertions(+), 30 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/BrowseEntriesPanel.java b/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/BrowseEntriesPanel.java
index bfded4b..12ba993 100644
--- a/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/BrowseEntriesPanel.java
+++ b/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/BrowseEntriesPanel.java
@@ -43,7 +43,6 @@
 import java.util.LinkedHashSet;
 
 import javax.naming.InterruptedNamingException;
-import javax.naming.NamingException;
 import javax.swing.ButtonGroup;
 import javax.swing.JCheckBoxMenuItem;
 import javax.swing.JComponent;
@@ -66,7 +65,7 @@
 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.ConnectionWithControls;
 import org.opends.guitools.controlpanel.browser.NodeRefresher;
 import org.opends.guitools.controlpanel.datamodel.ControlPanelInfo;
 import org.opends.guitools.controlpanel.datamodel.ServerDescriptor;
@@ -503,7 +502,7 @@
     if (node != null)
     {
       DN dn;
-      if (controller.getFollowReferrals() &&
+      if (controller.isFollowReferrals() &&
           node.getReferral() != null &&
           node.getRemoteUrl() == null &&
           node.getError() != null &&
@@ -514,7 +513,7 @@
         entryPane.referralSolveError(node.getDN(), node.getReferral(), node.getError());
         dn = null;
       }
-      else if (controller.getFollowReferrals() && node.getRemoteUrl() != null)
+      else if (controller.isFollowReferrals() && node.getRemoteUrl() != null)
       {
         dn = DN.valueOf(node.getRemoteUrl().getRawBaseDN());
       }
@@ -527,11 +526,10 @@
       {
         try
         {
-          ConnectionWrapper conn = controller.findConnectionForDisplayedEntry(node);
+          ConnectionWithControls conn = controller.findConnectionForDisplayedEntry(node);
           LDAPEntryReader reader = new LDAPEntryReader(dn, conn);
           reader.addEntryReadListener(entryPane);
-          // Required to update the browser controller properly if the entry is
-          // deleted.
+          // Required to update the browser controller properly if the entry is deleted.
           entryPane.setTreePath(path);
           stopCurrentReader();
           startReader(reader);
@@ -1246,23 +1244,13 @@
       menu.add(sortUserData);
       menu.add(followReferrals);
       sortUserData.setSelected(entryPane.getController().isSorted());
-      followReferrals.setSelected(
-          entryPane.getController().getFollowReferrals());
+      followReferrals.setSelected(entryPane.getController().isFollowReferrals());
       sortUserData.addActionListener(new ActionListener()
       {
         @Override
         public void actionPerformed(ActionEvent ev)
         {
-          try
-          {
-            entryPane.getController().setSorted(sortUserData.isSelected());
-          }
-          catch (NamingException ne)
-          {
-            // Bug
-            System.err.println("Unexpected error updating sorting.");
-            ne.printStackTrace();
-          }
+          entryPane.getController().setSorted(sortUserData.isSelected());
         }
       });
       followReferrals.addActionListener(new ActionListener()
@@ -1270,17 +1258,7 @@
         @Override
         public void actionPerformed(ActionEvent ev)
         {
-          try
-          {
-            entryPane.getController().setFollowReferrals(
-                followReferrals.isSelected());
-          }
-          catch (NamingException ne)
-          {
-            // Bug
-            System.err.println("Unexpected error updating referral state.");
-            ne.printStackTrace();
-          }
+          entryPane.getController().setFollowReferrals(followReferrals.isSelected());
         }
       });
       // Add the refresh menu

--
Gitblit v1.10.0