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

gbellato
11.08.2007 3772cf260e00f36267f19e995349c6b04893213e
opends/src/server/org/opends/server/replication/protocol/AddMsg.java
@@ -57,8 +57,8 @@
public class AddMsg extends UpdateMessage
{
  private static final long serialVersionUID = -4905520652801395185L;
  private final byte[] encodedAttributes;
  private final String parentUniqueId;
  private byte[] encodedAttributes;
  private String parentUniqueId;
  /**
   * Creates a new AddMessage.
@@ -263,4 +263,32 @@
  {
    return ("ADD " + getDn() + " " + getChangeNumber());
  }
  /**
   * Add the specified attribute/attribute value in the entry contained
   * in this AddMsg.
   *
   * @param name  The name of the attribute to add.
   * @param value The value of the attribute to add.
   * @throws ASN1Exception When this Msg is not valid.
   */
  public void addAttribute(String name, String value)
         throws ASN1Exception
  {
    RawAttribute newAttr = new LDAPAttribute(name, value);
    ArrayList<ASN1Element> elems;
    elems = ASN1Element.decodeElements(encodedAttributes);
    elems.add(newAttr.encode());
    encodedAttributes = ASN1Element.encodeValue(elems);
  }
  /**
   * Set the parent unique id of this add msg.
   *
   * @param uid the parent unique id.
   */
  public void setParentUid(String uid)
  {
    parentUniqueId = uid;
  }
}