Package com.targomo.client.api.request
Class ReachabilityRequest
java.lang.Object
com.targomo.client.api.request.ReachabilityRequest
Calculates travel time for each source point to all targets.
Only accepts
HttpMethod POST.-
Constructor Summary
ConstructorsConstructorDescriptionReachabilityRequest(TravelOptions travelOptions) Use default client implementation with specified options and method Default client usesClientBuilder.ReachabilityRequest(javax.ws.rs.client.Client client, TravelOptions travelOptions) Use a custom client implementation with specified options and methodReachabilityRequest(javax.ws.rs.client.Client client, TravelOptions travelOptions, javax.ws.rs.core.MultivaluedMap<String, Object> headers) Use a custom client implementation with specified options and method -
Method Summary
Modifier and TypeMethodDescriptionget()Execute requestExecute request If cached targets are used that are shared among multiple statistics it may be necessary to filter the targets and map their ids.
-
Constructor Details
-
ReachabilityRequest
Use default client implementation with specified options and method Default client usesClientBuilder.- Parameters:
travelOptions- Options to be used
-
ReachabilityRequest
Use a custom client implementation with specified options and method- Parameters:
client- Client implementation to be usedtravelOptions- Options to be used
-
ReachabilityRequest
public ReachabilityRequest(javax.ws.rs.client.Client client, TravelOptions travelOptions, javax.ws.rs.core.MultivaluedMap<String, Object> headers) Use a custom client implementation with specified options and method- Parameters:
client- Client implementation to be usedtravelOptions- Options to be usedheaders- List of custom http headers to be used
-
-
Method Details
-
get
Execute request- Returns:
- Reachability response
- Throws:
TargomoClientException- In case of error other than Gateway TimeoutResponseErrorException
-
get
public ReachabilityResponse get(java.util.function.Function<String, String> targetIdMapperFilter) throws TargomoClientException, ResponseErrorExceptionExecute request If cached targets are used that are shared among multiple statistics it may be necessary to filter the targets and map their ids. To improve performance this can be done while parsing the response by passing a mapper/filter function.- Parameters:
targetIdMapperFilter- a function that maps the target id to a different value or filters targets by returning null.- Returns:
- Reachability response
- Throws:
TargomoClientException- In case of error other than Gateway TimeoutResponseErrorException
-