jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomm...@apache.org
Subject svn commit: r1449711 - in /jackrabbit/oak/trunk: oak-solr-embedded/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/embedded/ oak-solr-remote/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/http/
Date Mon, 25 Feb 2013 14:07:50 GMT
Author: tommaso
Date: Mon Feb 25 14:07:50 2013
New Revision: 1449711

URL: http://svn.apache.org/r1449711
Log:
OAK-651 - added defaults when providers constructors are called with default constructor

Modified:
    jackrabbit/oak/trunk/oak-solr-embedded/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/embedded/EmbeddedSolrConfiguration.java
    jackrabbit/oak/trunk/oak-solr-embedded/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/embedded/EmbeddedSolrServerProvider.java
    jackrabbit/oak/trunk/oak-solr-remote/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/http/RemoteSolrConfigurationProvider.java
    jackrabbit/oak/trunk/oak-solr-remote/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/http/RemoteSolrServerProvider.java

Modified: jackrabbit/oak/trunk/oak-solr-embedded/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/embedded/EmbeddedSolrConfiguration.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-embedded/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/embedded/EmbeddedSolrConfiguration.java?rev=1449711&r1=1449710&r2=1449711&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-embedded/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/embedded/EmbeddedSolrConfiguration.java
(original)
+++ jackrabbit/oak/trunk/oak-solr-embedded/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/embedded/EmbeddedSolrConfiguration.java
Mon Feb 25 14:07:50 2013
@@ -24,6 +24,12 @@ import org.apache.jackrabbit.oak.spi.que
  * An {@link OakSolrConfiguration} for the embedded Solr server
  */
 public class EmbeddedSolrConfiguration implements OakSolrConfiguration {
+
+    private static final String PATH_FIELD_NAME = "path";
+    private static final String CHILD_FIELD_NAME = "path_child";
+    private static final String DESC_FIELD_NAME = "path_desc";
+    private static final String ANC_FIELD_NAME = "path_anc";
+
     @Override
     public String getFieldNameFor(Type<?> propertyType) {
         return null;
@@ -31,7 +37,7 @@ public class EmbeddedSolrConfiguration i
 
     @Override
     public String getPathField() {
-        return "path";
+        return PATH_FIELD_NAME;
     }
 
     @Override
@@ -39,19 +45,19 @@ public class EmbeddedSolrConfiguration i
         String fieldName = null;
         switch (pathRestriction) {
             case ALL_CHILDREN: {
-                fieldName = "path_desc";
+                fieldName = DESC_FIELD_NAME;
                 break;
             }
             case DIRECT_CHILDREN: {
-                fieldName = "path_child";
+                fieldName = CHILD_FIELD_NAME;
                 break;
             }
             case EXACT: {
-                fieldName = "path";
+                fieldName = PATH_FIELD_NAME;
                 break;
             }
             case PARENT: {
-                fieldName = "path_anc";
+                fieldName = ANC_FIELD_NAME;
                 break;
             }
 

Modified: jackrabbit/oak/trunk/oak-solr-embedded/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/embedded/EmbeddedSolrServerProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-embedded/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/embedded/EmbeddedSolrServerProvider.java?rev=1449711&r1=1449710&r2=1449711&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-embedded/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/embedded/EmbeddedSolrServerProvider.java
(original)
+++ jackrabbit/oak/trunk/oak-solr-embedded/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/embedded/EmbeddedSolrServerProvider.java
Mon Feb 25 14:07:50 2013
@@ -47,15 +47,17 @@ public class EmbeddedSolrServerProvider 
 
     private final Logger log = LoggerFactory.getLogger(EmbeddedSolrServerProvider.class);
 
-    private static final String SOLR_HOME_PROPERTY_NAME = "solr.solr.home";
+    private static final String DEFAULT_PORT = "8983";
+    private static final String DEFAULT_HOME_PATH = "/";
     private static final String DEFAULT_CORE_NAME = "oak";
+    private static final String SOLR_HOME_PROPERTY_NAME = "solr.solr.home";
     private static final String LOCAL_BASE_URL = "http://127.0.0.1";
     private static final String CONTEXT = "/solr";
 
-    @Property(value = "/")
+    @Property(value = DEFAULT_HOME_PATH)
     private static final String SOLR_HOME_PATH = "solr.home.path";
 
-    @Property(value = "8983")
+    @Property(value = DEFAULT_PORT)
     private static final String SOLR_HTTP_PORT = "solr.http.port";
 
     private SolrServer solrServer;
@@ -64,6 +66,8 @@ public class EmbeddedSolrServerProvider 
     private Integer solrHttpPort;
 
     public EmbeddedSolrServerProvider() {
+        this.solrHome = DEFAULT_HOME_PATH;
+        this.solrHttpPort = Integer.valueOf(DEFAULT_PORT);
     }
 
     public EmbeddedSolrServerProvider(String solrHome, Integer solrHttpPort) {

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=1449711&r1=1449710&r2=1449711&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 14:07:50 2013
@@ -37,16 +37,21 @@ import org.osgi.service.component.Compon
 @Service(OakSolrConfigurationProvider.class)
 public class RemoteSolrConfigurationProvider implements OakSolrConfigurationProvider {
 
-    @Property(value = "path_des")
+    private static final String DEFAULT_DESC_FIELD = "path_des";
+    private static final String DEFAULT_CHILD_FIELD = "path_child";
+    private static final String DEFAULT_PARENT_FIELD = "path_anc";
+    private static final String DEFAULT_PATH_FIELD = "path_exact";
+
+    @Property(value = DEFAULT_DESC_FIELD)
     private static final String PATH_DESCENDANTS_FIELD = "path.desc.field";
 
-    @Property(value = "path_child")
+    @Property(value = DEFAULT_CHILD_FIELD)
     private static final String PATH_CHILDREN_FIELD = "path.child.field";
 
-    @Property(value = "path_anc")
+    @Property(value = DEFAULT_PARENT_FIELD)
     private static final String PATH_PARENT_FIELD = "path.parent.field";
 
-    @Property(value = "path_exact")
+    @Property(value = DEFAULT_PATH_FIELD)
     private static final String PATH_EXACT_FIELD = "path.exact.field";
 
     private String pathChildrenFieldName;
@@ -57,6 +62,10 @@ public class RemoteSolrConfigurationProv
     private OakSolrConfiguration oakSolrConfiguration;
 
     public RemoteSolrConfigurationProvider() {
+        this.pathChildrenFieldName = DEFAULT_CHILD_FIELD;
+        this.pathDescendantsFieldName = DEFAULT_DESC_FIELD;
+        this.pathExactFieldName = DEFAULT_PATH_FIELD;
+        this.pathParentFieldName = DEFAULT_PARENT_FIELD;
     }
 
     public RemoteSolrConfigurationProvider(String pathChildrenFieldName, String pathParentFieldName,

Modified: jackrabbit/oak/trunk/oak-solr-remote/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/http/RemoteSolrServerProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-remote/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/http/RemoteSolrServerProvider.java?rev=1449711&r1=1449710&r2=1449711&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-remote/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/http/RemoteSolrServerProvider.java
(original)
+++ jackrabbit/oak/trunk/oak-solr-remote/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/http/RemoteSolrServerProvider.java
Mon Feb 25 14:07:50 2013
@@ -43,11 +43,13 @@ public class RemoteSolrServerProvider im
     private final Logger log = LoggerFactory.getLogger(RemoteSolrServerProvider.class);
 
     private static final String DEFAULT_COLLECTION = "oak";
+    private static final String DEFAULT_HTTP_URL = "http://127.0.0.1:8983/solr";
+    private static final String DEFAULT_ZK_HOST = "localhost:9983";
 
-    @Property(value = "http://127.0.0.1:8983/solr")
+    @Property(value = DEFAULT_HTTP_URL)
     private static final String SOLR_HTTP_URL = "solr.http.url";
 
-    @Property(value = "localhost:9983")
+    @Property(value = DEFAULT_ZK_HOST)
     private static final String SOLR_ZK_HOST = "solr.zk.host";
 
     private SolrServer solrServer;
@@ -55,6 +57,8 @@ public class RemoteSolrServerProvider im
     private String solrZkHost;
 
     public RemoteSolrServerProvider() {
+        this.solrHttpUrl = DEFAULT_HTTP_URL;
+        this.solrZkHost = DEFAULT_ZK_HOST;
     }
 
     public RemoteSolrServerProvider(String solrHttpUrl, String solrZkHost) {



Mime
View raw message