From b7b1ee33661feee0d7ebf39bdc29f61e43bd2b50 Mon Sep 17 00:00:00 2001
From: Matthew Swift <matthew.swift@forgerock.com>
Date: Thu, 19 May 2011 15:39:08 +0000
Subject: [PATCH] Fix OPENDJ-159 - LDAP connections use stale default schema if it is changed after factory creation

---
 opendj3/opendj-sdk/src/main/java/org/opends/sdk/SchemaResolver.java |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/opendj3/opendj-sdk/src/main/java/org/opends/sdk/SchemaResolver.java b/opendj3/opendj-sdk/src/main/java/org/opends/sdk/SchemaResolver.java
index f7243c4..44aed09 100644
--- a/opendj3/opendj-sdk/src/main/java/org/opends/sdk/SchemaResolver.java
+++ b/opendj3/opendj-sdk/src/main/java/org/opends/sdk/SchemaResolver.java
@@ -23,6 +23,7 @@
  *
  *
  *      Copyright 2010 Sun Microsystems, Inc.
+ *      Portions copyright 2011 ForgeRock AS
  */
 
 package org.opends.sdk;
@@ -47,6 +48,20 @@
  */
 public interface SchemaResolver
 {
+  /**
+   * A schema resolver which always returns the current default schema as
+   * returned by {@link Schema#getDefaultSchema()}.
+   */
+  public static final SchemaResolver DEFAULT = new SchemaResolver()
+  {
+
+    public Schema resolveSchema(String dn)
+    {
+      return Schema.getDefaultSchema();
+    }
+  };
+
+
 
   /**
    * Finds the appropriate schema for use with the provided distinguished name.

--
Gitblit v1.10.0