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

ludovicp
27.41.2010 3bcc70c3d28164434f018c3c8e9f775be7100708
Several minor fixes in command line utilities and with the Monitoring backend
7 files modified
83 ■■■■ changed files
opends/src/messages/messages/tools.properties 2 ●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/installer/InstallerHelper.java 2 ●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/backends/MonitorBackend.java 22 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/tools/dsconfig/DSConfig.java 11 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/tools/dsconfig/PropertyValueEditor.java 38 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/tools/dsconfig/SetPropSubCommandHandler.java 4 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/util/cli/ConsoleApplication.java 4 ●●●● patch | view | raw | blame | history
opends/src/messages/messages/tools.properties
@@ -2227,7 +2227,7 @@
SEVERE_ERR_JAVAPROPERTIES_WITH_PROPERTIES_FILE_1491=The file properties "%s" \
 cannot be read.  Check that it exists and that you have read rights to it
SEVERE_ERR_JAVAPROPERTIES_WITH_DESTINATION_FILE_1492=The destination file "%s" \
 cannot be written.  Check that you have right reads to it
 cannot be written.  Check that you have write rights to it
SEVERE_ERR_JAVAPROPERTIES_WRITING_DESTINATION_FILE_1493=The destination file \
 "%s" cannot be written.  Check that you have right reads to it
INFO_JAVAPROPERTIES_SUCCESSFUL_NON_DEFAULT_1494=The script file %s was \
opends/src/quicksetup/org/opends/quicksetup/installer/InstallerHelper.java
@@ -993,7 +993,7 @@
    if (!fileProperties.containsKey("default.java-home"))
    {
      otherProperties.put("default.java-home=", javaHome);
      otherProperties.put("default.java-home", javaHome);
    }
    writeSetOpenDSJavaHome(installPath, javaHome, args, otherProperties);
opends/src/server/org/opends/server/backends/MonitorBackend.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2006-2009 Sun Microsystems, Inc.
 *      Copyright 2006-2010 Sun Microsystems, Inc.
 */
package org.opends.server.backends;
@@ -674,8 +674,26 @@
                                                           true);
    monitorClasses.put(monitorOC, OC_MONITOR_BRANCH);
    HashMap<AttributeType,List<Attribute>> monitorUserAttrs =
      new LinkedHashMap<AttributeType,List<Attribute>>();
    RDN rdn = dn.getRDN();
    if (rdn != null)
    {
      // Add the RDN values
      for (int i=0; i<rdn.getNumValues(); i++)
      {
        AttributeType attributeType = rdn.getAttributeType(i);
        AttributeValue value = rdn.getAttributeValue(attributeType);
        Attribute attr = Attributes.create(attributeType, value);
        List<Attribute> attrList = new ArrayList<Attribute>(1);
        attrList.add(attr);
        monitorUserAttrs.put(attributeType, attrList);
      }
    }
    // Construct and return the entry.
    Entry  e = new Entry(dn, monitorClasses, null, null);
    Entry  e = new Entry(dn, monitorClasses, monitorUserAttrs, null);
    e.processVirtualAttributes();
    return e;
  }
opends/src/server/org/opends/server/tools/dsconfig/DSConfig.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2007-2009 Sun Microsystems, Inc.
 *      Copyright 2007-2010 Sun Microsystems, Inc.
 */
package org.opends.server.tools.dsconfig;
@@ -185,11 +185,11 @@
      Message ufn = rd.getUserFriendlyName();
      Message ufpn = null;
      if (rd instanceof InstantiableRelationDefinition) {
      if (rd instanceof InstantiableRelationDefinition<?,?>) {
        InstantiableRelationDefinition<?, ?> ir =
          (InstantiableRelationDefinition<?, ?>) rd;
        ufpn = ir.getUserFriendlyPluralName();
      } else if (rd instanceof SetRelationDefinition) {
      } else if (rd instanceof SetRelationDefinition<?,?>) {
        SetRelationDefinition<?, ?> sr =
          (SetRelationDefinition<?, ?>) rd;
        ufpn = sr.getUserFriendlyPluralName();
@@ -1124,9 +1124,8 @@
  /**
   * Prints the contents of a command builder.  This method has been created
   * since SetPropSubCommandHandler calls it.  All the logic of DSConfig is on
   * this method.  Currently it simply writes the content of the CommandBuilder
   * to the standard output, but if we provide an option to write the content
   * to a file only the implementation of this method must be changed.
   * this method.  It writes the content of the CommandBuilder to the standard
   * output, or to a file depending on the options provided by the user.
   * @param commandBuilder the command builder to be printed.
   */
  void printCommandBuilder(CommandBuilder commandBuilder)
opends/src/server/org/opends/server/tools/dsconfig/PropertyValueEditor.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2008-2009 Sun Microsystems, Inc.
 *      Copyright 2008-2010 Sun Microsystems, Inc.
 */
package org.opends.server.tools.dsconfig;
@@ -2401,16 +2401,48 @@
    {
      if (newValues.containsAll(previousValues))
      {
        registerAddModification(pd, newValues, previousValues);
        if (newValues.size() <= 1)
        {
          registerSetModification(pd, newValues, previousValues);
        }
        else
        {
          registerAddModification(pd, newValues, previousValues);
        }
      }
      else if (previousValues.containsAll(newValues))
      {
        registerRemoveModification(pd, newValues, previousValues);
      }
      else
      else if (newValues.size() <= 1)
      {
        registerSetModification(pd, newValues, previousValues);
      }
      else
      {
        // Split into two operations: remove and add
        SortedSet<T> removedValues = new TreeSet<T>();
        removedValues.addAll(previousValues);
        removedValues.removeAll(newValues);
        PropertyEditorModification<T> removeMod =
          PropertyEditorModification.createRemoveModification(pd,
            removedValues, previousValues);
        addModification(removeMod);
        SortedSet<T> retainedValues = new TreeSet<T>();
        retainedValues.addAll(previousValues);
        retainedValues.retainAll(newValues);
        SortedSet<T> addedValues = new TreeSet<T>();
        addedValues.addAll(newValues);
        addedValues.removeAll(retainedValues);
        PropertyEditorModification<T> addMod =
          PropertyEditorModification.createAddModification(pd,
              addedValues, retainedValues);
        addModification(addMod);
      }
    }
  }
opends/src/server/org/opends/server/tools/dsconfig/SetPropSubCommandHandler.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2007-2009 Sun Microsystems, Inc.
 *      Copyright 2007-2010 Sun Microsystems, Inc.
 */
package org.opends.server.tools.dsconfig;
@@ -388,7 +388,7 @@
    try {
      for (PropertyDefinition<?> pd : d.getAllPropertyDefinitions()) {
        if (pd instanceof AggregationPropertyDefinition) {
        if (pd instanceof AggregationPropertyDefinition<?,?>) {
          // Runtime cast is required to workaround a
          // bug in JDK versions prior to 1.5.0_08.
          AggregationPropertyDefinition<?, ?> apd =
opends/src/server/org/opends/server/util/cli/ConsoleApplication.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2008-2009 Sun Microsystems, Inc.
 *      Copyright 2008-2010 Sun Microsystems, Inc.
 */
package org.opends.server.util.cli;
@@ -645,7 +645,7 @@
          String.valueOf(defaultValue));
    }
    return readValidatedInput(prompt, callback);
    return readValidatedInput(prompt, callback, CONFIRMATION_MAX_TRIES);
  }
  /**