org.processmining.framework.models.recommendation.test
Class TestProvider

java.lang.Object
  extended by org.processmining.framework.models.recommendation.test.TestProvider
All Implemented Interfaces:
RecommendationProvider

public class TestProvider
extends java.lang.Object
implements RecommendationProvider


Constructor Summary
TestProvider()
           
 
Method Summary
 RecommendationResult getRecommendation(RecommendationQuery query)
          This is the main query method, which can be used to retrieve recommendations for specific queries.
 void signalPickedResult(RecommendationResult result, int index)
          This method may be used to let the recommendation provider know, which of the provided results has been picked by the requesting party finally.
 void signalPickedResult(RecommendationResult result, Recommendation picked)
          This method may be used to let the recommendation provider know, which of the provided results has been picked by the requesting party finally.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestProvider

public TestProvider()
Method Detail

getRecommendation

public RecommendationResult getRecommendation(RecommendationQuery query)
                                       throws java.lang.Exception,
                                              java.io.IOException
Description copied from interface: RecommendationProvider

This is the main query method, which can be used to retrieve recommendations for specific queries. All communication and encoding of parameters can be assumed to be performed in subclasses implementing this interface.

Note: This method may block for an unspecified time, including network transport and resolving the query on the provider side. Use this method in a separate thread if you wish your application to remain responsive.
Also note that the query can fail, both due to transmission errors (which will yield an IOException, and due to the provider's inability to resolve the query (i.e., an error occurred while handling the issued request, signaled by an ordinary Exception being thrown; or, the query did not yield any usable result, which results in a null response value.

Specified by:
getRecommendation in interface RecommendationProvider
Parameters:
query - The query for recommendations.
Returns:
The resulting set of recommendations (correlated with the issued query), or null, of no result could be obtained (may also be empty result list).
Throws:
java.lang.Exception - Signals an error in the recommendation provider implementation.
java.io.IOException - Signals an error due to network transport problems.

signalPickedResult

public void signalPickedResult(RecommendationResult result,
                               int index)
Description copied from interface: RecommendationProvider

This method may be used to let the recommendation provider know, which of the provided results has been picked by the requesting party finally. The provider will use this information for logging purposes, or to improve future results.

Specified by:
signalPickedResult in interface RecommendationProvider
Parameters:
result - The result set which has been delivered earlier on.
index - Index of the result which has been picked for usage in the result set. If the given index is negative, the semantics are that the requesting party has picked neither of the provided recommendations, i.e. ignored them or found them not useful.

signalPickedResult

public void signalPickedResult(RecommendationResult result,
                               Recommendation picked)
Description copied from interface: RecommendationProvider

This method may be used to let the recommendation provider know, which of the provided results has been picked by the requesting party finally. The provider will use this information for logging purposes, or to improve future results.

Specified by:
signalPickedResult in interface RecommendationProvider
Parameters:
result - The result set which has been delivered earlier on.