com.veriplace.client
Interface LocationFilter

All Known Implementing Classes:
DefaultLocationFilter

public interface LocationFilter

Interface for an object that can apply post-processing to returned locations. If present, GetLocationAPI passes all new locations returned by the server through this filter.

Since:
2.1

Method Summary
 Location filterLocation(Location returnedLocation, PositionFailureException returnedException)
          Transforms the result of a location request.
 

Method Detail

filterLocation

Location filterLocation(Location returnedLocation,
                        PositionFailureException returnedException)
                        throws GetLocationException
Transforms the result of a location request. If this method returns null, the filter has no effect. If it returns a location object, that becomes the return value of the location request, even if the request would normally have failed. It can also throw a different exception, regardless of whether the request would normally have failed or succeeded.

Parameters:
returnedLocation - the valid location returned by the server, or null if an error occurred
returnedException - the exception that would normally be thrown if an error occurred
Returns:
a new location to return; null to keep the original location, or to throw the original exception if there was an exception
Throws:
GetLocationException - if the location request should fail