From 7502e11a640c6eb92c4fc7604a4abf31c28745ed Mon Sep 17 00:00:00 2001
From: Matthew Swift <matthew.swift@forgerock.com>
Date: Mon, 20 Jun 2011 11:16:07 +0000
Subject: [PATCH] Fix OPENDJ-206: Add schema reading methods to SchemaBuilder and remove Schema/RootDSE methods from the Connection/AsynchronousConnection APIs

---
 opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/Connection.java |  193 ------------------------------------------------
 1 files changed, 1 insertions(+), 192 deletions(-)

diff --git a/opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/Connection.java b/opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/Connection.java
index 3911007..f19e9ff 100644
--- a/opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/Connection.java
+++ b/opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/Connection.java
@@ -23,6 +23,7 @@
  *
  *
  *      Copyright 2009-2010 Sun Microsystems, Inc.
+ *      Portions copyright 2011 ForgeRock AS
  */
 
 package org.forgerock.opendj.ldap;
@@ -36,7 +37,6 @@
 import org.forgerock.i18n.LocalizedIllegalArgumentException;
 import org.forgerock.opendj.ldap.requests.*;
 import org.forgerock.opendj.ldap.responses.*;
-import org.forgerock.opendj.ldap.schema.Schema;
 import org.forgerock.opendj.ldif.ConnectionEntryReader;
 
 
@@ -778,197 +778,6 @@
 
 
   /**
-   * Reads the Root DSE from the Directory Server.
-   * <p>
-   * If the Root DSE is not returned by the Directory Server then the request
-   * will fail with an {@link EntryNotFoundException}. More specifically, this
-   * method will never return {@code null}.
-   *
-   * @return The Directory Server's Root DSE.
-   * @throws ErrorResultException
-   *           If the result code indicates that the request failed for some
-   *           reason.
-   * @throws InterruptedException
-   *           If the current thread was interrupted while waiting.
-   * @throws UnsupportedOperationException
-   *           If this connection does not support search operations.
-   * @throws IllegalStateException
-   *           If this connection has already been closed, i.e. if {@code
-   *           isClosed() == true}.
-   */
-  RootDSE readRootDSE() throws ErrorResultException, InterruptedException,
-      UnsupportedOperationException, IllegalStateException;
-
-
-
-  /**
-   * Reads the schema from the Directory Server contained in the named subschema
-   * sub-entry.
-   * <p>
-   * If the requested schema is not returned by the Directory Server then the
-   * request will fail with an {@link EntryNotFoundException}. More
-   * specifically, this method will never return {@code null}.
-   * <p>
-   * Implementations may choose to perform optimizations such as caching.
-   *
-   * @param name
-   *          The distinguished name of the subschema sub-entry.
-   * @return The schema from the Directory Server.
-   * @throws ErrorResultException
-   *           If the result code indicates that the request failed for some
-   *           reason.
-   * @throws InterruptedException
-   *           If the current thread was interrupted while waiting.
-   * @throws UnsupportedOperationException
-   *           If this connection does not support search operations.
-   * @throws IllegalStateException
-   *           If this connection has already been closed, i.e. if {@code
-   *           isClosed() == true}.
-   */
-  Schema readSchema(DN name) throws ErrorResultException, InterruptedException,
-      UnsupportedOperationException, IllegalStateException;
-
-
-
-  /**
-   * Reads the schema from the Directory Server contained in the named subschema
-   * sub-entry.
-   * <p>
-   * If the requested schema is not returned by the Directory Server then the
-   * request will fail with an {@link EntryNotFoundException}. More
-   * specifically, this method will never return {@code null}.
-   * <p>
-   * Implementations may choose to perform optimizations such as caching.
-   *
-   * @param name
-   *          The distinguished name of the subschema sub-entry.
-   * @return The schema from the Directory Server.
-   * @throws ErrorResultException
-   *           If the result code indicates that the request failed for some
-   *           reason.
-   * @throws LocalizedIllegalArgumentException
-   *           If {@code name} could not be decoded using the default schema.
-   * @throws InterruptedException
-   *           If the current thread was interrupted while waiting.
-   * @throws UnsupportedOperationException
-   *           If this connection does not support search operations.
-   * @throws IllegalStateException
-   *           If this connection has already been closed, i.e. if {@code
-   *           isClosed() == true}.
-   */
-  Schema readSchema(String name) throws ErrorResultException,
-      InterruptedException, LocalizedIllegalArgumentException,
-      UnsupportedOperationException, IllegalStateException;
-
-
-
-  /**
-   * Reads the schema from the Directory Server which applies to the named
-   * entry.
-   * <p>
-   * If the requested entry or its associated schema are not returned by the
-   * Directory Server then the request will fail with an
-   * {@link EntryNotFoundException}. More specifically, this method will never
-   * return {@code null}.
-   * <p>
-   * A typical implementation will first read the {@code subschemaSubentry}
-   * attribute of the entry in order to locate the schema. However,
-   * implementations may choose to perform other optimizations, such as caching.
-   *
-   * @param name
-   *          The distinguished name of the entry whose schema is to be located.
-   * @return The schema from the Directory Server which applies to the named
-   *         entry.
-   * @throws ErrorResultException
-   *           If the result code indicates that the request failed for some
-   *           reason.
-   * @throws InterruptedException
-   *           If the current thread was interrupted while waiting.
-   * @throws UnsupportedOperationException
-   *           If this connection does not support search operations.
-   * @throws IllegalStateException
-   *           If this connection has already been closed, i.e. if {@code
-   *           isClosed() == true}.
-   */
-  Schema readSchemaForEntry(DN name) throws ErrorResultException,
-      InterruptedException, UnsupportedOperationException,
-      IllegalStateException;
-
-
-
-  /**
-   * Reads the schema from the Directory Server which applies to the named
-   * entry.
-   * <p>
-   * If the requested entry or its associated schema are not returned by the
-   * Directory Server then the request will fail with an
-   * {@link EntryNotFoundException}. More specifically, this method will never
-   * return {@code null}.
-   * <p>
-   * A typical implementation will first read the {@code subschemaSubentry}
-   * attribute of the entry in order to locate the schema. However,
-   * implementations may choose to perform other optimizations, such as caching.
-   *
-   * @param name
-   *          The distinguished name of the entry whose schema is to be located.
-   * @return The schema from the Directory Server which applies to the named
-   *         entry.
-   * @throws ErrorResultException
-   *           If the result code indicates that the request failed for some
-   *           reason.
-   * @throws LocalizedIllegalArgumentException
-   *           If {@code name} could not be decoded using the default schema.
-   * @throws InterruptedException
-   *           If the current thread was interrupted while waiting.
-   * @throws UnsupportedOperationException
-   *           If this connection does not support search operations.
-   * @throws IllegalStateException
-   *           If this connection has already been closed, i.e. if {@code
-   *           isClosed() == true}.
-   */
-  Schema readSchemaForEntry(String name) throws ErrorResultException,
-      InterruptedException, LocalizedIllegalArgumentException,
-      UnsupportedOperationException, IllegalStateException;
-
-
-
-  /**
-   * Reads the schema from the Directory Server which applies to the Root DSE.
-   * <p>
-   * If the requested schema is not returned by the Directory Server then the
-   * request will fail with an {@link EntryNotFoundException}. More
-   * specifically, this method will never return {@code null}.
-   * <p>
-   * A typical implementation will first read the {@code subschemaSubentry}
-   * attribute of the Root DSE in order to locate the schema. However,
-   * implementations may choose to perform other optimizations, such as caching.
-   * <p>
-   * This method is equivalent to the following code:
-   *
-   * <pre>
-   * connection.readSchemaForEntry(DN.rootDN());
-   * </pre>
-   *
-   * @return The schema from the Directory Server which applies to the named
-   *         entry.
-   * @throws ErrorResultException
-   *           If the result code indicates that the request failed for some
-   *           reason.
-   * @throws InterruptedException
-   *           If the current thread was interrupted while waiting.
-   * @throws UnsupportedOperationException
-   *           If this connection does not support search operations.
-   * @throws IllegalStateException
-   *           If this connection has already been closed, i.e. if {@code
-   *           isClosed() == true}.
-   */
-  Schema readSchemaForRootDSE() throws ErrorResultException,
-      InterruptedException, UnsupportedOperationException,
-      IllegalStateException;
-
-
-
-  /**
    * Removes the provided connection event listener from this connection so that
    * it will no longer be notified when this connection is closed by the
    * application, receives an unsolicited notification, or experiences a fatal

--
Gitblit v1.10.0