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

Nicolas Capponi
11.56.2014 599c307ea27723bd289516103d4162c56fed7f8e
opendj3-server-dev/src/guitools/org/opends/guitools/controlpanel/datamodel/ServerDescriptor.java
@@ -772,7 +772,7 @@
    boolean areEqual = attr1.getOID().equals(attr2.getOID()) &&
    attr1.isCollective() == attr2.isCollective() &&
    attr1.isNoUserModification() == attr2.isNoUserModification() &&
    attr1.isObjectClassType() == attr2.isObjectClassType() &&
    attr1.isObjectClass() == attr2.isObjectClass() &&
    attr1.isObsolete() == attr2.isObsolete() &&
    attr1.isOperational() == attr2.isOperational() &&
    attr1.isSingleValue() == attr2.isSingleValue();
@@ -788,7 +788,7 @@
          attr1.getSubstringMatchingRule(), attr2.getSubstringMatchingRule(),
          attr1.getSuperiorType(), attr2.getSuperiorType(),
          attr1.getSyntax(), attr2.getSyntax(),
          attr1.getSyntaxOID(), attr2.getSyntaxOID()
          attr1.getSyntax().getOID(), attr2.getSyntax().getOID()
      };
      for (int i=0; i<compareWithEqual.length && areEqual; i++)
opendj3-server-dev/src/guitools/org/opends/guitools/controlpanel/ui/ManageTasksPanel.java
@@ -799,7 +799,7 @@
      builder = new AttributeBuilder(attrDescr);
    }
    if(builder.getAttributeType().isBinary())
    if(builder.getAttributeType().getSyntax().isBEREncodingRequired())
    {
      //resetting doesn't hurt and returns false.
      builder.setOption("binary");
opendj3-server-dev/src/guitools/org/opends/guitools/controlpanel/util/Utilities.java
@@ -2239,7 +2239,7 @@
      AttributeType attr = schema.getAttributeType(attrName);
      if (attr != null)
      {
        String syntaxOID = attr.getSyntaxOID();
        String syntaxOID = attr.getSyntax().getOID();
        hasImageSyntax = SchemaConstants.SYNTAX_JPEG_OID.equals(syntaxOID);
      }
    }
@@ -2265,7 +2265,7 @@
      AttributeType attr = schema.getAttributeType(attrName);
      if (attr != null)
      {
        String syntaxOID = attr.getSyntaxOID();
        String syntaxOID = attr.getSyntax().getOID();
        for (String oid : binarySyntaxOIDs)
        {
          if (oid.equals(syntaxOID))
@@ -2303,7 +2303,7 @@
      AttributeType attr = schema.getAttributeType(attrName);
      if (attr != null)
      {
        String syntaxOID = attr.getSyntaxOID();
        String syntaxOID = attr.getSyntax().getOID();
        for (String oid : passwordSyntaxOIDs)
        {
          if (oid.equals(syntaxOID))
opendj3-server-dev/src/server/org/opends/server/authorization/dseecompat/AciHandler.java
@@ -1151,7 +1151,7 @@
   */
  private boolean isAttributeDN(AttributeType attribute)
  {
    return SYNTAX_DN_OID.equals(attribute.getSyntaxOID());
    return SYNTAX_DN_OID.equals(attribute.getSyntax().getOID());
  }
opendj3-server-dev/src/server/org/opends/server/core/AddOperationBasis.java
@@ -377,7 +377,7 @@
                ERR_ADD_ATTR_IS_NO_USER_MOD.get(entryDN, attr.getName()));
          }
          if(attrType.isBinary())
          if(attrType.getSyntax().isBEREncodingRequired())
          {
            if(!attr.hasOption("binary"))
            {
@@ -397,7 +397,7 @@
            }
          }
          if (attrType.isObjectClassType())
          if (attrType.isObjectClass())
          {
            for (ByteString os : a.getValues())
            {
opendj3-server-dev/src/server/org/opends/server/core/AttributeSyntaxConfigManager.java
@@ -256,7 +256,7 @@
      String oid = syntax.getOID();
      for (AttributeType at : DirectoryServer.getAttributeTypes().values())
      {
        if (oid.equals(at.getSyntaxOID()))
        if (oid.equals(at.getSyntax().getOID()))
        {
          LocalizableMessage message = WARN_CONFIG_SCHEMA_CANNOT_DELETE_SYNTAX_IN_USE.get(
                  syntax.getSyntaxName(), at.getNameOrOID());
@@ -326,7 +326,7 @@
        String oid = syntax.getOID();
        for (AttributeType at : DirectoryServer.getAttributeTypes().values())
        {
          if (oid.equals(at.getSyntaxOID()))
          if (oid.equals(at.getSyntax().getOID()))
          {
            LocalizableMessage message =
                    WARN_CONFIG_SCHEMA_CANNOT_DISABLE_SYNTAX_IN_USE.get(
opendj3-server-dev/src/server/org/opends/server/core/ModifyOperationBasis.java
@@ -237,7 +237,7 @@
           Attribute attr = mod.getAttribute();
           AttributeType type = attr.getAttributeType();
           if(type.isBinary())
           if(type.getSyntax().isBEREncodingRequired())
           {
             if(!attr.hasOption("binary"))
             {
opendj3-server-dev/src/server/org/opends/server/core/PasswordPolicyFactory.java
@@ -224,7 +224,7 @@
      // user password or auth password syntax.
      final AttributeType passwordAttribute = configuration
          .getPasswordAttribute();
      final String syntaxOID = passwordAttribute.getSyntaxOID();
      final String syntaxOID = passwordAttribute.getSyntax().getOID();
      final boolean authPasswordSyntax;
      if (syntaxOID.equals(SYNTAX_AUTH_PASSWORD_OID))
      {
opendj3-server-dev/src/server/org/opends/server/core/PasswordPolicyState.java
@@ -3325,7 +3325,7 @@
      newTimestamp++;
    }
    String newHistStr = GeneralizedTimeSyntax.format(newTimestamp) + "#" +
                        passwordPolicy.getPasswordAttribute().getSyntaxOID() +
                        passwordPolicy.getPasswordAttribute().getSyntax().getOID() +
                        "#" + encodedPassword;
    Attribute newHistAttr = Attributes.create(historyType, newHistStr);
opendj3-server-dev/src/server/org/opends/server/core/SearchOperationBasis.java
@@ -1390,7 +1390,7 @@
    switch (filter.getFilterType())
    {
    case EQUALITY:
      if (filter.getAttributeType().isObjectClassType())
      if (filter.getAttributeType().isObjectClass())
      {
        AttributeValue v = filter.getAssertionValue();
        // FIXME : technically this is not correct since the presence
opendj3-server-dev/src/server/org/opends/server/core/SubentryPasswordPolicy.java
@@ -183,7 +183,7 @@
      }
      // Check the syntax.
      final String syntaxOID = pPasswordAttribute.getSyntaxOID();
      final String syntaxOID = pPasswordAttribute.getSyntax().getOID();
      if (SYNTAX_AUTH_PASSWORD_OID.equals(syntaxOID))
      {
        pAuthPasswordSyntax = true;
opendj3-server-dev/src/server/org/opends/server/plugins/PasswordPolicyImportPlugin.java
@@ -255,11 +255,11 @@
    HashSet<AttributeType> userPWTypes = new HashSet<AttributeType>();
    for (AttributeType t : DirectoryServer.getAttributeTypes().values())
    {
      if (t.getSyntaxOID().equals(SYNTAX_AUTH_PASSWORD_OID))
      if (t.getSyntax().getOID().equals(SYNTAX_AUTH_PASSWORD_OID))
      {
        authPWTypes.add(t);
      }
      else if (t.getSyntaxOID().equals(SYNTAX_USER_PASSWORD_OID))
      else if (t.getSyntax().getOID().equals(SYNTAX_USER_PASSWORD_OID))
      {
        userPWTypes.add(t);
      }
opendj3-server-dev/src/server/org/opends/server/plugins/ReferentialIntegrityPlugin.java
@@ -521,8 +521,8 @@
   */
  private boolean isAttributeSyntaxValid(AttributeType attribute)
  {
    return (attribute.getSyntaxOID().equals(SYNTAX_DN_OID) ||
            attribute.getSyntaxOID().equals(SYNTAX_NAME_AND_OPTIONAL_UID_OID));
    return (attribute.getSyntax().getOID().equals(SYNTAX_DN_OID) ||
            attribute.getSyntax().getOID().equals(SYNTAX_NAME_AND_OPTIONAL_UID_OID));
  }
  /**
opendj3-server-dev/src/server/org/opends/server/protocols/internal/InternalClientConnection.java
@@ -887,7 +887,7 @@
         new ArrayList<AttributeValue>();
    for (Attribute a : addRecord.getAttributes())
    {
      if (a.getAttributeType().isObjectClassType())
      if (a.getAttributeType().isObjectClass())
      {
        for (AttributeValue v : a)
        {
opendj3-server-dev/src/server/org/opends/server/protocols/ldap/SearchResultEntryProtocolOp.java
@@ -561,7 +561,7 @@
      Attribute     attr     = a.toAttribute();
      AttributeType attrType = attr.getAttributeType();
      if (attrType.isObjectClassType())
      if (attrType.isObjectClass())
      {
        for (ByteString os : a.getValues())
        {
opendj3-server-dev/src/server/org/opends/server/replication/server/ReplicationBackend.java
@@ -771,7 +771,7 @@
          for (RawAttribute a : addOperation.getRawAttributes())
          {
            Attribute attr = a.toAttribute();
            if (attr.getAttributeType().isObjectClassType())
            if (attr.getAttributeType().isObjectClass())
            {
              for (ByteString os : a.getValues())
              {
opendj3-server-dev/src/server/org/opends/server/tools/LDIFModify.java
@@ -322,7 +322,7 @@
      for (Attribute a : add.getAttributes())
      {
        AttributeType t = a.getAttributeType();
        if (t.isObjectClassType())
        if (t.isObjectClass())
        {
          for (AttributeValue v : a)
          {
opendj3-server-dev/src/server/org/opends/server/tools/makeldif/TemplateEntry.java
@@ -313,7 +313,7 @@
    for (AttributeType t : attributes.keySet())
    {
      ArrayList<TemplateValue> valueList = attributes.get(t);
      if (t.isObjectClassType())
      if (t.isObjectClass())
      {
        for (TemplateValue v : valueList)
        {
opendj3-server-dev/src/server/org/opends/server/types/AttributeType.java
@@ -113,9 +113,6 @@
  // The definition string used to create this attribute type.
  private final String definition;
  // The OID for the associated syntax.
  private final String syntaxOID;
  // The substring matching rule for this attribute type.
  private final SubstringMatchingRule substringMatchingRule;
@@ -320,8 +317,6 @@
    {
      this.syntax = syntax;
    }
    syntaxOID = this.syntax.getOID();
    if (approximateMatchingRule == null)
    {
@@ -447,46 +442,6 @@
    return syntax;
  }
  /**
   * Indicates whether this attribute syntax requires BER encoding.
   *
   * @return {@code true} if this syntax required BER encoding.
   */
  public boolean isBinary()
  {
    return syntax.isBEREncodingRequired();
  }
  /**
   * Indicates whether this attribute syntax is human readable.
   *
   * @return {@code true} if this syntax is human readable.
   */
  public boolean isHumanReadable()
  {
    return syntax.isHumanReadable();
  }
  /**
   * Retrieves the OID for this syntax associated with this attribute
   * type.
   *
   * @return  The OID for this syntax associated with this attribute
   *          type.
   */
  public String getSyntaxOID()
  {
    return syntaxOID;
  }
  /**
   * Retrieves the matching rule that should be used for approximate
   * matching with this attribute type.
@@ -619,7 +574,7 @@
   * @return  <CODE>true</CODE> if this attribute type is the
   *          objectclass type, or <CODE>false</CODE> if not.
   */
  public boolean isObjectClassType()
  public boolean isObjectClass()
  {
    return isObjectClassType;
  }
opendj3-server-dev/src/server/org/opends/server/types/Entry.java
@@ -524,7 +524,7 @@
      boolean includeSubordinates)
  {
    // Handle object class.
    if (attributeType.isObjectClassType())
    if (attributeType.isObjectClass())
    {
      return !objectClasses.isEmpty() && (options == null || options.isEmpty());
    }
@@ -701,7 +701,7 @@
    {
      return attributes;
    }
    if (attributeType.isObjectClassType() && !objectClasses.isEmpty())
    if (attributeType.isObjectClass() && !objectClasses.isEmpty())
    {
      return newList(getObjectClassAttribute());
    }
@@ -839,7 +839,7 @@
        attrs = operationalAttributes.get(attributeType);
        if (attrs == null)
        {
          if (attributeType.isObjectClassType()
          if (attributeType.isObjectClass()
              && !objectClasses.isEmpty()
              && (options == null || options.isEmpty()))
          {
@@ -1425,7 +1425,7 @@
  {
    attachment = null;
    if (attributeType.isObjectClassType())
    if (attributeType.isObjectClass())
    {
      objectClasses.clear();
      return true;
@@ -1465,7 +1465,7 @@
  {
    attachment = null;
    if (attribute.getAttributeType().isObjectClassType())
    if (attribute.getAttributeType().isObjectClass())
    {
      if (attribute.isEmpty())
      {
@@ -1633,7 +1633,7 @@
    // We'll need to handle changes to the objectclass attribute in a
    // special way.
    if (t.isObjectClassType())
    if (t.isObjectClass())
    {
      Map<ObjectClass, String> ocs = new LinkedHashMap<ObjectClass, String>();
      for (AttributeValue v : a)
@@ -2018,7 +2018,7 @@
      {
        if (! (userAttributes.containsKey(t) ||
               operationalAttributes.containsKey(t) ||
               t.isObjectClassType()))
               t.isObjectClass()))
        {
          LocalizableMessage message =
                  ERR_ENTRY_SCHEMA_MISSING_REQUIRED_ATTR_FOR_OC.get(
@@ -2206,7 +2206,7 @@
    {
      if (! (userAttributes.containsKey(t) ||
             operationalAttributes.containsKey(t) ||
             t.isObjectClassType()))
             t.isObjectClass()))
      {
        LocalizableMessage message =
                ERR_ENTRY_SCHEMA_MISSING_REQUIRED_ATTR_FOR_DCR.get(
@@ -4663,7 +4663,7 @@
    AttributeType attributeType = attribute.getAttributeType();
    if (attribute.getAttributeType().isObjectClassType())
    if (attribute.getAttributeType().isObjectClass())
    {
      // We will not do any validation of the object classes - this is
      // left to the caller.
@@ -4944,7 +4944,7 @@
        else
        {
          // Recognized attribute type.
          if (attrType.isObjectClassType()) {
          if (attrType.isObjectClass()) {
            if (!omitReal)
            {
              if (omitValues)
opendj3-server-dev/src/server/org/opends/server/util/LDIFReader.java
@@ -1082,7 +1082,7 @@
      }
       //The attribute is not being ignored so check for binary option.
      if(checkSchema && !attrType.isBinary())
      if(checkSchema && !attrType.getSyntax().isBEREncodingRequired())
      {
       if(attribute.hasOption("binary"))
        {
@@ -1371,7 +1371,7 @@
      builder = new AttributeBuilder(attrDescr);
    }
    if(builder.getAttributeType().isBinary())
    if(builder.getAttributeType().getSyntax().isBEREncodingRequired())
    {
      //resetting doesn't hurt and returns false.
      builder.setOption("binary");
opendj3-server-dev/src/server/org/opends/server/workflowelement/localbackend/LocalBackendModifyOperation.java
@@ -1435,7 +1435,7 @@
    // If the attribute to be added is the object class attribute then
    // make sure that all the object classes are known and not
    // obsoleted.
    if (attr.getAttributeType().isObjectClassType())
    if (attr.getAttributeType().isObjectClass())
    {
      validateObjectClasses(attr);
    }
@@ -1469,7 +1469,7 @@
   */
  private void validateObjectClasses(Attribute attr) throws DirectoryException
  {
    Reject.ifFalse(attr.getAttributeType().isObjectClassType());
    Reject.ifFalse(attr.getAttributeType().isObjectClass());
    for (AttributeValue v : attr)
    {
      String name = v.getValue().toString();
@@ -1638,7 +1638,7 @@
    // If the attribute to be replaced is the object class attribute
    // then make sure that all the object classes are known and not
    // obsoleted.
    if (attr.getAttributeType().isObjectClassType())
    if (attr.getAttributeType().isObjectClass())
    {
      validateObjectClasses(attr);
    }
opendj3-server-dev/tests/unit-tests-testng/src/server/org/opends/server/types/TestAttributeType.java
@@ -630,7 +630,7 @@
  /**
   * Create test data for testing the
   * {@link AttributeType#isObjectClassType()} method.
   * {@link AttributeType#isObjectClass()} method.
   *
   * @return Returns the array of test data.
   */
@@ -661,7 +661,7 @@
        "1.2.3");
    AttributeType type = builder.getInstance();
    Assert.assertEquals(type.isObjectClassType(), result);
    Assert.assertEquals(type.isObjectClass(), result);
  }