public interface RouteCallback

Receives the outcome of a routing request. Exactly one method is invoked per request, always on the Codename One event dispatch thread, so it is safe to touch the UI directly from either one.

Methods

public abstract void routesFound(List routes)Delivers the routes found, best first.
public abstract void routeFailed(String message, Throwable error)Reports that no route could be produced – the network failed, the service rejected the request, or no road connects the points (routing across an ocean by car, for example).

Method details

routesFound

public abstract void routesFound(List routes)
Delivers the routes found, best first. The list holds at least one Route and only holds more when RouteRequest.setAlternatives asked for alternatives and the backend found some.

routeFailed

public abstract void routeFailed(String message, Throwable error)
Reports that no route could be produced – the network failed, the service rejected the request, or no road connects the points (routing across an ocean by car, for example).

Parameters

message String
a human readable explanation, never null
error Throwable
the underlying exception when one was thrown, or null when the failure carried none – a request rejected before it was sent, or an error status the service answered with. message stands on its own either way; error is there for logging and diagnostics.