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

Ludovic Poitou
22.03.2010 887e246785056b972a725b5ef8457980325216fb
Sync commits from boli
Added unmodifiable and copyOf response factories.
Made LinkedHashMapEntry copy constructor perform a deep copy of attributes.

11 files added
2 files renamed
19 files modified
1416 ■■■■■ changed files
sdk/src/com/sun/opends/sdk/extensions/GetConnectionIDExtendedResult.java 7 ●●●●● patch | view | raw | blame | history
sdk/src/com/sun/opends/sdk/extensions/PasswordPolicyStateExtendedResult.java 4 ●●●● patch | view | raw | blame | history
sdk/src/org/opends/sdk/LinkedHashMapEntry.java 4 ●●●● patch | view | raw | blame | history
sdk/src/org/opends/sdk/responses/AbstractExtendedResultImpl.java 25 ●●●● patch | view | raw | blame | history
sdk/src/org/opends/sdk/responses/AbstractIntermediateResponseImpl.java 24 ●●●● patch | view | raw | blame | history
sdk/src/org/opends/sdk/responses/AbstractResponseImpl.java 20 ●●●●● patch | view | raw | blame | history
sdk/src/org/opends/sdk/responses/AbstractResultImpl.java 23 ●●●●● patch | view | raw | blame | history
sdk/src/org/opends/sdk/responses/AbstractUnmodifiableExtendedResultImpl.java 60 ●●●●● patch | view | raw | blame | history
sdk/src/org/opends/sdk/responses/AbstractUnmodifiableIntermediateResponseImpl.java 61 ●●●●● patch | view | raw | blame | history
sdk/src/org/opends/sdk/responses/AbstractUnmodifiableResponseImpl.java 6 ●●●●● patch | view | raw | blame | history
sdk/src/org/opends/sdk/responses/AbstractUnmodifiableResultImpl.java 7 ●●●● patch | view | raw | blame | history
sdk/src/org/opends/sdk/responses/BindResultImpl.java 20 ●●●●● patch | view | raw | blame | history
sdk/src/org/opends/sdk/responses/CompareResultImpl.java 17 ●●●●● patch | view | raw | blame | history
sdk/src/org/opends/sdk/responses/GenericExtendedResultImpl.java 29 ●●●●● patch | view | raw | blame | history
sdk/src/org/opends/sdk/responses/GenericIntermediateResponseImpl.java 22 ●●●●● patch | view | raw | blame | history
sdk/src/org/opends/sdk/responses/PasswordModifyExtendedResult.java 12 ●●●● patch | view | raw | blame | history
sdk/src/org/opends/sdk/responses/PasswordModifyExtendedResultImpl.java 29 ●●●● patch | view | raw | blame | history
sdk/src/org/opends/sdk/responses/Responses.java 344 ●●●●● patch | view | raw | blame | history
sdk/src/org/opends/sdk/responses/ResultImpl.java 17 ●●●●● patch | view | raw | blame | history
sdk/src/org/opends/sdk/responses/SearchResultEntryImpl.java 22 ●●●●● patch | view | raw | blame | history
sdk/src/org/opends/sdk/responses/SearchResultReferenceImpl.java 20 ●●●●● patch | view | raw | blame | history
sdk/src/org/opends/sdk/responses/UnmodifiableBindResultImpl.java 57 ●●●●● patch | view | raw | blame | history
sdk/src/org/opends/sdk/responses/UnmodifiableCompareResultImpl.java 45 ●●●●● patch | view | raw | blame | history
sdk/src/org/opends/sdk/responses/UnmodifiableGenericExtendedResultImpl.java 54 ●●●●● patch | view | raw | blame | history
sdk/src/org/opends/sdk/responses/UnmodifiableGenericIntermediateResponseImpl.java 55 ●●●●● patch | view | raw | blame | history
sdk/src/org/opends/sdk/responses/UnmodifiablePasswordModifyExtendedResultImpl.java 66 ●●●●● patch | view | raw | blame | history
sdk/src/org/opends/sdk/responses/UnmodifiableResultImpl.java 39 ●●●●● patch | view | raw | blame | history
sdk/src/org/opends/sdk/responses/UnmodifiableSearchResultEntryImpl.java 196 ●●●●● patch | view | raw | blame | history
sdk/src/org/opends/sdk/responses/UnmodifiableSearchResultReferenceImpl.java 53 ●●●●● patch | view | raw | blame | history
sdk/src/org/opends/sdk/responses/UnmodifiableWhoAmIExtendedResultImpl.java 53 ●●●●● patch | view | raw | blame | history
sdk/src/org/opends/sdk/responses/WhoAmIExtendedResult.java 5 ●●●● patch | view | raw | blame | history
sdk/src/org/opends/sdk/responses/WhoAmIExtendedResultImpl.java 20 ●●●●● patch | view | raw | blame | history
sdk/src/com/sun/opends/sdk/extensions/GetConnectionIDExtendedResult.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2009 Sun Microsystems, Inc.
 *      Copyright 2010 Sun Microsystems, Inc.
 */
package com.sun.opends.sdk.extensions;
@@ -36,19 +36,18 @@
import org.opends.sdk.ResultCode;
import org.opends.sdk.asn1.ASN1;
import org.opends.sdk.asn1.ASN1Writer;
import org.opends.sdk.responses.AbstractExtendedResult;
import org.opends.sdk.responses.AbstractExtendedResultImpl;
import com.sun.opends.sdk.util.Validator;
/**
 * Get connection ID extended result.
 *
 * @see GetConnectionIDExtendedRequest
 */
public final class GetConnectionIDExtendedResult extends
    AbstractExtendedResult<GetConnectionIDExtendedResult>
    AbstractExtendedResultImpl<GetConnectionIDExtendedResult>
{
  /**
   * Creates a new get connection ID extended result.
sdk/src/com/sun/opends/sdk/extensions/PasswordPolicyStateExtendedResult.java
@@ -35,7 +35,7 @@
import org.opends.sdk.ByteString;
import org.opends.sdk.DN;
import org.opends.sdk.ResultCode;
import org.opends.sdk.responses.AbstractExtendedResult;
import org.opends.sdk.responses.AbstractExtendedResultImpl;
@@ -43,7 +43,7 @@
 * The password policy state extended result.
 */
public final class PasswordPolicyStateExtendedResult extends
    AbstractExtendedResult<PasswordPolicyStateExtendedResult> implements
    AbstractExtendedResultImpl<PasswordPolicyStateExtendedResult> implements
    PasswordPolicyStateOperationContainer
{
  private final String targetUser;
sdk/src/org/opends/sdk/LinkedHashMapEntry.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2009 Sun Microsystems, Inc.
 *      Copyright 2010 Sun Microsystems, Inc.
 */
package org.opends.sdk;
@@ -109,7 +109,7 @@
    this(entry.getName());
    for (final Attribute attribute : entry.getAllAttributes())
    {
      addAttribute(attribute);
      addAttribute(new LinkedAttribute(attribute));
    }
  }
sdk/src/org/opends/sdk/responses/AbstractExtendedResultImpl.java
File was renamed from sdk/src/org/opends/sdk/responses/AbstractExtendedResult.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2009 Sun Microsystems, Inc.
 *      Copyright 2010 Sun Microsystems, Inc.
 */
package org.opends.sdk.responses;
@@ -43,8 +43,8 @@
 * @param <S>
 *          The type of Extended result.
 */
public abstract class AbstractExtendedResult<S extends ExtendedResult> extends
    AbstractResultImpl<S> implements ExtendedResult
public abstract class AbstractExtendedResultImpl<S extends ExtendedResult>
    extends AbstractResultImpl<S> implements ExtendedResult
{
  /**
@@ -55,7 +55,7 @@
   * @throws NullPointerException
   *           If {@code resultCode} was {@code null}.
   */
  protected AbstractExtendedResult(final ResultCode resultCode)
  protected AbstractExtendedResultImpl(final ResultCode resultCode)
      throws NullPointerException
  {
    super(resultCode);
@@ -64,6 +64,23 @@
  /**
   * Creates a new extended result that is an exact copy of the provided
   * result.
   *
   * @param extendedResult
   *          The extended result to be copied.
   * @throws NullPointerException
   *           If {@code extendedResult} was {@code null} .
   */
  protected AbstractExtendedResultImpl(ExtendedResult extendedResult)
      throws NullPointerException
  {
    super(extendedResult);
  }
  /**
   * {@inheritDoc}
   */
  public abstract String getOID();
sdk/src/org/opends/sdk/responses/AbstractIntermediateResponseImpl.java
File was renamed from sdk/src/org/opends/sdk/responses/AbstractIntermediateResponse.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2009 Sun Microsystems, Inc.
 *      Copyright 2010 Sun Microsystems, Inc.
 */
package org.opends.sdk.responses;
@@ -42,14 +42,14 @@
 * @param <S>
 *          The type of Intermediate response.
 */
public abstract class AbstractIntermediateResponse<S extends IntermediateResponse>
public abstract class AbstractIntermediateResponseImpl<S extends IntermediateResponse>
    extends AbstractResponseImpl<S> implements IntermediateResponse
{
  /**
   * Creates a new intermediate response.
   */
  protected AbstractIntermediateResponse()
  protected AbstractIntermediateResponseImpl()
  {
    // Nothing to do.
  }
@@ -57,6 +57,24 @@
  /**
   * Creates a new intermediate response that is an exact copy of the provided
   * response.
   *
   * @param intermediateResponse
   *          The intermediate response to be copied.
   * @throws NullPointerException
   *           If {@code intermediateResponse} was {@code null} .
   */
  protected AbstractIntermediateResponseImpl(
      IntermediateResponse intermediateResponse)
      throws NullPointerException
  {
    super(intermediateResponse);
  }
  /**
   * {@inheritDoc}
   */
  public abstract String getOID();
sdk/src/org/opends/sdk/responses/AbstractResponseImpl.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2009 Sun Microsystems, Inc.
 *      Copyright 2010 Sun Microsystems, Inc.
 */
package org.opends.sdk.responses;
@@ -40,7 +40,6 @@
import com.sun.opends.sdk.util.Validator;
/**
 * Modifiable response implementation.
 *
@@ -64,6 +63,23 @@
  /**
   * Creates a new abstract response that is an exact copy of the provided
   * response.
   *
   * @param response
   *          The response to be copied.
   * @throws NullPointerException
   *           If {@code response} was {@code null} .
   */
  AbstractResponseImpl(Response response) throws NullPointerException
  {
    Validator.ensureNotNull(response);
    controls.addAll(response.getControls());
  }
  /**
   * {@inheritDoc}
   */
  public final S addControl(final Control control) throws NullPointerException
sdk/src/org/opends/sdk/responses/AbstractResultImpl.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2009 Sun Microsystems, Inc.
 *      Copyright 2010 Sun Microsystems, Inc.
 */
package org.opends.sdk.responses;
@@ -77,6 +77,27 @@
  /**
   * Creates a new modifiable result that is an exact copy of the provided
   * result.
   *
   * @param result
   *          The result to be copied.
   * @throws NullPointerException
   *           If {@code result} was {@code null}.
   */
  AbstractResultImpl(Result result) throws NullPointerException
  {
    super(result);
    this.cause = result.getCause();
    this.diagnosticMessage = result.getDiagnosticMessage();
    this.matchedDN = result.getMatchedDN();
    this.referralURIs.addAll(result.getReferralURIs());
    this.resultCode = result.getResultCode();
  }
  /**
   * {@inheritDoc}
   */
  public final S addReferralURI(final String uri) throws NullPointerException
sdk/src/org/opends/sdk/responses/AbstractUnmodifiableExtendedResultImpl.java
New file
@@ -0,0 +1,60 @@
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License, Version 1.0 only
 * (the "License").  You may not use this file except in compliance
 * with the License.
 *
 * You can obtain a copy of the license at
 * trunk/opends/resource/legal-notices/OpenDS.LICENSE
 * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at
 * trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
 * add the following below this CDDL HEADER, with the fields enclosed
 * by brackets "[]" replaced with your own identifying information:
 *      Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 *
 *
 *      Copyright 2010 Sun Microsystems, Inc.
 */
package org.opends.sdk.responses;
import org.opends.sdk.ByteString;
/**
 * An abstract unmodifiable Extended result which can be used as the basis for
 * implementing new unmodifiable Extended operations.
 *
 * @param <S>
 *          The type of Extended result.
 */
abstract class AbstractUnmodifiableExtendedResultImpl<S extends ExtendedResult>
    extends AbstractUnmodifiableResultImpl<S> implements ExtendedResult
{
  protected AbstractUnmodifiableExtendedResultImpl(S impl) {
    super(impl);
  }
  @Override
  public String getOID() {
    return impl.getOID();
  }
  @Override
  public ByteString getValue() {
    return impl.getValue();
  }
  @Override
  public boolean hasValue() {
    return impl.hasValue();
  }
}
sdk/src/org/opends/sdk/responses/AbstractUnmodifiableIntermediateResponseImpl.java
New file
@@ -0,0 +1,61 @@
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License, Version 1.0 only
 * (the "License").  You may not use this file except in compliance
 * with the License.
 *
 * You can obtain a copy of the license at
 * trunk/opends/resource/legal-notices/OpenDS.LICENSE
 * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at
 * trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
 * add the following below this CDDL HEADER, with the fields enclosed
 * by brackets "[]" replaced with your own identifying information:
 *      Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 *
 *
 *      Copyright 2010 Sun Microsystems, Inc.
 */
package org.opends.sdk.responses;
import org.opends.sdk.ByteString;
/**
 * An abstract unmodifiable Intermediate response which can be used as the basis
 * for implementing new unmodifiable Intermediate responses.
 *
 * @param <S>
 *          The type of Intermediate response.
 */
abstract class AbstractUnmodifiableIntermediateResponseImpl
    <S extends IntermediateResponse> extends AbstractUnmodifiableResponseImpl<S>
    implements IntermediateResponse
{
  protected AbstractUnmodifiableIntermediateResponseImpl(S impl) {
    super(impl);
  }
  @Override
  public String getOID() {
    return impl.getOID();
  }
  @Override
  public ByteString getValue() {
    return impl.getValue();
  }
  @Override
  public boolean hasValue() {
    return impl.hasValue();
  }
}
sdk/src/org/opends/sdk/responses/AbstractUnmodifiableResponseImpl.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2009 Sun Microsystems, Inc.
 *      Copyright 2010 Sun Microsystems, Inc.
 */
package org.opends.sdk.responses;
@@ -32,6 +32,7 @@
import java.util.Collections;
import java.util.List;
import com.sun.opends.sdk.util.Validator;
import org.opends.sdk.DecodeException;
import org.opends.sdk.DecodeOptions;
import org.opends.sdk.controls.Control;
@@ -49,7 +50,7 @@
    Response
{
  private final S impl;
  protected final S impl;
@@ -61,6 +62,7 @@
   */
  AbstractUnmodifiableResponseImpl(final S impl)
  {
    Validator.ensureNotNull(impl);
    this.impl = impl;
  }
sdk/src/org/opends/sdk/responses/AbstractUnmodifiableResultImpl.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2009 Sun Microsystems, Inc.
 *      Copyright 2010 Sun Microsystems, Inc.
 */
package org.opends.sdk.responses;
@@ -46,10 +46,6 @@
    AbstractUnmodifiableResponseImpl<S> implements Result
{
  private final S impl;
  /**
   * Creates a new unmodifiable result implementation.
   *
@@ -59,7 +55,6 @@
  AbstractUnmodifiableResultImpl(final S impl)
  {
    super(impl);
    this.impl = impl;
  }
sdk/src/org/opends/sdk/responses/BindResultImpl.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2009 Sun Microsystems, Inc.
 *      Copyright 2010 Sun Microsystems, Inc.
 */
package org.opends.sdk.responses;
@@ -60,6 +60,24 @@
  /**
   * Creates a new bind result that is an exact copy of the provided
   * result.
   *
   * @param bindResult
   *          The bind result to be copied.
   * @throws NullPointerException
   *           If {@code bindResult} was {@code null} .
   */
  BindResultImpl(final BindResult bindResult)
      throws NullPointerException
  {
    super(bindResult);
    this.credentials = bindResult.getServerSASLCredentials();
  }
  /**
   * {@inheritDoc}
   */
  public ByteString getServerSASLCredentials()
sdk/src/org/opends/sdk/responses/CompareResultImpl.java
@@ -56,6 +56,23 @@
  /**
   * Creates a new compare result that is an exact copy of the provided
   * result.
   *
   * @param compareResult
   *          The compare result to be copied.
   * @throws NullPointerException
   *           If {@code compareResult} was {@code null} .
   */
  CompareResultImpl(final CompareResult compareResult)
      throws NullPointerException
  {
    super(compareResult);
  }
  /**
   * {@inheritDoc}
   */
  public boolean matched()
sdk/src/org/opends/sdk/responses/GenericExtendedResultImpl.java
@@ -40,7 +40,7 @@
 * Generic extended result implementation.
 */
final class GenericExtendedResultImpl extends
    AbstractResultImpl<GenericExtendedResult> implements ExtendedResult,
    AbstractExtendedResultImpl<GenericExtendedResult> implements ExtendedResult,
    GenericExtendedResult
{
@@ -67,6 +67,25 @@
  /**
   * Creates a new generic extended result that is an exact copy of the provided
   * result.
   *
   * @param genericExtendedResult
   *          The generic extended result to be copied.
   * @throws NullPointerException
   *           If {@code genericExtendedResult} was {@code null} .
   */
  GenericExtendedResultImpl(final GenericExtendedResult genericExtendedResult)
      throws NullPointerException
  {
    super(genericExtendedResult);
    this.responseName = genericExtendedResult.getOID();
    this.responseValue = genericExtendedResult.getValue();
  }
  /**
   * {@inheritDoc}
   */
  public String getOID()
@@ -147,12 +166,4 @@
    builder.append(")");
    return builder.toString();
  }
  @Override
  GenericExtendedResult getThis()
  {
    return this;
  }
}
sdk/src/org/opends/sdk/responses/GenericIntermediateResponseImpl.java
@@ -39,7 +39,7 @@
 * Generic intermediate response implementation.
 */
final class GenericIntermediateResponseImpl extends
    AbstractIntermediateResponse<GenericIntermediateResponse> implements
    AbstractIntermediateResponseImpl<GenericIntermediateResponse> implements
    GenericIntermediateResponse
{
@@ -72,6 +72,26 @@
  /**
   * Creates a new generic intermediate response that is an exact copy of the
   * provided result.
   *
   * @param genericIntermediateResponse
   *          The generic intermediate response to be copied.
   * @throws NullPointerException
   *           If {@code genericExtendedResult} was {@code null} .
   */
  GenericIntermediateResponseImpl(
      final GenericIntermediateResponse genericIntermediateResponse)
      throws NullPointerException
  {
    super(genericIntermediateResponse);
    this.responseName = genericIntermediateResponse.getOID();
    this.responseValue = genericIntermediateResponse.getValue();
  }
  /**
   * {@inheritDoc}
   */
  @Override
sdk/src/org/opends/sdk/responses/PasswordModifyExtendedResult.java
@@ -200,8 +200,12 @@
   *          The generated password, or {@code null} if there is no generated
   *          password associated with this result.
   * @return This password modify result.
   * @throws UnsupportedOperationException
   *           If this password modify extended result does not permit the
   *           generated password to be set.
   */
  PasswordModifyExtendedResult setGeneratedPassword(ByteString password);
  PasswordModifyExtendedResult setGeneratedPassword(ByteString password)
      throws UnsupportedOperationException;
@@ -213,8 +217,12 @@
   *          The generated password, or {@code null} if there is no generated
   *          password associated with this result.
   * @return This password modify result.
   * @throws UnsupportedOperationException
   *           If this password modify extended result does not permit the
   *           generated password to be set.
   */
  PasswordModifyExtendedResult setGeneratedPassword(String password);
  PasswordModifyExtendedResult setGeneratedPassword(String password)
      throws UnsupportedOperationException;
sdk/src/org/opends/sdk/responses/PasswordModifyExtendedResultImpl.java
@@ -43,7 +43,7 @@
 * Password modify extended result implementation.
 */
final class PasswordModifyExtendedResultImpl extends
    AbstractExtendedResult<PasswordModifyExtendedResult> implements
    AbstractExtendedResultImpl<PasswordModifyExtendedResult> implements
    PasswordModifyExtendedResult
{
  private ByteString password;
@@ -52,7 +52,8 @@
   * The ASN.1 element type that will be used to encode the genPasswd component
   * in a password modify extended response.
   */
  private static final byte TYPE_PASSWORD_MODIFY_GENERATED_PASSWORD = (byte) 0x80;
  private static final byte TYPE_PASSWORD_MODIFY_GENERATED_PASSWORD =
      (byte) 0x80;
@@ -65,6 +66,25 @@
  /**
   * Creates a new password modify extended result that is an exact copy of the
   * provided result.
   *
   * @param passwordModifyExtendedResult
   *          The password modify extended result to be copied.
   * @throws NullPointerException
   *           If {@code passwordModifyExtendedResult} was {@code null} .
   */
  PasswordModifyExtendedResultImpl(
      final PasswordModifyExtendedResult passwordModifyExtendedResult)
      throws NullPointerException
  {
    super(passwordModifyExtendedResult);
    this.password = passwordModifyExtendedResult.getGeneratedPassword();
  }
  /**
   * {@inheritDoc}
   */
  public ByteString getGeneratedPassword()
@@ -142,7 +162,7 @@
   * {@inheritDoc}
   */
  public PasswordModifyExtendedResult setGeneratedPassword(
      final ByteString password)
      final ByteString password) throws UnsupportedOperationException
  {
    this.password = password;
    return this;
@@ -153,7 +173,8 @@
  /**
   * {@inheritDoc}
   */
  public PasswordModifyExtendedResult setGeneratedPassword(final String password)
  public PasswordModifyExtendedResult setGeneratedPassword(
      final String password) throws UnsupportedOperationException
  {
    this.password = (password != null) ? ByteString.valueOf(password) : null;
    return this;
sdk/src/org/opends/sdk/responses/Responses.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2009 Sun Microsystems, Inc.
 *      Copyright 2010 Sun Microsystems, Inc.
 */
package org.opends.sdk.responses;
@@ -42,8 +42,6 @@
 * <p>
 * TODO: referral from LDAP URL.
 * <p>
 * TODO: unmodifiable requests?
 * <p>
 * TODO: synchronized requests?
 * <p>
 * TODO: copy constructors.
@@ -290,7 +288,7 @@
   * @throws NullPointerException
   *           If {@code resultCode} was {@code null} .
   */
  public static final WhoAmIExtendedResult newWhoAmIExtendedResult(
  public static WhoAmIExtendedResult newWhoAmIExtendedResult(
      final ResultCode resultCode) throws NullPointerException
  {
    Validator.ensureNotNull(resultCode);
@@ -299,6 +297,344 @@
  /**
   * Creates an unmodifiable bind result using the provided response.
   *
   * @param bindResult
   *          The bind result to be copied.
   * @return The unmodifiable bind result.
   * @throws NullPointerException
   *           If {@code bindResult} was {@code null}.
   */
  public static BindResult unmodifiableBindResult(final BindResult bindResult)
      throws NullPointerException
  {
    return new UnmodifiableBindResultImpl(bindResult);
  }
  /**
   * Creates an unmodifiable compare result using the provided response.
   *
   * @param compareResult
   *          The compare result to be copied.
   * @return The unmodifiable compare result.
   * @throws NullPointerException
   *           If {@code compareResult} was {@code null}.
   */
  public static CompareResult unmodifiableCompareResult(
      final CompareResult compareResult)
      throws NullPointerException
  {
    return new UnmodifiableCompareResultImpl(compareResult);
  }
  /**
   * Creates an unmodifiable generic extended result using the provided
   * response.
   *
   * @param genericExtendedResult
   *          The generic extended result to be copied.
   * @return The unmodifiable generic extended result.
   * @throws NullPointerException
   *           If {@code genericExtendedResult} was {@code null}.
   */
  public static GenericExtendedResult unmodifiableGenericExtendedResult(
      final GenericExtendedResult genericExtendedResult)
      throws NullPointerException
  {
    return new UnmodifiableGenericExtendedResultImpl(genericExtendedResult);
  }
  /**
   * Creates an unmodifiable generic intermediate response using the provided
   * response.
   *
   * @param genericIntermediateResponse
   *          The generic intermediate response to be copied.
   * @return The unmodifiable generic intermediate response.
   * @throws NullPointerException
   *           If {@code genericIntermediateResponse} was {@code null}.
   */
  public static GenericIntermediateResponse
  unmodifiableGenericIntermediateResponse(
      final GenericIntermediateResponse genericIntermediateResponse)
      throws NullPointerException
  {
    return new UnmodifiableGenericIntermediateResponseImpl(
        genericIntermediateResponse);
  }
  /**
   * Creates an unmodifiable password modify extended result using the provided
   * response.
   *
   * @param passwordModifyExtendedResult
   *          The password modify extended result to be copied.
   * @return The unmodifiable password modify extended result.
   * @throws NullPointerException
   *           If {@code passwordModifyExtendedResult} was {@code null}.
   */
  public static PasswordModifyExtendedResult
  unmodifiablePasswordModifyExtendedResult(
      final PasswordModifyExtendedResult passwordModifyExtendedResult)
      throws NullPointerException
  {
    return new UnmodifiablePasswordModifyExtendedResultImpl(
        passwordModifyExtendedResult);
  }
  /**
   * Creates an unmodifiable result using the provided response.
   *
   * @param result
   *          The result to be copied.
   * @return The unmodifiable result.
   * @throws NullPointerException
   *           If {@code result} was {@code null}.
   */
  public static Result unmodifiableResult(final Result result)
      throws NullPointerException
  {
    return new UnmodifiableResultImpl(result);
  }
  /**
   * Creates an unmodifiable search result entry using the provided response.
   *
   * @param searchResultEntry
   *          The search result entry to be copied.
   * @return The unmodifiable search result entry.
   * @throws NullPointerException
   *           If {@code searchResultEntry} was {@code null}.
   */
  public static SearchResultEntry unmodifiableSearchResultEntry(
      final SearchResultEntry searchResultEntry)
      throws NullPointerException
  {
    return new UnmodifiableSearchResultEntryImpl(searchResultEntry);
  }
  /**
   * Creates an unmodifiable search result reference using the provided
   * response.
   *
   * @param searchResultReference
   *          The search result reference to be copied.
   * @return The unmodifiable search result reference.
   * @throws NullPointerException
   *           If {@code searchResultReference} was {@code null}.
   */
  public static SearchResultReference unmodifiableSearchResultReference(
      final SearchResultReference searchResultReference)
      throws NullPointerException
  {
    return new UnmodifiableSearchResultReferenceImpl(searchResultReference);
  }
  /**
   * Creates an unmodifiable who am I extended result using the provided
   * response.
   *
   * @param whoAmIExtendedResult
   *          The who am I result to be copied.
   * @return The unmodifiable who am I extended result.
   * @throws NullPointerException
   *           If {@code whoAmIExtendedResult} was {@code null} .
   */
  public static WhoAmIExtendedResult unmodifiableWhoAmIExtendedResult(
      final WhoAmIExtendedResult whoAmIExtendedResult)
      throws NullPointerException
  {
    return new UnmodifiableWhoAmIExtendedResultImpl(whoAmIExtendedResult);
  }
  /**
   * Creates a new bind result that is an exact copy of the provided
   * result.
   *
   * @param bindResult
   *          The bind result to be copied.
   * @return The new bind result.
   * @throws NullPointerException
   *           If {@code bindResult} was {@code null}.
   */
  public static BindResult copyOfBindResult(final BindResult bindResult)
      throws NullPointerException
  {
    return new BindResultImpl(bindResult);
  }
  /**
   * Creates a new compare result that is an exact copy of the provided
   * result.
   *
   * @param compareResult
   *          The compare result to be copied.
   * @return The new compare result.
   * @throws NullPointerException
   *           If {@code compareResult} was {@code null}.
   */
  public static CompareResult copyOfCompareResult(
      final CompareResult compareResult)
      throws NullPointerException
  {
    return new CompareResultImpl(compareResult);
  }
  /**
   * Creates a new generic extended result that is an exact copy of the provided
   * result.
   *
   * @param genericExtendedResult
   *          The generic extended result to be copied.
   * @return The new generic extended result.
   * @throws NullPointerException
   *           If {@code genericExtendedResult} was {@code null}.
   */
  public static GenericExtendedResult copyOfGenericExtendedResult(
      final GenericExtendedResult genericExtendedResult)
      throws NullPointerException
  {
    return new GenericExtendedResultImpl(genericExtendedResult);
  }
  /**
   * Creates a new generic intermediate response that is an exact copy of the
   * provided response.
   *
   * @param genericIntermediateResponse
   *          The generic intermediate response to be copied.
   * @return The new generic intermediate response.
   * @throws NullPointerException
   *           If {@code genericIntermediateResponse} was {@code null}.
   */
  public static GenericIntermediateResponse copyOfGenericIntermediateResponse(
      final GenericIntermediateResponse genericIntermediateResponse)
      throws NullPointerException
  {
    return new GenericIntermediateResponseImpl(
        genericIntermediateResponse);
  }
  /**
   * Creates a new password modify extended result that is an exact copy of the
   * provided result.
   *
   * @param passwordModifyExtendedResult
   *          The password modify extended result to be copied.
   * @return The new password modify extended result.
   * @throws NullPointerException
   *           If {@code passwordModifyExtendedResult} was {@code null}.
   */
  public static PasswordModifyExtendedResult copyOfPasswordModifyExtendedResult(
      final PasswordModifyExtendedResult passwordModifyExtendedResult)
      throws NullPointerException
  {
    return new PasswordModifyExtendedResultImpl(
        passwordModifyExtendedResult);
  }
  /**
   * Creates a new result that is an exact copy of the provided result.
   *
   * @param result
   *          The result to be copied.
   * @return The new result.
   * @throws NullPointerException
   *           If {@code result} was {@code null}.
   */
  public static Result copyOfResult(final Result result)
      throws NullPointerException
  {
    return new ResultImpl(result);
  }
  /**
   * Creates a new search result entry that is an exact copy of the provided
   * result.
   *
   * @param searchResultEntry
   *          The search result entry to be copied.
   * @return The new search result entry.
   * @throws NullPointerException
   *           If {@code searchResultEntry} was {@code null}.
   */
  public static SearchResultEntry copyOfSearchResultEntry(
      final SearchResultEntry searchResultEntry)
      throws NullPointerException
  {
    return new SearchResultEntryImpl(searchResultEntry);
  }
  /**
   * Creates a new search result reference that is an exact copy of the provided
   * result.
   *
   * @param searchResultReference
   *          The search result reference to be copied.
   * @return The new search result reference.
   * @throws NullPointerException
   *           If {@code searchResultReference} was {@code null}.
   */
  public static SearchResultReference copyOfSearchResultReference(
      final SearchResultReference searchResultReference)
      throws NullPointerException
  {
    return new SearchResultReferenceImpl(searchResultReference);
  }
  /**
   * Creates a new who am I extended result that is an exact copy of the
   * provided result.
   *
   * @param whoAmIExtendedResult
   *          The who am I result to be copied.
   * @return The new who am I extended result.
   * @throws NullPointerException
   *           If {@code whoAmIExtendedResult} was {@code null} .
   */
  public static WhoAmIExtendedResult copyOfWhoAmIExtendedResult(
      final WhoAmIExtendedResult whoAmIExtendedResult)
      throws NullPointerException
  {
    return new WhoAmIExtendedResultImpl(whoAmIExtendedResult);
  }
  // Private constructor.
  private Responses()
  {
sdk/src/org/opends/sdk/responses/ResultImpl.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2009 Sun Microsystems, Inc.
 *      Copyright 2010 Sun Microsystems, Inc.
 */
package org.opends.sdk.responses;
@@ -55,6 +55,21 @@
  /**
   * Creates a new result that is an exact copy of the provided result.
   *
   * @param result
   *          The result to be copied.
   * @throws NullPointerException
   *           If {@code result} was {@code null} .
   */
  ResultImpl(final Result result) throws NullPointerException
  {
    super(result);
  }
  /**
   * {@inheritDoc}
   */
  @Override
sdk/src/org/opends/sdk/responses/SearchResultEntryImpl.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2009-2010 Sun Microsystems, Inc.
 *      Copyright 2010 Sun Microsystems, Inc.
 */
package org.opends.sdk.responses;
@@ -58,7 +58,7 @@
   * @throws NullPointerException
   *           If {@code entry} was {@code null} .
   */
  public SearchResultEntryImpl(final Entry entry) throws NullPointerException
  SearchResultEntryImpl(final Entry entry) throws NullPointerException
  {
    this.entry = entry;
  }
@@ -66,6 +66,24 @@
  /**
   * Creates a new search result entry that is an exact copy of the provided
   * result.
   *
   * @param searchResultEntry
   *          The search result entry to be copied.
   * @throws NullPointerException
   *           If {@code searchResultEntry} was {@code null} .
   */
  SearchResultEntryImpl(final SearchResultEntry searchResultEntry)
      throws NullPointerException
  {
    super(searchResultEntry);
    this.entry = new LinkedHashMapEntry(searchResultEntry);
  }
  /**
   * {@inheritDoc}
   */
  public boolean addAttribute(final Attribute attribute)
sdk/src/org/opends/sdk/responses/SearchResultReferenceImpl.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2009 Sun Microsystems, Inc.
 *      Copyright 2010 Sun Microsystems, Inc.
 */
package org.opends.sdk.responses;
@@ -66,6 +66,24 @@
  /**
   * Creates a new search result reference that is an exact copy of the provided
   * result.
   *
   * @param searchResultReference
   *          The search result reference to be copied.
   * @throws NullPointerException
   *           If {@code searchResultReference} was {@code null} .
   */
  SearchResultReferenceImpl(final SearchResultReference searchResultReference)
      throws NullPointerException
  {
    super(searchResultReference);
    this.uris.addAll(searchResultReference.getURIs());
  }
  /**
   * {@inheritDoc}
   */
  public SearchResultReference addURI(final String uri)
sdk/src/org/opends/sdk/responses/UnmodifiableBindResultImpl.java
New file
@@ -0,0 +1,57 @@
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License, Version 1.0 only
 * (the "License").  You may not use this file except in compliance
 * with the License.
 *
 * You can obtain a copy of the license at
 * trunk/opends/resource/legal-notices/OpenDS.LICENSE
 * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at
 * trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
 * add the following below this CDDL HEADER, with the fields enclosed
 * by brackets "[]" replaced with your own identifying information:
 *      Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 *
 *
 *      Copyright 2010 Sun Microsystems, Inc.
 */
package org.opends.sdk.responses;
import org.opends.sdk.ByteString;
/**
 * Unmodifiable Bind result implementation.
 */
class UnmodifiableBindResultImpl
    extends AbstractUnmodifiableResultImpl<BindResult> implements BindResult
{
  public UnmodifiableBindResultImpl(BindResult impl) {
    super(impl);
  }
  @Override
  public ByteString getServerSASLCredentials() {
    return impl.getServerSASLCredentials();
  }
  @Override
  public boolean isSASLBindInProgress() {
    return impl.isSASLBindInProgress();
  }
  @Override
  public BindResult setServerSASLCredentials(ByteString credentials)
      throws UnsupportedOperationException {
    throw new UnsupportedOperationException();
  }
}
sdk/src/org/opends/sdk/responses/UnmodifiableCompareResultImpl.java
New file
@@ -0,0 +1,45 @@
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License, Version 1.0 only
 * (the "License").  You may not use this file except in compliance
 * with the License.
 *
 * You can obtain a copy of the license at
 * trunk/opends/resource/legal-notices/OpenDS.LICENSE
 * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at
 * trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
 * add the following below this CDDL HEADER, with the fields enclosed
 * by brackets "[]" replaced with your own identifying information:
 *      Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 *
 *
 *      Copyright 2010 Sun Microsystems, Inc.
 */
package org.opends.sdk.responses;
/**
 * Unmodifiable Compare result implementation.
 */
class UnmodifiableCompareResultImpl
    extends AbstractUnmodifiableResultImpl<CompareResult>
    implements CompareResult
{
  UnmodifiableCompareResultImpl(CompareResult impl) {
    super(impl);
  }
  @Override
  public boolean matched() {
    return impl.matched();
  }
}
sdk/src/org/opends/sdk/responses/UnmodifiableGenericExtendedResultImpl.java
New file
@@ -0,0 +1,54 @@
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License, Version 1.0 only
 * (the "License").  You may not use this file except in compliance
 * with the License.
 *
 * You can obtain a copy of the license at
 * trunk/opends/resource/legal-notices/OpenDS.LICENSE
 * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at
 * trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
 * add the following below this CDDL HEADER, with the fields enclosed
 * by brackets "[]" replaced with your own identifying information:
 *      Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 *
 *
 *      Copyright 2010 Sun Microsystems, Inc.
 */
package org.opends.sdk.responses;
import org.opends.sdk.ByteString;
/**
 * Unmodifiable Generic extended result implementation.
 */
class UnmodifiableGenericExtendedResultImpl extends
    AbstractUnmodifiableExtendedResultImpl<GenericExtendedResult>
    implements ExtendedResult, GenericExtendedResult
{
  UnmodifiableGenericExtendedResultImpl(GenericExtendedResult impl) {
    super(impl);
  }
  @Override
  public GenericExtendedResult setOID(String oid)
      throws UnsupportedOperationException {
    throw new UnsupportedOperationException();
  }
  @Override
  public GenericExtendedResult setValue(ByteString bytes)
      throws UnsupportedOperationException {
    throw new UnsupportedOperationException();
  }
}
sdk/src/org/opends/sdk/responses/UnmodifiableGenericIntermediateResponseImpl.java
New file
@@ -0,0 +1,55 @@
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License, Version 1.0 only
 * (the "License").  You may not use this file except in compliance
 * with the License.
 *
 * You can obtain a copy of the license at
 * trunk/opends/resource/legal-notices/OpenDS.LICENSE
 * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at
 * trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
 * add the following below this CDDL HEADER, with the fields enclosed
 * by brackets "[]" replaced with your own identifying information:
 *      Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 *
 *
 *      Copyright 2010 Sun Microsystems, Inc.
 */
package org.opends.sdk.responses;
import org.opends.sdk.ByteString;
/**
 * Unmodifiable Generic extended result implementation.
 */
class UnmodifiableGenericIntermediateResponseImpl extends
    AbstractUnmodifiableIntermediateResponseImpl<GenericIntermediateResponse>
    implements GenericIntermediateResponse
{
  UnmodifiableGenericIntermediateResponseImpl(
      GenericIntermediateResponse impl) {
    super(impl);
  }
  @Override
  public GenericIntermediateResponse setOID(String oid)
      throws UnsupportedOperationException {
    throw new UnsupportedOperationException();
  }
  @Override
  public GenericIntermediateResponse setValue(ByteString bytes)
      throws UnsupportedOperationException {
    throw new UnsupportedOperationException();
  }
}
sdk/src/org/opends/sdk/responses/UnmodifiablePasswordModifyExtendedResultImpl.java
New file
@@ -0,0 +1,66 @@
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License, Version 1.0 only
 * (the "License").  You may not use this file except in compliance
 * with the License.
 *
 * You can obtain a copy of the license at
 * trunk/opends/resource/legal-notices/OpenDS.LICENSE
 * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at
 * trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
 * add the following below this CDDL HEADER, with the fields enclosed
 * by brackets "[]" replaced with your own identifying information:
 *      Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 *
 *
 *      Copyright 2010 Sun Microsystems, Inc.
 */
package org.opends.sdk.responses;
import org.opends.sdk.ByteString;
/**
 * Unmodifiable Password modify extended result implementation.
 */
class UnmodifiablePasswordModifyExtendedResultImpl extends
    AbstractUnmodifiableExtendedResultImpl<PasswordModifyExtendedResult>
    implements PasswordModifyExtendedResult
{
  UnmodifiablePasswordModifyExtendedResultImpl(
      PasswordModifyExtendedResult impl) {
    super(impl);
  }
  @Override
  public ByteString getGeneratedPassword() {
    return impl.getGeneratedPassword();
  }
  @Override
  public String getGeneratedPasswordAsString() {
    return impl.getGeneratedPasswordAsString();
  }
  @Override
  public PasswordModifyExtendedResult setGeneratedPassword(ByteString password)
      throws UnsupportedOperationException
  {
    throw new UnsupportedOperationException();
  }
  @Override
  public PasswordModifyExtendedResult setGeneratedPassword(String password)
      throws UnsupportedOperationException {
    throw new UnsupportedOperationException();
  }
}
sdk/src/org/opends/sdk/responses/UnmodifiableResultImpl.java
New file
@@ -0,0 +1,39 @@
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License, Version 1.0 only
 * (the "License").  You may not use this file except in compliance
 * with the License.
 *
 * You can obtain a copy of the license at
 * trunk/opends/resource/legal-notices/OpenDS.LICENSE
 * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at
 * trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
 * add the following below this CDDL HEADER, with the fields enclosed
 * by brackets "[]" replaced with your own identifying information:
 *      Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 *
 *
 *      Copyright 2010 Sun Microsystems, Inc.
 */
package org.opends.sdk.responses;
/**
 * A unmodifiable generic result indicates the final status of an operation.
 */
class UnmodifiableResultImpl
    extends AbstractUnmodifiableResultImpl<Result> implements Result
{
  UnmodifiableResultImpl(Result impl) {
    super(impl);
  }
}
sdk/src/org/opends/sdk/responses/UnmodifiableSearchResultEntryImpl.java
New file
@@ -0,0 +1,196 @@
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License, Version 1.0 only
 * (the "License").  You may not use this file except in compliance
 * with the License.
 *
 * You can obtain a copy of the license at
 * trunk/opends/resource/legal-notices/OpenDS.LICENSE
 * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at
 * trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
 * add the following below this CDDL HEADER, with the fields enclosed
 * by brackets "[]" replaced with your own identifying information:
 *      Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 *
 *
 *      Copyright 2010 Sun Microsystems, Inc.
 */
package org.opends.sdk.responses;
import com.sun.opends.sdk.util.Function;
import com.sun.opends.sdk.util.Iterables;
import org.opends.sdk.*;
import java.util.Collection;
/**
 * Unmodifiable Search result entry implementation.
 */
class UnmodifiableSearchResultEntryImpl  extends
    AbstractUnmodifiableResponseImpl<SearchResultEntry>
    implements SearchResultEntry
{
  private static final Function<Attribute, Attribute, Void>
      UNMODIFIABLE_ATTRIBUTE_FUNCTION =
      new Function<Attribute, Attribute, Void>()
      {
        public Attribute apply(final Attribute value, final Void p)
        {
          return Attributes.unmodifiableAttribute(value);
        }
      };
  UnmodifiableSearchResultEntryImpl(SearchResultEntry impl) {
    super(impl);
  }
  public boolean addAttribute(Attribute attribute)
      throws UnsupportedOperationException, NullPointerException {
    throw new UnsupportedOperationException();
  }
  public boolean addAttribute(Attribute attribute,
                              Collection<ByteString> duplicateValues)
      throws UnsupportedOperationException, NullPointerException {
    throw new UnsupportedOperationException();
  }
  public SearchResultEntry addAttribute(String attributeDescription,
                                        Object... values)
      throws LocalizedIllegalArgumentException,
      UnsupportedOperationException, NullPointerException {
    throw new UnsupportedOperationException();
  }
  public SearchResultEntry clearAttributes()
      throws UnsupportedOperationException {
    throw new UnsupportedOperationException();
  }
  public boolean containsAttribute(Attribute attribute,
                                   Collection<ByteString> missingValues)
      throws NullPointerException {
    return impl.containsAttribute(attribute, missingValues);
  }
  public boolean containsAttribute(String attributeDescription,
                                   Object... values)
      throws LocalizedIllegalArgumentException,
      NullPointerException {
    return impl.containsAttribute(attributeDescription, values);
  }
  public Iterable<Attribute> getAllAttributes() {
    return Iterables.unmodifiable(Iterables.transform(impl
        .getAllAttributes(), UNMODIFIABLE_ATTRIBUTE_FUNCTION));
  }
  public Iterable<Attribute> getAllAttributes(
      AttributeDescription attributeDescription)
      throws NullPointerException {
    return Iterables.unmodifiable(Iterables.transform(impl
        .getAllAttributes(attributeDescription),
        UNMODIFIABLE_ATTRIBUTE_FUNCTION));
  }
  public Iterable<Attribute> getAllAttributes(
      String attributeDescription)
      throws LocalizedIllegalArgumentException,
      NullPointerException {
    return Iterables.unmodifiable(Iterables.transform(impl
        .getAllAttributes(attributeDescription),
        UNMODIFIABLE_ATTRIBUTE_FUNCTION));
  }
  public Attribute getAttribute(
      AttributeDescription attributeDescription)
      throws NullPointerException {
    final Attribute attribute =
        impl.getAttribute(attributeDescription);
    if (attribute != null)
    {
      return Attributes.unmodifiableAttribute(attribute);
    }
    else
    {
      return null;
    }
  }
  public Attribute getAttribute(String attributeDescription)
      throws LocalizedIllegalArgumentException,
      NullPointerException {
    final Attribute attribute =
        impl.getAttribute(attributeDescription);
    if (attribute != null)
    {
      return Attributes.unmodifiableAttribute(attribute);
    }
    else
    {
      return null;
    }
  }
  public int getAttributeCount() {
    return impl.getAttributeCount();
  }
  public DN getName() {
    return impl.getName();
  }
  public boolean removeAttribute(Attribute attribute,
                                 Collection<ByteString> missingValues)
      throws UnsupportedOperationException, NullPointerException {
    throw new UnsupportedOperationException();
  }
  public boolean removeAttribute(
      AttributeDescription attributeDescription)
      throws UnsupportedOperationException, NullPointerException {
    throw new UnsupportedOperationException();
  }
  public SearchResultEntry removeAttribute(String attributeDescription,
                                           Object... values)
      throws LocalizedIllegalArgumentException,
      UnsupportedOperationException, NullPointerException {
    throw new UnsupportedOperationException();
  }
  public boolean replaceAttribute(Attribute attribute)
      throws UnsupportedOperationException, NullPointerException {
    throw new UnsupportedOperationException();
  }
  public SearchResultEntry replaceAttribute(String attributeDescription,
                                            Object... values)
      throws LocalizedIllegalArgumentException,
      UnsupportedOperationException, NullPointerException {
    throw new UnsupportedOperationException();
  }
  public SearchResultEntry setName(DN dn)
      throws UnsupportedOperationException, NullPointerException {
    throw new UnsupportedOperationException();
  }
  public SearchResultEntry setName(String dn)
      throws LocalizedIllegalArgumentException,
      UnsupportedOperationException, NullPointerException {
    throw new UnsupportedOperationException();
  }
}
sdk/src/org/opends/sdk/responses/UnmodifiableSearchResultReferenceImpl.java
New file
@@ -0,0 +1,53 @@
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License, Version 1.0 only
 * (the "License").  You may not use this file except in compliance
 * with the License.
 *
 * You can obtain a copy of the license at
 * trunk/opends/resource/legal-notices/OpenDS.LICENSE
 * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at
 * trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
 * add the following below this CDDL HEADER, with the fields enclosed
 * by brackets "[]" replaced with your own identifying information:
 *      Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 *
 *
 *      Copyright 2010 Sun Microsystems, Inc.
 */
package org.opends.sdk.responses;
import java.util.List;
/**
 * Unmodifiable Search result reference implementation.
 */
class UnmodifiableSearchResultReferenceImpl extends
    AbstractUnmodifiableResponseImpl<SearchResultReference> implements
    SearchResultReference
{
  UnmodifiableSearchResultReferenceImpl(SearchResultReference impl) {
    super(impl);
  }
  @Override
  public SearchResultReference addURI(String uri)
      throws UnsupportedOperationException, NullPointerException {
    throw new UnsupportedOperationException();
  }
  @Override
  public List<String> getURIs() {
    return impl.getURIs();
  }
}
sdk/src/org/opends/sdk/responses/UnmodifiableWhoAmIExtendedResultImpl.java
New file
@@ -0,0 +1,53 @@
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License, Version 1.0 only
 * (the "License").  You may not use this file except in compliance
 * with the License.
 *
 * You can obtain a copy of the license at
 * trunk/opends/resource/legal-notices/OpenDS.LICENSE
 * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at
 * trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
 * add the following below this CDDL HEADER, with the fields enclosed
 * by brackets "[]" replaced with your own identifying information:
 *      Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 *
 *
 *      Copyright 2010 Sun Microsystems, Inc.
 */
package org.opends.sdk.responses;
import org.opends.sdk.LocalizedIllegalArgumentException;
/**
 * Unmodifiable Who Am I extended result implementation.
 */
class UnmodifiableWhoAmIExtendedResultImpl extends
    AbstractUnmodifiableExtendedResultImpl<WhoAmIExtendedResult> implements
    WhoAmIExtendedResult
{
  UnmodifiableWhoAmIExtendedResultImpl(WhoAmIExtendedResult impl) {
    super(impl);
  }
  @Override
  public String getAuthorizationID() {
    return impl.getAuthorizationID();
  }
  @Override
  public WhoAmIExtendedResult setAuthorizationID(String authorizationID)
      throws LocalizedIllegalArgumentException, UnsupportedOperationException {
    throw new UnsupportedOperationException();
  }
}
sdk/src/org/opends/sdk/responses/WhoAmIExtendedResult.java
@@ -181,9 +181,12 @@
   * @throws LocalizedIllegalArgumentException
   *           If {@code authorizationID} was non-empty and did not contain a
   *           valid authorization ID type.
   * @throws UnsupportedOperationException
   *           If this who am I extended result does not permit the
   *           authorization ID to be set.
   */
  WhoAmIExtendedResult setAuthorizationID(String authorizationID)
      throws LocalizedIllegalArgumentException;
      throws LocalizedIllegalArgumentException, UnsupportedOperationException;
sdk/src/org/opends/sdk/responses/WhoAmIExtendedResultImpl.java
@@ -42,7 +42,7 @@
 * Who Am I extended result implementation.
 */
final class WhoAmIExtendedResultImpl extends
    AbstractExtendedResult<WhoAmIExtendedResult> implements
    AbstractExtendedResultImpl<WhoAmIExtendedResult> implements
    WhoAmIExtendedResult
{
@@ -60,6 +60,24 @@
  /**
   * Creates a new who am I extended result that is an exact copy of the
   * provided result.
   *
   * @param whoAmIExtendedResult
   *          The who am I extended result to be copied.
   * @throws NullPointerException
   *           If {@code whoAmIExtendedResult} was {@code null} .
   */
  WhoAmIExtendedResultImpl(final WhoAmIExtendedResult whoAmIExtendedResult)
      throws NullPointerException
  {
    super(whoAmIExtendedResult);
    this.authorizationID = whoAmIExtendedResult.getAuthorizationID();
  }
  /**
   * {@inheritDoc}
   */
  public String getAuthorizationID()