Skip to content
Browse files

LPS-24610 Better backwards compatibility

  • Loading branch information...
1 parent f972a8d commit 77f593a4d943d67c577fa9e2376e0283532b060a @brianchandotcom brianchandotcom committed Apr 9, 2012
View
22 portal-service/src/com/liferay/portal/kernel/search/AbstractSearchEngineConfigurator.java
@@ -15,6 +15,8 @@
package com.liferay.portal.kernel.search;
import com.liferay.portal.kernel.cluster.messaging.ClusterBridgeMessageListener;
+import com.liferay.portal.kernel.log.Log;
+import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.messaging.Destination;
import com.liferay.portal.kernel.messaging.InvokerMessageListener;
import com.liferay.portal.kernel.messaging.MessageBus;
@@ -27,6 +29,7 @@
import com.liferay.portal.kernel.util.Validator;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
import java.util.Map.Entry;
import java.util.Map;
@@ -72,6 +75,22 @@ public void destroy() {
}
}
+ /**
+ * @deprecated {@link #setSearchEngines(Map)}
+ */
+ public void setSearchEngines(List<SearchEngine> searchEngines) {
+ _searchEngines = new HashMap<String, SearchEngine>();
+
+ if (searchEngines.size() == 1) {
+ SearchEngine searchEngine = searchEngines.get(0);
+
+ _searchEngines.put(SearchEngineUtil.SYSTEM_ENGINE_ID, searchEngine);
+ }
+ else {
+ _log.error("Unable to determine search engine IDs");
+ }
+ }
+
public void setSearchEngines(Map<String, SearchEngine> searchEngines) {
_searchEngines = searchEngines;
}
@@ -329,6 +348,9 @@ protected void savePreviousSearchEngineListeners(
}
}
+ private static Log _log = LogFactoryUtil.getLog(
+ AbstractSearchEngineConfigurator.class);
+
private String _originalSearchEngineId;
private List<SearchEngineRegistration> _searchEngineRegistrations =
new ArrayList<SearchEngineRegistration>();

0 comments on commit 77f593a

Please sign in to comment.
Something went wrong with that request. Please try again.