SMILA (incubation) API documentation

org.eclipse.smila.search.api.internal
Class SearchServiceImpl

java.lang.Object
  extended by org.eclipse.smila.search.api.internal.SearchServiceImpl
All Implemented Interfaces:
SearchService

public class SearchServiceImpl
extends java.lang.Object
implements SearchService

SearchService implementation to be used as a Declarative Service. The connection to a WorkflowProcessor is also setup using a DS service reference.

Author:
jschumacher

Field Summary
 
Fields inherited from interface org.eclipse.smila.search.api.SearchService
NAMESPACE_SEARCH, TAG_DETAILS, TAG_ERROR, TAG_MESSAGE, TAG_SEARCHRESULT, TAG_WORKFLOWNAME
 
Constructor Summary
SearchServiceImpl()
          create instance.
 
Method Summary
protected  void activate(ComponentContext context)
          
protected  void deactivate(ComponentContext context)
          OSGi Declarative Services service deactivation method.
 Record search(java.lang.String workflowName, Record query)
          Execute a query using the named workflow and create a SearchResult from the workflow result.
 org.w3c.dom.Document searchAsXml(java.lang.String workflowName, Record query)
          Execute a query using the named workflow and return the search result as an XML document.
 java.lang.String searchAsXmlString(java.lang.String workflowName, Record query)
          Execute a query using the named workflow and return the search result as an XML string.
 void setBlackboardFactory(BlackboardFactory factory)
          set blackboard factory reference (used by DS).
 void setProcessor(WorkflowProcessor processor)
          set workflow processor reference (used by DS).
 void unsetBlackboardFactory(BlackboardFactory factory)
          remove blackboard factory reference (used by DS).
 void unsetProcessor(WorkflowProcessor processor)
          remove workflow processor reference (used by DS).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SearchServiceImpl

public SearchServiceImpl()
create instance.

Method Detail

search

public Record search(java.lang.String workflowName,
                     Record query)
              throws ProcessingException
Execute a query using the named workflow and create a SearchResult from the workflow result.

Specified by:
search in interface SearchService
Parameters:
workflowName - name of workflow to process the search.
query - query object describing the search.
Returns:
search result record
Throws:
ProcessingException - error while processing the request or preparing the input message or search result.

searchAsXml

public org.w3c.dom.Document searchAsXml(java.lang.String workflowName,
                                        Record query)
                                 throws javax.xml.parsers.ParserConfigurationException
Execute a query using the named workflow and return the search result as an XML document.

Specified by:
searchAsXml in interface SearchService
Parameters:
workflowName - name of workflow to process the search.
query - query object describing the search.
Returns:
search result as DOM document, or description of ProcessingException
Throws:
javax.xml.parsers.ParserConfigurationException - error creating the XML result.
See Also:
org.eclipse.smila.search.api.SearchService#xmlSearch(java.lang.String, org.eclipse.smila.datamodel.record.Record)

searchAsXmlString

public java.lang.String searchAsXmlString(java.lang.String workflowName,
                                          Record query)
                                   throws javax.xml.parsers.ParserConfigurationException
Execute a query using the named workflow and return the search result as an XML string.

Specified by:
searchAsXmlString in interface SearchService
Parameters:
workflowName - name of workflow to process the search.
query - query object describing the search.
Returns:
search result as XML string, or description of ProcessingException
Throws:
javax.xml.parsers.ParserConfigurationException - error creating the XML result.
See Also:
org.eclipse.smila.search.api.SearchService#searchAsXmlString(java.lang.String, org.eclipse.smila.datamodel.record.Record)

activate

protected void activate(ComponentContext context)


deactivate

protected void deactivate(ComponentContext context)
OSGi Declarative Services service deactivation method.

Parameters:
context - OSGi service component context.

setProcessor

public void setProcessor(WorkflowProcessor processor)
set workflow processor reference (used by DS).

Parameters:
processor - workflow processor

unsetProcessor

public void unsetProcessor(WorkflowProcessor processor)
remove workflow processor reference (used by DS).

Parameters:
processor - workflow processor

setBlackboardFactory

public void setBlackboardFactory(BlackboardFactory factory)
set blackboard factory reference (used by DS).

Parameters:
factory - blackboard factory

unsetBlackboardFactory

public void unsetBlackboardFactory(BlackboardFactory factory)
remove blackboard factory reference (used by DS).

Parameters:
factory - blackboard factory

SMILA (incubation) API documentation