From 640ac743fe38377eca4dba3cbd83adaa42853bb0 Mon Sep 17 00:00:00 2001
From: Nicolas Capponi <nicolas.capponi@forgerock.com>
Date: Wed, 01 Oct 2014 11:40:53 +0000
Subject: [PATCH] OPENDJ-1308 Migrate schema support - Matching Rules

---
 opendj3-server-dev/replace.rb |   28 ++++++++++++++++++++++------
 1 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/opendj3-server-dev/replace.rb b/opendj3-server-dev/replace.rb
index d6a8af7..95d6bd1 100755
--- a/opendj3-server-dev/replace.rb
+++ b/opendj3-server-dev/replace.rb
@@ -44,12 +44,28 @@
         /import org.opends.server.api.MatchingRule;/,
         'import org.forgerock.opendj.ldap.schema.MatchingRule;',
 
-        # For MR factories
-        /\binitializeMatchingRule\(MatchingRuleCfg configuration\)/,
-        "initializeMatchingRule(ServerContext serverContext, MatchingRuleCfg configuration)",
+      ]
+  }
 
-        # For MR factories
-        /\bmatchingRule = new \w*MatchingRule();/,
+  MRULES_FACTORIES = {
+    :dirs => ["src/server/org/opends/server/schema"],
+    :extensions => ["java"],
+    :stopwords => [],
+    :replacements =>
+      [
+        /import org.opends.server.api.MatchingRule;/,
+        'import org.forgerock.opendj.ldap.schema.MatchingRule;',
+
+        /private MatchingRule matchingRule;/,
+        "private org.forgerock.opendj.ldap.schema.MatchingRule matchingRule;",
+
+        /public final Collection<MatchingRule> getMatchingRules\(\)/,
+        "public final Collection<org.forgerock.opendj.ldap.schema.MatchingRule> getMatchingRules()",
+
+        /public final void initializeMatchingRule\(MatchingRuleCfg configuration\)/,
+        "public final void initializeMatchingRule(ServerContext serverContext, MatchingRuleCfg configuration)",
+
+        /\bmatchingRule = new \w*MatchingRule\(\);/,
         "matchingRule = serverContext.getSchemaNG().getMatchingRule(EMR_);"
 
        ]
@@ -344,7 +360,7 @@
 
   ###############################  List of replacements to run #################################
 
-  REPLACEMENTS = [ MRULES ]
+  REPLACEMENTS = [ MRULES_TO_SDK, MRULES_FACTORIES ]
 
   ################################### Processing methods ########################################
 

--
Gitblit v1.10.0