Author: thomas.heute(a)jboss.com
Date: 2006-12-14 09:51:47 -0500 (Thu, 14 Dec 2006)
New Revision: 5856
Added:
trunk/search/src/main/org/jboss/portal/search/test/DummySearchFederated.java
Log:
Federated search (test)
Added: trunk/search/src/main/org/jboss/portal/search/test/DummySearchFederated.java
===================================================================
---
trunk/search/src/main/org/jboss/portal/search/test/DummySearchFederated.java 2006-12-14
14:51:24 UTC (rev 5855)
+++
trunk/search/src/main/org/jboss/portal/search/test/DummySearchFederated.java 2006-12-14
14:51:47 UTC (rev 5856)
@@ -0,0 +1,80 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.search.test;
+
+import org.jboss.portal.search.IndexingException;
+import org.jboss.portal.search.federation.Info;
+import org.jboss.portal.search.federation.SearchFederated;
+import org.jboss.portal.search.query.Query;
+import org.jboss.portal.search.result.Results;
+import org.jboss.portal.search.result.impl.SimpleResult;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class DummySearchFederated implements SearchFederated
+{
+
+ private Info info;
+
+ public DummySearchFederated()
+ {
+ info = new Info();
+ }
+
+ public void create() throws IndexingException
+ {
+ info.setStatus(Info.Status.STARTED);
+ }
+
+ public void destroy() throws IndexingException
+ {
+ info.setStatus(Info.Status.STOPPED);
+ }
+
+ public String getId()
+ {
+ return "DummySearchFederated";
+ }
+
+ public Info getInfo()
+ {
+ return info;
+ }
+
+ public String getMarkup(Results results, int markupLevel)
+ {
+ return null;
+ }
+
+ public Results search(Query query)
+ {
+ Results results = new Results();
+ results.add(new SimpleResult(getId(), "Result 1"));
+ results.add(new SimpleResult(getId(), "Result 2"));
+ results.add(new SimpleResult(getId(), "Result 3"));
+ return results;
+ }
+
+}