de.uka.cmtm.serviceregistry.query.protege
Class ProtegeServiceProfileLocator

java.lang.Object
  extended by de.uka.cmtm.serviceregistry.query.protege.ProtegeServiceProfileLocator
All Implemented Interfaces:
ServiceProfileLocator

public class ProtegeServiceProfileLocator
extends Object
implements ServiceProfileLocator

Implementation of ServiceProfileLocator that uses a DigProfileIndividualLocator to perform ontology queries.

Author:
tilmann

Constructor Summary
ProtegeServiceProfileLocator(String digReasonerUrl, String serviceOntologyUrl, String upperServiceOntologyUrl, String topOntologyUrl)
          Creates a new ProfileIndividualLocator
 
Method Summary
 void addServiceLocatorEventListener(ServiceLocatorEventListener listener)
          Sets a ServiceLocatorEventListener to be notified of events during search
 List<ServiceProfileInfo> findServiceProfiles(int searchLevel)
          This method can be used to search for services profiles suitable to the previously set searchParameters.
 int getAvailableSearchLevels()
          Get the maximum search level that can be used plus one.
 void removeServiceLocatorEventListener(ServiceLocatorEventListener listener)
          Removes a previously set ServiceLocatorEventListener
 void setServiceProfileParameter(ServiceProfileParameter searchParameter)
          Sets the search parameter for subsequent calls to findServiceProfiles
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProtegeServiceProfileLocator

public ProtegeServiceProfileLocator(String digReasonerUrl,
                                    String serviceOntologyUrl,
                                    String upperServiceOntologyUrl,
                                    String topOntologyUrl)
                             throws InstantiationException
Creates a new ProfileIndividualLocator

Throws:
InstantiationException - if there is an error while reading the ontology ob instantiating the DigProfileIndividualLocator
Method Detail

findServiceProfiles

public List<ServiceProfileInfo> findServiceProfiles(int searchLevel)
                                             throws IOException
This method can be used to search for services profiles suitable to the previously set searchParameters. The resulting list may also contain services that do not perfectly match the parameters. This is indicated with a relevance below 1. How exact sercice profiles are matched can be specified wiht the searchLevel parameter. Subsequent calls for a single search parameter must start with search level 0 and may increase searchlevel only by one each time up to the maximum that can be obtained by getAvailableSearchLevels.

Specified by:
findServiceProfiles in interface ServiceProfileLocator
Parameters:
searchLevel - the search level to be applied
Returns:
a list of search results
Throws:
IOException

getAvailableSearchLevels

public int getAvailableSearchLevels()
Get the maximum search level that can be used plus one.

Specified by:
getAvailableSearchLevels in interface ServiceProfileLocator
Returns:
the number of search levels available

addServiceLocatorEventListener

public void addServiceLocatorEventListener(ServiceLocatorEventListener listener)
Sets a ServiceLocatorEventListener to be notified of events during search

Specified by:
addServiceLocatorEventListener in interface ServiceProfileLocator
Parameters:
listener - the ServiceLocatorEventListener to be set

removeServiceLocatorEventListener

public void removeServiceLocatorEventListener(ServiceLocatorEventListener listener)
Removes a previously set ServiceLocatorEventListener

Specified by:
removeServiceLocatorEventListener in interface ServiceProfileLocator
Parameters:
listener - the ServiceLocatorEventListener to be removed

setServiceProfileParameter

public void setServiceProfileParameter(ServiceProfileParameter searchParameter)
Sets the search parameter for subsequent calls to findServiceProfiles

Specified by:
setServiceProfileParameter in interface ServiceProfileLocator
Parameters:
searchParameter - the parameters the services shoud have