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

Jean-Noel Rouvignac
16.10.2015 1ef65104c4113a1c6fad7ee93bc9862218a4bc68
opendj-server-legacy/src/main/java/org/opends/server/backends/RootDSEBackend.java
@@ -576,61 +576,8 @@
        supportedTlsCiphers);
    addAttribute(supportedTLSCiphersAttr, dseUserAttrs, dseOperationalAttrs);
    // Add all the standard "static" attributes.
    for (Attribute a : staticDSEAttributes)
    {
      AttributeType type = a.getAttributeType();
      if (type.isOperational() && !showAllAttributes)
      {
        List<Attribute> attrs = dseOperationalAttrs.get(type);
        if (attrs == null)
        {
          attrs = new ArrayList<Attribute>();
          dseOperationalAttrs.put(type, attrs);
        }
        attrs.add(a);
      }
      else
      {
        List<Attribute> attrs = dseUserAttrs.get(type);
        if (attrs == null)
        {
          attrs = new ArrayList<Attribute>();
          dseUserAttrs.put(type, attrs);
        }
        attrs.add(a);
      }
    }
    // Add all the user-defined attributes.
    for (Attribute a : userDefinedAttributes)
    {
      AttributeType type = a.getAttributeType();
      if (type.isOperational() && !showAllAttributes)
      {
        List<Attribute> attrs = dseOperationalAttrs.get(type);
        if (attrs == null)
        {
          attrs = new ArrayList<Attribute>();
          dseOperationalAttrs.put(type, attrs);
        }
        attrs.add(a);
      }
      else
      {
        List<Attribute> attrs = dseUserAttrs.get(type);
        if (attrs == null)
        {
          attrs = new ArrayList<Attribute>();
          dseUserAttrs.put(type, attrs);
        }
        attrs.add(a);
      }
    }
    addAll(staticDSEAttributes, dseUserAttrs, dseOperationalAttrs);
    addAll(userDefinedAttributes, dseUserAttrs, dseOperationalAttrs);
    // Construct and return the entry.
    Entry e = new Entry(rootDSEDN, dseObjectClasses, dseUserAttrs,
@@ -639,6 +586,26 @@
    return e;
  }
  private void addAll(ArrayList<Attribute> attributes,
      Map<AttributeType, List<Attribute>> userAttrs, Map<AttributeType, List<Attribute>> operationalAttrs)
  {
    for (Attribute a : attributes)
    {
      AttributeType type = a.getAttributeType();
      final Map<AttributeType, List<Attribute>> attrsMap = type.isOperational() && !showAllAttributes
          ? operationalAttrs
          : userAttrs;
      List<Attribute> attrs = attrsMap.get(type);
      if (attrs == null)
      {
        attrs = new ArrayList<Attribute>();
        attrsMap.put(type, attrs);
      }
      attrs.add(a);
    }
  }
  private void addAttribute(Attribute publicNamingContextAttr,