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

Jean-Noel Rouvignac
26.11.2014 98a5df3565beaa1999020a16fcb5338d13d5b50f
opends/src/server/org/opends/server/core/AddOperationBasis.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2007-2010 Sun Microsystems, Inc.
 *      Portions copyright 2013 ForgeRock AS
 *      Portions copyright 2013-2014 ForgeRock AS
 */
package org.opends.server.core;
@@ -94,9 +94,6 @@
  /** The set of objectclasses for the entry to add. */
  private Map<ObjectClass,String> objectClasses;
  /** The change number that has been assigned to this operation. */
  private long changeNumber;
  /** The flag indicates if an LDAP error was reported. */
  private boolean ldapError;
@@ -132,7 +129,6 @@
    operationalAttributes = null;
    objectClasses         = null;
    proxiedAuthorizationDN = null;
    changeNumber          = -1;
  }
@@ -198,22 +194,16 @@
    responseControls = new ArrayList<Control>();
    proxiedAuthorizationDN = null;
    cancelRequest    = null;
    changeNumber     = -1;
  }
  /**
   * {@inheritDoc}
   */
  /** {@inheritDoc} */
  @Override
  public final ByteString getRawEntryDN()
  {
    return rawEntryDN;
  }
  /**
   * {@inheritDoc}
   */
  /** {@inheritDoc} */
  @Override
  public final void setRawEntryDN(ByteString rawEntryDN)
  {
@@ -222,10 +212,7 @@
    entryDN = null;
  }
  /**
   * {@inheritDoc}
   */
  /** {@inheritDoc} */
  @Override
  public final DN getEntryDN()
  {
@@ -251,20 +238,14 @@
    return entryDN;
  }
  /**
   * {@inheritDoc}
   */
  /** {@inheritDoc} */
  @Override
  public final List<RawAttribute> getRawAttributes()
  {
    return rawAttributes;
  }
  /**
   * {@inheritDoc}
   */
  /** {@inheritDoc} */
  @Override
  public final void addRawAttribute(RawAttribute rawAttribute)
  {
@@ -275,10 +256,7 @@
    operationalAttributes = null;
  }
  /**
   * {@inheritDoc}
   */
  /** {@inheritDoc} */
  @Override
  public final void setRawAttributes(List<RawAttribute> rawAttributes)
  {
@@ -289,11 +267,7 @@
    operationalAttributes = null;
  }
  /**
   * {@inheritDoc}
   */
  /** {@inheritDoc} */
  @Override
  public final Map<ObjectClass,String> getObjectClasses()
  {
@@ -303,33 +277,21 @@
    return objectClasses;
  }
  /**
   * {@inheritDoc}
   */
  /** {@inheritDoc} */
  @Override
  public final void addObjectClass(ObjectClass objectClass, String name)
  {
    objectClasses.put(objectClass, name);
  }
  /**
   * {@inheritDoc}
   */
  /** {@inheritDoc} */
  @Override
  public final void removeObjectClass(ObjectClass objectClass)
  {
    objectClasses.remove(objectClass);
  }
  /**
   * {@inheritDoc}
   */
  /** {@inheritDoc} */
  @Override
  public final Map<AttributeType,List<Attribute>> getUserAttributes()
  {
@@ -339,10 +301,7 @@
    return userAttributes;
  }
  /**
   * {@inheritDoc}
   */
  /** {@inheritDoc} */
  @Override
  public final Map<AttributeType,List<Attribute>> getOperationalAttributes()
  {
@@ -396,16 +355,11 @@
              attr = builder.toAttribute();
            }
          }
          else
          else if (attr.hasOption("binary"))
          {
            // binary option is not honored for non-BER-encodable attributes.
            if(attr.hasOption("binary"))
            {
              throw new LDAPException(LDAPResultCode.UNDEFINED_ATTRIBUTE_TYPE,
                      ERR_ADD_ATTR_IS_INVALID_OPTION.get(
                      String.valueOf(entryDN),
                      attr.getName()));
            }
            throw new LDAPException(LDAPResultCode.UNDEFINED_ATTRIBUTE_TYPE,
                ERR_ADD_ATTR_IS_INVALID_OPTION.get(String.valueOf(entryDN), attr.getName()));
          }
          if (attrType.isObjectClassType())
@@ -486,9 +440,7 @@
    }
  }
  /**
   * {@inheritDoc}
   */
  /** {@inheritDoc} */
  @Override
  public final void setAttribute(AttributeType attributeType,
                                 List<Attribute> attributeList)
@@ -505,18 +457,14 @@
    }
  }
  /**
   * {@inheritDoc}
   */
  /** {@inheritDoc} */
  @Override
  public final void removeAttribute(AttributeType attributeType)
  {
    getAttributes(attributeType.isOperational()).remove(attributeType);
  }
  private Map<AttributeType, List<Attribute>> getAttributes(
      boolean isOperational)
  private Map<AttributeType, List<Attribute>> getAttributes(boolean isOperational)
  {
    if (isOperational)
    {
@@ -525,29 +473,7 @@
    return userAttributes;
  }
  /**
   * {@inheritDoc}
   */
  @Override
  public final long getChangeNumber()
  {
    return changeNumber;
  }
  /**
   * {@inheritDoc}
   */
  @Override
  public final void setChangeNumber(long changeNumber)
  {
    this.changeNumber = changeNumber;
  }
  /**
   * {@inheritDoc}
   */
  /** {@inheritDoc} */
  @Override
  public final OperationType getOperationType()
  {
@@ -557,52 +483,35 @@
    return OperationType.ADD;
  }
  /**
   * {@inheritDoc}
   */
  /** {@inheritDoc} */
  @Override
  public DN getProxiedAuthorizationDN()
  {
    return proxiedAuthorizationDN;
  }
  /**
   * {@inheritDoc}
   */
  /** {@inheritDoc} */
  @Override
  public final ArrayList<Control> getResponseControls()
  {
    return responseControls;
  }
  /**
   * {@inheritDoc}
   */
  /** {@inheritDoc} */
  @Override
  public final void addResponseControl(Control control)
  {
    responseControls.add(control);
  }
  /**
   * {@inheritDoc}
   */
  /** {@inheritDoc} */
  @Override
  public final void removeResponseControl(Control control)
  {
    responseControls.remove(control);
  }
  /**
   * {@inheritDoc}
   */
  /** {@inheritDoc} */
  @Override
  public final void toString(StringBuilder buffer)
  {
@@ -615,18 +524,14 @@
    buffer.append(")");
  }
  /**
   * {@inheritDoc}
   */
  /** {@inheritDoc} */
  @Override
  public void setProxiedAuthorizationDN(DN proxiedAuthorizationDN)
  {
    this.proxiedAuthorizationDN = proxiedAuthorizationDN;
  }
  /**
   * {@inheritDoc}
   */
  /** {@inheritDoc} */
  @Override
  public final void run()
  {