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

neil_a_wilson
03.30.2007 6bea4c909a3dbf8a3b5ffd84c96506bb298403ac
opendj-sdk/opends/src/server/org/opends/server/controls/ProxiedAuthV1Control.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Portions Copyright 2006 Sun Microsystems, Inc.
 *      Portions Copyright 2006-2007 Sun Microsystems, Inc.
 */
package org.opends.server.controls;
@@ -50,6 +50,7 @@
import static org.opends.server.messages.ProtocolMessages.*;
import static org.opends.server.util.ServerConstants.*;
import static org.opends.server.util.StaticUtils.*;
import static org.opends.server.util.Validator.*;
@@ -86,7 +87,7 @@
   * provided information.
   *
   * @param  rawAuthorizationDN  The raw, unprocessed authorization DN from the
   *                             control value.
   *                             control value.  It must not be {@code null}.
   */
  public ProxiedAuthV1Control(ASN1OctetString rawAuthorizationDN)
  {
@@ -105,7 +106,8 @@
   * Creates a new instance of the proxied authorization v1 control with the
   * provided information.
   *
   * @param  authorizationDN  The authorization DN from the control value.
   * @param  authorizationDN  The authorization DN from the control value.  It
   *                          must not be {@code null}.
   */
  public ProxiedAuthV1Control(DN authorizationDN)
  {
@@ -156,7 +158,8 @@
   * authorization DN.
   *
   * @param  rawAuthorizationDN  The raw, unprocessed authorization DN to use in
   *                             the control value.
   *                             the control value.  It must not be
   *                             {@code null}.
   *
   * @return  The encoded control value.
   */
@@ -165,6 +168,8 @@
    assert debugEnter(CLASS_NAME, "encodeValue",
                      String.valueOf(rawAuthorizationDN));
    ensureNotNull(rawAuthorizationDN);
    ArrayList<ASN1Element> elements = new ArrayList<ASN1Element>(1);
    elements.add(rawAuthorizationDN);
@@ -178,7 +183,8 @@
   * provided control.
   *
   * @param  control  The generic control containing the information to use to
   *                  create this proxied authorization v1 control.
   *                  create this proxied authorization v1 control.  It must not
   *                  be {@code null}.
   *
   * @return  The proxied authorization v1 control decoded from the provided
   *          control.
@@ -191,6 +197,16 @@
  {
    assert debugEnter(CLASS_NAME, "decodeControl", String.valueOf(control));
    ensureNotNull(control);
    if (! control.isCritical())
    {
      int    msgID   = MSGID_PROXYAUTH1_CONTROL_NOT_CRITICAL;
      String message = getMessage(msgID);
      throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, msgID,
                              message);
    }
    if (! control.hasValue())
    {
      int    msgID   = MSGID_PROXYAUTH1_NO_CONTROL_VALUE;
@@ -293,12 +309,15 @@
   * Specifies the authorization DN for this proxied auth control.
   *
   * @param  authorizationDN  The authorizationDN for this proxied auth control.
   *                          It must not be {@code null}.
   */
  public void setAuthorizationDN(DN authorizationDN)
  {
    assert debugEnter(CLASS_NAME, "setAuthorizationDN",
                      String.valueOf(authorizationDN));
    ensureNotNull(authorizationDN);
    this.authorizationDN = authorizationDN;
    rawAuthorizationDN = new ASN1OctetString(authorizationDN.toString());