Class HttpQueryEvaluator

java.lang.Object
fr.inria.rules.integraal.storage.external.evaluator.HttpQueryEvaluator
All Implemented Interfaces:
NativeQueryEvaluator<String,String>

public class HttpQueryEvaluator extends Object implements NativeQueryEvaluator<String,String>
Sends an HTTP query. This evaluator uses java.net's HttpRequest to send the query. The result is a String which represents the results according to the queried service * This will often represent raw HTML or JSON data.
  • Constructor Details

    • HttpQueryEvaluator

      public HttpQueryEvaluator(String username, String password)
      Construct a new evaluator which will used the given credentials
      Parameters:
      username - the user login name
      password - the user login password
  • Method Details

    • evaluate

      public Optional<String> evaluate(String query)
      Description copied from interface: NativeQueryEvaluator
      Evaluate the given query and returns the result This should not do anymore work
      Specified by:
      evaluate in interface NativeQueryEvaluator<String,String>
      Parameters:
      query - to evaluate
      Returns:
      an optional which contains the results of the query if everything went right, an empty optional otherwise