mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noel Rouvignac
06.25.2014 e54a2046c8f4a385e42d0ce899d1761a2753d401
OPENDJ-1624 NullPointerException while doing status with authentication

Utilities.java:
In getFirstMonitoringValue(), fixed the bug introduced in r11194.

ServerDescriptor.java, StatusCli.java:
Code cleanup
3 files modified
573 ■■■■ changed files
opendj3-server-dev/src/guitools/org/opends/guitools/controlpanel/datamodel/ServerDescriptor.java 491 ●●●● patch | view | raw | blame | history
opendj3-server-dev/src/guitools/org/opends/guitools/controlpanel/util/Utilities.java 2 ●●●●● patch | view | raw | blame | history
opendj3-server-dev/src/server/org/opends/server/tools/status/StatusCli.java 80 ●●●●● patch | view | raw | blame | history
opendj3-server-dev/src/guitools/org/opends/guitools/controlpanel/datamodel/ServerDescriptor.java
@@ -38,17 +38,18 @@
import java.util.Set;
import org.opends.guitools.controlpanel.util.ConfigFromDirContext;
import org.opends.guitools.controlpanel.util.Utilities;
import org.opends.quicksetup.UserData;
import org.opends.server.tools.tasks.TaskEntry;
import org.opends.server.types.AttributeType;
import org.opends.server.types.DN;
import org.opends.server.types.ObjectClass;
import org.opends.server.types.OpenDsException;
import com.forgerock.opendj.util.OperatingSystem;
import org.opends.server.types.Schema;
import com.forgerock.opendj.util.OperatingSystem;
import static org.opends.guitools.controlpanel.datamodel.BasicMonitoringAttributes.*;
import static org.opends.guitools.controlpanel.util.Utilities.*;
import static org.opends.server.types.CommonSchemaElements.*;
/**
@@ -57,80 +58,54 @@
 */
public class ServerDescriptor
{
  private static String localHostName = UserData.getDefaultHostName();
  private ServerStatus status;
  private int openConnections;
  private Set<BackendDescriptor> backends = new HashSet<BackendDescriptor>();
  private Set<ConnectionHandlerDescriptor> listeners =
    new HashSet<ConnectionHandlerDescriptor>();
  private Set<ConnectionHandlerDescriptor> listeners = new HashSet<ConnectionHandlerDescriptor>();
  private ConnectionHandlerDescriptor adminConnector;
  private Set<DN> administrativeUsers = new HashSet<DN>();
  private String installPath;
  private String instancePath;
  private String openDSVersion;
  private String javaVersion;
  private ArrayList<OpenDsException> exceptions =
    new ArrayList<OpenDsException>();
  private ArrayList<OpenDsException> exceptions = new ArrayList<OpenDsException>();
  private boolean isWindowsServiceEnabled;
  private boolean isSchemaEnabled;
  private Schema schema;
  private CustomSearchResult rootMonitor;
  private CustomSearchResult jvmMemoryUsage;
  private CustomSearchResult systemInformation;
  private CustomSearchResult entryCaches;
  private CustomSearchResult workQueue;
  private Set<TaskEntry> taskEntries = new HashSet<TaskEntry>();
  private long runningTime = -1;
  private boolean isAuthenticated;
  private static String localHostName = UserData.getDefaultHostName();
  private String hostName = localHostName;
  private boolean isLocal = true;
  /**
   * Enumeration indicating the status of the server.
   *
   */
  /** Enumeration indicating the status of the server. */
  public enum ServerStatus
  {
    /**
     * Server Started.
     */
    /** Server Started. */
    STARTED,
    /**
     * Server Stopped.
     */
    /** Server Stopped. */
    STOPPED,
    /**
     * Server Starting.
     */
    /** Server Starting. */
    STARTING,
    /**
     * Server Stopping.
     */
    /** Server Stopping. */
    STOPPING,
    /**
     * Not connected to remote.
     */
    /** Not connected to remote. */
    NOT_CONNECTED_TO_REMOTE,
    /**
     * Status Unknown.
     */
    /** Status Unknown. */
    UNKNOWN
  }
  /**
   * Default constructor.
   */
  /** Default constructor. */
  public ServerDescriptor()
  {
  }
@@ -230,7 +205,7 @@
      {
        sameInstallAndInstance = instance.equals(install);
        if (!sameInstallAndInstance &&
            (isLocal() || (OperatingSystem.isWindows())))
            (isLocal() || OperatingSystem.isWindows()))
        {
          File f1 = new File(instance);
          File f2 = new File(install);
@@ -340,152 +315,44 @@
    this.taskEntries = Collections.unmodifiableSet(taskEntries);
  }
  /**
   * {@inheritDoc}
   */
  /** {@inheritDoc} */
  @Override
  public boolean equals(Object o)
  {
    boolean equals = false;
    if (this != o)
    if (this == o)
    {
      if (o instanceof ServerDescriptor)
      return true;
    }
    if (!(o instanceof ServerDescriptor))
      {
      return false;
    }
        ServerDescriptor desc = (ServerDescriptor)o;
        equals = desc.getStatus() == getStatus();
        if (equals)
        {
          equals = desc.isLocal() == isLocal();
    return desc.getStatus() == getStatus()
        && desc.isLocal() == isLocal()
        && desc.isAuthenticated() == isAuthenticated()
        && desc.getOpenConnections() == getOpenConnections()
        && areEqual(getInstallPath(), desc.getInstallPath())
        && areEqual(getInstancePath(), desc.getInstancePath())
        && areEqual(getJavaVersion(), desc.getJavaVersion())
        && areEqual(getOpenDSVersion(), desc.getOpenDSVersion())
        && areEqual(desc.getAdministrativeUsers(), getAdministrativeUsers())
        && areEqual(desc.getConnectionHandlers(), getConnectionHandlers())
        && areEqual(desc.getBackends(), getBackends())
        && areEqual(desc.getExceptions(), getExceptions())
        && desc.isSchemaEnabled() == isSchemaEnabled()
        && areSchemasEqual(getSchema(), desc.getSchema())
        && (!OperatingSystem.isWindows() || desc.isWindowsServiceEnabled() == isWindowsServiceEnabled())
        && desc.getTaskEntries().equals(getTaskEntries());
        }
        if (equals)
        {
          equals = desc.isAuthenticated() == isAuthenticated();
        }
        if (equals)
        {
          equals = desc.getOpenConnections() == getOpenConnections();
        }
        if (equals)
        {
          if (desc.getInstallPath() == null)
          {
            equals = getInstallPath() == null;
          }
          else
          {
            equals = desc.getInstallPath().equals(getInstallPath());
          }
        }
        if (equals)
        {
          if (desc.getInstancePath() == null)
          {
            equals = getInstancePath() == null;
          }
          else
          {
            equals = desc.getInstancePath().equals(getInstancePath());
          }
        }
        if (equals)
        {
          if (desc.getJavaVersion() == null)
          {
            equals = getJavaVersion() == null;
          }
          else
          {
            equals = desc.getJavaVersion().equals(getJavaVersion());
          }
        }
        if (equals)
        {
          if (desc.getOpenDSVersion() == null)
          {
            equals = getOpenDSVersion() == null;
          }
          else
          {
            equals = desc.getOpenDSVersion().equals(getOpenDSVersion());
          }
        }
        if (equals)
        {
          equals = desc.getAdministrativeUsers().equals(
              getAdministrativeUsers());
        }
        if (equals)
        {
          equals = desc.getConnectionHandlers().equals(getConnectionHandlers());
        }
        if (equals)
        {
          equals = desc.getBackends().equals(getBackends());
        }
        if (equals)
        {
          equals = desc.getExceptions().equals(getExceptions());
        }
        if (equals)
        {
          equals = desc.isSchemaEnabled() == isSchemaEnabled();
        }
        if (equals)
        {
          if (desc.getSchema() == null)
          {
            equals = getSchema() != null;
          }
          else if (getSchema() == null)
          {
            equals = false;
          }
          else
          {
            equals = areSchemasEqual(schema, desc.getSchema());
          }
        }
        if (equals && OperatingSystem.isWindows())
        {
          equals =
            desc.isWindowsServiceEnabled() == isWindowsServiceEnabled();
        }
        if (equals)
        {
          desc.getTaskEntries().equals(getTaskEntries());
        }
      }
    }
    else
    {
      equals = true;
    }
    return equals;
  }
  /**
   * {@inheritDoc}
   */
  /** {@inheritDoc} */
  @Override
  public int hashCode()
  {
    return status.hashCode() + openConnections +
    (String.valueOf(
        installPath+openDSVersion+javaVersion+isAuthenticated)).
        hashCode();
    String s = installPath + openDSVersion + javaVersion + isAuthenticated;
    return status.hashCode() + openConnections + s.hashCode();
  }
  /**
@@ -651,34 +518,21 @@
   */
  public boolean isWindows()
  {
    boolean isWindows;
    if (isLocal())
    {
      isWindows = OperatingSystem.isWindows();
      return OperatingSystem.isWindows();
    }
    else
    {
      CustomSearchResult sr = getSystemInformationMonitor();
      if (sr == null)
      {
        isWindows = false;
      return false;
      }
      else
    String os = (String) getFirstMonitoringValue(sr, "operatingSystem");
    if (os != null)
      {
        String os =
          (String)Utilities.getFirstMonitoringValue(sr, "operatingSystem");
        if (os == null)
        {
          isWindows = false;
      return OperatingSystem.WINDOWS == OperatingSystem.forName(os);
        }
        else
        {
          OperatingSystem oSystem = OperatingSystem.forName(os);
          isWindows = OperatingSystem.WINDOWS == oSystem;
        }
      }
    }
    return isWindows;
    return false;
  }
  /**
@@ -692,69 +546,51 @@
   */
  public static boolean areSchemasEqual(Schema schema1, Schema schema2)
  {
    boolean areEqual = schema1 == schema2;
    if (!areEqual && (schema1 != null) && (schema2 != null))
    if (schema1 == schema2)
    {
      areEqual = true;
      return true;
    }
    else if (schema2 == null)
    {
      return schema1 != null;
    }
    else if (schema1 == null)
    {
      return false;
    }
      // Just compare exhaustively objectclasses and attributes.
      Map<String, AttributeType> attrs1 = schema1.getAttributeTypes();
      Map<String, AttributeType> attrs2 = schema2.getAttributeTypes();
      areEqual = attrs1.size() == attrs2.size();
    if (attrs1.size() == attrs2.size())
    {
      for (String name : attrs1.keySet())
      {
        if (!areEqual)
        {
          break;
        }
        AttributeType attr1 = attrs1.get(name);
        AttributeType attr2 = attrs2.get(name);
        if (attr2 != null)
        if (attr2 == null && !areAttributesEqual(attr1, attr2))
        {
          areEqual = areAttributesEqual(attr1, attr2);
        }
        else
        {
          areEqual = false;
          return false;
        }
      }
      if (areEqual)
      {
        Map<String, ObjectClass> ocs1 = schema1.getObjectClasses();
        Map<String, ObjectClass> ocs2 = schema2.getObjectClasses();
        areEqual = ocs1.size() == ocs2.size();
        for (String name : ocs1.keySet())
        {
          if (!areEqual)
          {
            break;
          }
    Map<String, ObjectClass> ocs1 = schema1.getObjectClasses();
    Map<String, ObjectClass> ocs2 = schema2.getObjectClasses();
    if (ocs1.size() == ocs2.size())
    {
      for (String name : ocs1.keySet())
      {
          ObjectClass oc1 = ocs1.get(name);
          ObjectClass oc2 = ocs2.get(name);
          if (oc2 != null)
        if (oc2 == null || !areObjectClassesEqual(oc1, oc2))
          {
            areEqual = areObjectClassesEqual(oc1, oc2);
          }
          else
          {
            areEqual = false;
          return false;
          }
        }
      }
      if (areEqual)
      {
        areEqual = schema1.getMatchingRules().equals(
            schema2.getMatchingRules());
      }
      if (areEqual)
      {
        areEqual = schema1.getSyntaxes().equals(schema2.getSyntaxes());
      }
    }
    return areEqual;
    return areEqual(schema1.getMatchingRules(), schema2.getMatchingRules())
        && areEqual(schema1.getSyntaxes(), schema2.getSyntaxes());
  }
  /**
@@ -766,63 +602,27 @@
   * @return <CODE>true</CODE> if the two schema attributes are equal and
   * <CODE>false</CODE> otherwise.
   */
  private static final boolean areAttributesEqual(AttributeType attr1,
      AttributeType attr2)
  private static final boolean areAttributesEqual(AttributeType attr1, AttributeType attr2)
  {
    boolean areEqual = attr1.getOID().equals(attr2.getOID()) &&
    attr1.isCollective() == attr2.isCollective() &&
    attr1.isNoUserModification() == attr2.isNoUserModification() &&
    attr1.isObjectClass() == attr2.isObjectClass() &&
    attr1.isObsolete() == attr2.isObsolete() &&
    attr1.isOperational() == attr2.isOperational() &&
    attr1.isSingleValue() == attr2.isSingleValue();
    if (areEqual)
    {
      Object[] compareWithEqual = {attr1.getApproximateMatchingRule(),
          attr2.getApproximateMatchingRule(),
          getDefinitionWithFileName(attr1), getDefinitionWithFileName(attr2),
          attr1.getDescription(), attr2.getDescription(),
          attr1.getEqualityMatchingRule(), attr2.getEqualityMatchingRule(),
          attr1.getOrderingMatchingRule(), attr2.getOrderingMatchingRule(),
          attr1.getSubstringMatchingRule(), attr2.getSubstringMatchingRule(),
          attr1.getSuperiorType(), attr2.getSuperiorType(),
          attr1.getSyntax(), attr2.getSyntax(),
          attr1.getSyntax().getOID(), attr2.getSyntax().getOID()
      };
      for (int i=0; i<compareWithEqual.length && areEqual; i++)
      {
        areEqual = areEqual(compareWithEqual[i], compareWithEqual[i+1]);
        i ++;
      }
      if (areEqual)
      {
        Iterable<?>[] iterables = {attr1.getExtraProperties().keySet(),
            attr2.getExtraProperties().keySet(),
            attr1.getNormalizedNames(), attr2.getNormalizedNames(),
            attr1.getUserDefinedNames(), attr2.getUserDefinedNames()};
        for (int i=0; i<iterables.length && areEqual; i++)
        {
          Set<Object> set1 = new HashSet<Object>();
          Set<Object> set2 = new HashSet<Object>();
          for (Object o : iterables[i])
          {
            set1.add(o);
          }
          for (Object o : iterables[i+1])
          {
            set2.add(o);
          }
          areEqual = set1.equals(set2);
          i ++;
        }
      }
    }
    return areEqual;
    return attr1.getOID().equals(attr2.getOID())
        && attr1.isCollective() == attr2.isCollective()
        && attr1.isNoUserModification() == attr2.isNoUserModification()
        && attr1.isObjectClass() == attr2.isObjectClass()
        && attr1.isObsolete() == attr2.isObsolete()
        && attr1.isOperational() == attr2.isOperational()
        && attr1.isSingleValue() == attr2.isSingleValue()
        && areEqual(attr1.getApproximateMatchingRule(), attr2.getApproximateMatchingRule())
        && areEqual(getDefinitionWithFileName(attr1), getDefinitionWithFileName(attr2))
        && areEqual(attr1.getDescription(), attr2.getDescription())
        && areEqual(attr1.getEqualityMatchingRule(), attr2.getEqualityMatchingRule())
        && areEqual(attr1.getOrderingMatchingRule(), attr2.getOrderingMatchingRule())
        && areEqual(attr1.getSubstringMatchingRule(), attr2.getSubstringMatchingRule())
        && areEqual(attr1.getSuperiorType(), attr2.getSuperiorType())
        && areEqual(attr1.getSyntax(), attr2.getSyntax())
        && areEqual(attr1.getSyntax().getOID(), attr2.getSyntax().getOID())
        && areEqual(attr1.getExtraProperties().keySet(), attr2.getExtraProperties().keySet())
        && areEqual(toSet(attr1.getNormalizedNames()), toSet(attr2.getNormalizedNames()))
        && areEqual(toSet(attr1.getUserDefinedNames()), toSet(attr2.getUserDefinedNames()));
  }
  /**
@@ -834,54 +634,29 @@
   * @return <CODE>true</CODE> if the two schema objectclasses are equal and
   * <CODE>false</CODE> otherwise.
   */
  private static final boolean areObjectClassesEqual(ObjectClass oc1,
      ObjectClass oc2)
  private static final boolean areObjectClassesEqual(ObjectClass oc1, ObjectClass oc2)
  {
    boolean areEqual = oc1.getOID().equals(oc2.getOID()) &&
    oc1.isExtensibleObject() == oc2.isExtensibleObject();
    if (areEqual)
    {
      Object[] compareWithEqual = {
          getDefinitionWithFileName(oc1), getDefinitionWithFileName(oc2),
          oc1.getDescription(), oc2.getDescription(),
          oc1.getObjectClassType(), oc2.getObjectClassType(),
          oc1.getOptionalAttributes(), oc2.getOptionalAttributes(),
          oc1.getRequiredAttributes(), oc2.getRequiredAttributes(),
          oc1.getSuperiorClasses(), oc2.getSuperiorClasses()
      };
      for (int i=0; i<compareWithEqual.length && areEqual; i++)
      {
        areEqual = areEqual(compareWithEqual[i], compareWithEqual[i+1]);
        i ++;
      }
    return oc1.getOID().equals(oc2.getOID())
        && oc1.isExtensibleObject() == oc2.isExtensibleObject()
        && areEqual(getDefinitionWithFileName(oc1), getDefinitionWithFileName(oc2))
        && areEqual(oc1.getDescription(), oc2.getDescription())
        && areEqual(oc1.getObjectClassType(), oc2.getObjectClassType())
        && areEqual(oc1.getOptionalAttributes(), oc2.getOptionalAttributes())
        && areEqual(oc1.getRequiredAttributes(), oc2.getRequiredAttributes())
        && areEqual(oc1.getSuperiorClasses(), oc2.getSuperiorClasses())
        && areEqual(oc1.getExtraProperties().keySet(), oc2.getExtraProperties().keySet())
        && areEqual(toSet(oc1.getNormalizedNames()), toSet(oc2.getNormalizedNames()))
        && areEqual(toSet(oc1.getUserDefinedNames()), toSet(oc2.getUserDefinedNames()));
    }
    if (areEqual)
  private static Set<Object> toSet(Iterable<?> iterable)
    {
      Iterable<?>[] iterables = {
          oc1.getExtraProperties().keySet(), oc2.getExtraProperties().keySet(),
          oc1.getNormalizedNames(), oc2.getNormalizedNames(),
          oc1.getUserDefinedNames(), oc2.getUserDefinedNames()};
      for (int i=0; i<iterables.length && areEqual; i++)
    Set<Object> s = new HashSet<Object>();
    for (Object o : iterable)
      {
        Set<Object> set1 = new HashSet<Object>();
        Set<Object> set2 = new HashSet<Object>();
        for (Object o : iterables[i])
        {
          set1.add(o);
      s.add(o);
        }
        for (Object o : iterables[i+1])
        {
          set2.add(o);
        }
        areEqual = set1.equals(set2);
        i ++;
      }
    }
    return areEqual;
    return s;
  }
  /**
@@ -895,23 +670,11 @@
   */
  private static boolean areEqual(Object o1, Object o2)
  {
    boolean areEqual = false;
    if (o1 != null)
    {
      if (o2 != null)
      {
        areEqual = o1.equals(o2);
      return o1.equals(o2);
      }
      else
      {
        areEqual = false;
      }
    }
    else
    {
      areEqual = o2 == null;
    }
    return areEqual;
    return o2 == null;
  }
  /**
@@ -957,29 +720,27 @@
  public void setRootMonitor(CustomSearchResult rootMonitor)
  {
    this.rootMonitor = rootMonitor;
    runningTime = computeRunningTime(rootMonitor);
  }
  private long computeRunningTime(CustomSearchResult rootMonitor)
  {
    if (rootMonitor != null)
    {
      try
      {
        String start = (String)Utilities.getFirstMonitoringValue(
            rootMonitor,
            BasicMonitoringAttributes.START_DATE.getAttributeName());
        String current = (String)
        Utilities.getFirstMonitoringValue(rootMonitor,
            BasicMonitoringAttributes.CURRENT_DATE.getAttributeName());
        String start = (String) getFirstMonitoringValue(rootMonitor, START_DATE.getAttributeName());
        String current = (String) getFirstMonitoringValue(rootMonitor, CURRENT_DATE.getAttributeName());
        Date startTime = ConfigFromDirContext.utcParser.parse(start);
        Date currentTime = ConfigFromDirContext.utcParser.parse(current);
        runningTime = currentTime.getTime() - startTime.getTime();
        return currentTime.getTime() - startTime.getTime();
      }
      catch (Throwable t)
      {
        runningTime = -1;
        return -1;
      }
    }
    else
    {
      runningTime = -1;
    }
    return -1;
  }
  /**
opendj3-server-dev/src/guitools/org/opends/guitools/controlpanel/util/Utilities.java
@@ -2509,6 +2509,8 @@
          }
          catch (Throwable t2)
          {
            // Cannot convert it, just return it
            return o;
          }
        }
      }
opendj3-server-dev/src/server/org/opends/server/tools/status/StatusCli.java
@@ -494,7 +494,7 @@
   */
  private void writeStatusContents(ServerDescriptor desc, int maxLabelWidth)
  {
    writeLabelValue(INFO_SERVER_STATUS_LABEL.get(), getStatus(desc), maxLabelWidth);
    writeLabelValue(INFO_SERVER_STATUS_LABEL.get(), getStatus(desc).toString(), maxLabelWidth);
  }
  private LocalizableMessage getStatus(ServerDescriptor desc)
@@ -530,14 +530,14 @@
    writeLabelValue(INFO_CONNECTIONS_LABEL.get(), getNbConnection(desc), maxLabelWidth);
  }
  private LocalizableMessage getNbConnection(ServerDescriptor desc)
  private String getNbConnection(ServerDescriptor desc)
  {
    if (desc.getStatus() == ServerDescriptor.ServerStatus.STARTED)
    {
      final int nConn = desc.getOpenConnections();
      if (nConn >= 0)
      {
        return LocalizableMessage.raw(String.valueOf(nConn));
        return String.valueOf(nConn);
      }
      else if (!desc.isAuthenticated() || !desc.getExceptions().isEmpty())
      {
@@ -561,8 +561,7 @@
   */
  private void writeHostnameContents(ServerDescriptor desc, int maxLabelWidth)
  {
    LocalizableMessage text = LocalizableMessage.raw(desc.getHostname());
    writeLabelValue(INFO_HOSTNAME_LABEL.get(), text, maxLabelWidth);
    writeLabelValue(INFO_HOSTNAME_LABEL.get(), desc.getHostname(), maxLabelWidth);
  }
  /**
@@ -582,7 +581,7 @@
      TreeSet<DN> ordered = new TreeSet<DN>(administrators);
      for (DN dn : ordered)
      {
        writeLabelValue(INFO_ADMINISTRATIVE_USERS_LABEL.get(), LocalizableMessage.raw(dn.toString()), maxLabelWidth);
        writeLabelValue(INFO_ADMINISTRATIVE_USERS_LABEL.get(), dn.toString(), maxLabelWidth);
      }
    }
    else
@@ -591,7 +590,7 @@
    }
  }
  private LocalizableMessage getErrorText(ServerDescriptor desc)
  private String getErrorText(ServerDescriptor desc)
  {
    if (desc.getStatus() == ServerDescriptor.ServerStatus.STARTED
        && (!desc.isAuthenticated() || !desc.getExceptions().isEmpty()))
@@ -612,9 +611,7 @@
   */
  private void writeInstallPathContents(ServerDescriptor desc, int maxLabelWidth)
  {
    writeLabelValue(INFO_INSTALLATION_PATH_LABEL.get(),
            LocalizableMessage.raw(desc.getInstallPath()),
            maxLabelWidth);
    writeLabelValue(INFO_INSTALLATION_PATH_LABEL.get(), desc.getInstallPath(), maxLabelWidth);
  }
  /**
@@ -628,9 +625,7 @@
   */
  private void writeInstancePathContents(ServerDescriptor desc, int maxLabelWidth)
  {
    writeLabelValue(INFO_CTRL_PANEL_INSTANCE_PATH_LABEL.get(),
            LocalizableMessage.raw(desc.getInstancePath()),
            maxLabelWidth);
    writeLabelValue(INFO_CTRL_PANEL_INSTANCE_PATH_LABEL.get(), desc.getInstancePath(), maxLabelWidth);
  }
  /**
@@ -643,10 +638,7 @@
   */
  private void writeVersionContents(ServerDescriptor desc, int maxLabelWidth)
  {
    String openDSVersion = desc.getOpenDSVersion();
    writeLabelValue(INFO_OPENDS_VERSION_LABEL.get(),
            LocalizableMessage.raw(openDSVersion),
            maxLabelWidth);
    writeLabelValue(INFO_OPENDS_VERSION_LABEL.get(), desc.getOpenDSVersion(), maxLabelWidth);
  }
  /**
@@ -664,7 +656,7 @@
    writeLabelValue(INFO_JAVA_VERSION_LABEL.get(), getJavaVersion(desc), maxLabelWidth);
  }
  private LocalizableMessage getJavaVersion(ServerDescriptor desc)
  private String getJavaVersion(ServerDescriptor desc)
  {
    if (desc.getStatus() == ServerDescriptor.ServerStatus.STARTED)
    {
@@ -672,7 +664,7 @@
      {
        return getNotAvailableBecauseAuthenticationIsRequiredText();
      }
      return LocalizableMessage.raw(desc.getJavaVersion());
      return desc.getJavaVersion();
    }
    return getNotAvailableBecauseServerIsDownText();
  }
@@ -690,17 +682,10 @@
  private void writeAdminConnectorContents(ServerDescriptor desc, int maxLabelWidth)
  {
    ConnectionHandlerDescriptor adminConnector = desc.getAdminConnector();
    if (adminConnector != null)
    {
      LocalizableMessage text = INFO_CTRL_PANEL_ADMIN_CONNECTOR_DESCRIPTION.get(adminConnector.getPort());
      writeLabelValue(INFO_CTRL_PANEL_ADMIN_CONNECTOR_LABEL.get(), text, maxLabelWidth);
    }
    else
    {
      writeLabelValue(INFO_CTRL_PANEL_ADMIN_CONNECTOR_LABEL.get(),
          INFO_NOT_AVAILABLE_SHORT_LABEL.get(),
          maxLabelWidth);
    }
    LocalizableMessage text = adminConnector != null
        ? INFO_CTRL_PANEL_ADMIN_CONNECTOR_DESCRIPTION.get(adminConnector.getPort())
        : INFO_NOT_AVAILABLE_SHORT_LABEL.get();
    writeLabelValue(INFO_CTRL_PANEL_ADMIN_CONNECTOR_LABEL.get(), text.toString(), maxLabelWidth);
  }
  /**
@@ -823,10 +808,10 @@
   *
   * @return the text.
   */
  private LocalizableMessage getNotAvailableBecauseServerIsDownText()
  private String getNotAvailableBecauseServerIsDownText()
  {
    displayMustStartLegend = true;
    return INFO_NOT_AVAILABLE_SERVER_DOWN_CLI_LABEL.get();
    return INFO_NOT_AVAILABLE_SERVER_DOWN_CLI_LABEL.get().toString();
  }
  /**
@@ -835,10 +820,10 @@
   *
   * @return the text.
   */
  private LocalizableMessage getNotAvailableBecauseAuthenticationIsRequiredText()
  private String getNotAvailableBecauseAuthenticationIsRequiredText()
  {
    displayMustAuthenticateLegend = true;
    return INFO_NOT_AVAILABLE_AUTHENTICATION_REQUIRED_CLI_LABEL.get();
    return INFO_NOT_AVAILABLE_AUTHENTICATION_REQUIRED_CLI_LABEL.get().toString();
  }
  /**
@@ -846,9 +831,9 @@
   *
   * @return the text.
   */
  private LocalizableMessage getNotAvailableText()
  private String getNotAvailableText()
  {
    return INFO_NOT_AVAILABLE_LABEL.get();
    return INFO_NOT_AVAILABLE_LABEL.get().toString();
  }
  /**
@@ -936,20 +921,20 @@
   return v.split("<br>");
  }
  private LocalizableMessage getCellValue(Object v, ServerDescriptor desc)
  private String getCellValue(Object v, ServerDescriptor desc)
  {
    if (v != null)
    {
      if (v instanceof String)
      {
        return LocalizableMessage.raw((String) v);
        return (String) v;
      }
      else if (v instanceof Integer)
      {
        int nEntries = ((Integer)v).intValue();
        if (nEntries >= 0)
        {
          return LocalizableMessage.raw(String.valueOf(nEntries));
          return String.valueOf(nEntries);
        }
        else if (!desc.isAuthenticated() || !desc.getExceptions().isEmpty())
        {
@@ -1010,7 +995,7 @@
      for (int j=0; j<tableModel.getColumnCount(); j++)
      {
        Object v = tableModel.getValueAt(i, j);
        LocalizableMessage value = getValue(desc, isRunning, v);
        String value = getValue(desc, isRunning, v);
        boolean doWrite = true;
        boolean isReplicated =
@@ -1030,7 +1015,7 @@
    }
  }
  private LocalizableMessage getValue(ServerDescriptor desc, boolean isRunning, Object v)
  private String getValue(ServerDescriptor desc, boolean isRunning, Object v)
  {
    if (v != null)
    {
@@ -1048,18 +1033,18 @@
      }
      else if (v instanceof String)
      {
        return LocalizableMessage.raw((String) v);
        return (String) v;
      }
      else if (v instanceof LocalizableMessage)
      {
        return (LocalizableMessage) v;
        return ((LocalizableMessage) v).toString();
      }
      else if (v instanceof Integer)
      {
        final int nEntries = ((Integer) v).intValue();
        if (nEntries >= 0)
        {
          return LocalizableMessage.raw(String.valueOf(nEntries));
          return String.valueOf(nEntries);
        }
        return getNotAvailableText(desc, isRunning);
      }
@@ -1068,10 +1053,10 @@
        throw new IllegalStateException("Unknown object type: " + v);
      }
    }
    return LocalizableMessage.EMPTY;
    return "";
  }
  private LocalizableMessage getNotAvailableText(ServerDescriptor desc, boolean isRunning)
  private String getNotAvailableText(ServerDescriptor desc, boolean isRunning)
  {
    if (!isRunning)
    {
@@ -1084,8 +1069,7 @@
    return getNotAvailableText();
  }
  private void writeLabelValue(final LocalizableMessage label,
      final LocalizableMessage value, final int maxLabelWidth)
  private void writeLabelValue(final LocalizableMessage label, final String value, final int maxLabelWidth)
  {
    final LocalizableMessageBuilder buf = new LocalizableMessageBuilder();
    buf.append(label);