Class GeoLocation.ResponseFilter

java.lang.Object
net.sf.basedb.util.GeoLocation.ResponseFilter
All Implemented Interfaces:
AbsoluteProgressReporter, ProgressReporter, Filter<org.apache.http.HttpResponse>
Enclosing class:
GeoLocation

static class GeoLocation.ResponseFilter
extends Object
implements Filter<org.apache.http.HttpResponse>, AbsoluteProgressReporter
We only accept "200" status response, "application/json" content type and not more than 1K bytes (should be a lot less under normal operations).
  • Constructor Details

    • ResponseFilter

      ResponseFilter()
  • Method Details

    • evaluate

      public boolean evaluate​(org.apache.http.HttpResponse response)
      Description copied from interface: Filter
      Evaluate if the given object should pass the filter or not.
      Specified by:
      evaluate in interface Filter<org.apache.http.HttpResponse>
      Parameters:
      response - The object to evaluate
      Returns:
      TRUE if the object passes the filter, FALSE otherwise
    • display

      public void display​(int percent, String message)
      Description copied from interface: ProgressReporter
      Display a progress message.
      Specified by:
      display in interface ProgressReporter
      Parameters:
      percent - How many percent of the task that is completed or -1 if not known
      message - A message, or null
    • append

      public void append​(String message)
      Description copied from interface: ProgressReporter
      Append a message to the previous one.
      Specified by:
      append in interface ProgressReporter
      Parameters:
      message - The message
    • displayAbsolute

      public void displayAbsolute​(long completed, String message)
      Description copied from interface: AbsoluteProgressReporter
      Display a progress message.
      Specified by:
      displayAbsolute in interface AbsoluteProgressReporter
      Parameters:
      completed - The progress of the task
      message - A message, or null