jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomm...@apache.org
Subject svn commit: r1449698 - in /jackrabbit/oak/trunk: oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/query/ oak-solr-remote/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/http/
Date Mon, 25 Feb 2013 13:35:21 GMT
Author: tommaso
Date: Mon Feb 25 13:35:21 2013
New Revision: 1449698

URL: http://svn.apache.org/r1449698
Log:
OAK-651 - remote configuration created on demand, made parameter order consistent between
providers

Modified:
    jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/query/SolrQueryIndexProvider.java
    jackrabbit/oak/trunk/oak-solr-remote/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/http/RemoteSolrConfigurationProvider.java

Modified: jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/query/SolrQueryIndexProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/query/SolrQueryIndexProvider.java?rev=1449698&r1=1449697&r2=1449698&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/query/SolrQueryIndexProvider.java
(original)
+++ jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/query/SolrQueryIndexProvider.java
Mon Feb 25 13:35:21 2013
@@ -54,7 +54,7 @@ public class SolrQueryIndexProvider impl
     public SolrQueryIndexProvider() {
     }
 
-    public SolrQueryIndexProvider(OakSolrConfigurationProvider oakSolrConfigurationProvider,
SolrServerProvider solrServerProvider) {
+    public SolrQueryIndexProvider(SolrServerProvider solrServerProvider, OakSolrConfigurationProvider
oakSolrConfigurationProvider) {
         this.oakSolrConfigurationProvider = oakSolrConfigurationProvider;
         this.solrServerProvider = solrServerProvider;
     }

Modified: jackrabbit/oak/trunk/oak-solr-remote/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/http/RemoteSolrConfigurationProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-remote/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/http/RemoteSolrConfigurationProvider.java?rev=1449698&r1=1449697&r2=1449698&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-remote/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/http/RemoteSolrConfigurationProvider.java
(original)
+++ jackrabbit/oak/trunk/oak-solr-remote/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/http/RemoteSolrConfigurationProvider.java
Mon Feb 25 13:35:21 2013
@@ -72,53 +72,53 @@ public class RemoteSolrConfigurationProv
         pathParentFieldName = String.valueOf(componentContext.getProperties().get(PATH_PARENT_FIELD));
         pathExactFieldName = String.valueOf(componentContext.getProperties().get(PATH_EXACT_FIELD));
         pathDescendantsFieldName = String.valueOf(componentContext.getProperties().get(PATH_DESCENDANTS_FIELD));
+    }
 
-        oakSolrConfiguration = new OakSolrConfiguration() {
-            @Override
-            public String getFieldNameFor(Type<?> propertyType) {
-                return null;
-            }
-
-            @Override
-            public String getPathField() {
-                return pathExactFieldName;
-            }
-
-            @Override
-            public String getFieldForPathRestriction(Filter.PathRestriction pathRestriction)
{
-                String fieldName = null;
-                switch (pathRestriction) {
-                    case ALL_CHILDREN: {
-                        fieldName = pathDescendantsFieldName;
-                        break;
-                    }
-                    case DIRECT_CHILDREN: {
-                        fieldName = pathChildrenFieldName;
-                        break;
-                    }
-                    case EXACT: {
-                        fieldName = pathExactFieldName;
-                        break;
-                    }
-                    case PARENT: {
-                        fieldName = pathParentFieldName;
-                        break;
-                    }
+    @Override
+    public OakSolrConfiguration getConfiguration() {
+        if (oakSolrConfiguration == null) {
+            oakSolrConfiguration = new OakSolrConfiguration() {
+                @Override
+                public String getFieldNameFor(Type<?> propertyType) {
+                    return null;
+                }
 
+                @Override
+                public String getPathField() {
+                    return pathExactFieldName;
                 }
-                return fieldName;
-            }
 
-            @Override
-            public String getFieldForPropertyRestriction(Filter.PropertyRestriction propertyRestriction)
{
-                return null;
-            }
-        };
+                @Override
+                public String getFieldForPathRestriction(Filter.PathRestriction pathRestriction)
{
+                    String fieldName = null;
+                    switch (pathRestriction) {
+                        case ALL_CHILDREN: {
+                            fieldName = pathDescendantsFieldName;
+                            break;
+                        }
+                        case DIRECT_CHILDREN: {
+                            fieldName = pathChildrenFieldName;
+                            break;
+                        }
+                        case EXACT: {
+                            fieldName = pathExactFieldName;
+                            break;
+                        }
+                        case PARENT: {
+                            fieldName = pathParentFieldName;
+                            break;
+                        }
 
-    }
+                    }
+                    return fieldName;
+                }
 
-    @Override
-    public OakSolrConfiguration getConfiguration() {
+                @Override
+                public String getFieldForPropertyRestriction(Filter.PropertyRestriction propertyRestriction)
{
+                    return null;
+                }
+            };
+        }
         return oakSolrConfiguration;
     }
 }



Mime
View raw message