public class GeocodingRequest extends Object implements GetRequest<String,GeocodingResponse>
GeocodingRequest uses the ESRI webservice to request a coordinate candidates for one or more addresses.
Multiple requests can be made with one GeocodingRequest object.| Modifier and Type | Class and Description |
|---|---|
static class |
GeocodingRequest.Option
Special Geocoding request options that can be set at creation of the request.
|
| Constructor and Description |
|---|
GeocodingRequest(javax.ws.rs.client.Client client)
Creation of a default geo coding request without ESRI credentials (for batch requests slower than with credentials)
|
GeocodingRequest(javax.ws.rs.client.Client client,
ESRIAuthenticationDetails authenticationDetails)
Creation of a default geo coding request with ESRI credentials.
|
GeocodingRequest(javax.ws.rs.client.Client client,
ESRIAuthenticationDetails authenticationDetails,
Map<GeocodingRequest.Option,String> extraOptions)
Use a custom client implementation for the geo coding request with non-default request parameters and
ESRI credentials).
|
GeocodingRequest(javax.ws.rs.client.Client client,
Map<GeocodingRequest.Option,String> extraOptions)
Use a custom client implementation for the geo coding request with non-default request parameters and no
ESRI credentials)
|
| Modifier and Type | Method and Description |
|---|---|
GeocodingResponse |
get(Address address)
Invokes a simple request to geocode one address.
|
GeocodingResponse |
get(String singleLineAddress)
Invokes a simple request to geocode one address.
|
GeocodingResponse[] |
getBatchParallel(int parallelThreads,
int triesBeforeFail,
Address... addresses)
Facilitating a parallel batch request for geocoding multiple
Addresses. |
GeocodingResponse[] |
getBatchParallel(int parallelThreads,
int triesBeforeFail,
String... addresses)
Facilitating a parallel batch request for geocoding multiple addresses given as single String.
|
GeocodingResponse[] |
getBatchSequential(Address... addresses)
Facilitating a sequential batch request for geocoding multiple
Addresses. |
GeocodingResponse[] |
getBatchSequential(String... addresses)
Facilitating a sequential batch request for geocoding multiple addresses each given as single String.
|
String |
getCurrentAccessToken() |
public GeocodingRequest(javax.ws.rs.client.Client client)
Note1: The client's lifecycle is not handled here. Please make sure to properly close the client when not
needed anymore.
Note2: For the parallel batch requests it may be required to set a certain connection pool size when client is
created. (e.g. this was necessary for a JBoss client but not for the Jersey client)
client - specified Client implementation to be used, e.g. Jersey or jBoss clientpublic GeocodingRequest(javax.ws.rs.client.Client client,
Map<GeocodingRequest.Option,String> extraOptions)
Note1: The client's lifecycle is not handled here. Please make sure to properly close the client when not
needed anymore.
Note2: For the parallel batch requests it may be required to set a certain connection pool size when client is
created. (e.g. this was necessary for a JBoss client but not for the Jersey client)
client - specified Client implementation to be used, e.g. Jersey or jBoss clientextraOptions - see GeocodingRequest.Option for possibilities - null pointer and empty strings will be ignoredpublic GeocodingRequest(javax.ws.rs.client.Client client,
ESRIAuthenticationDetails authenticationDetails)
Note1: The client's lifecycle is not handled here. Please make sure to properly close the client when not
needed anymore.
Note2: For the parallel batch requests it may be required to set a certain connection pool size when client is
created. (e.g. this was necessary for a JBoss client but not for the Jersey client)
client - specified Client implementation to be used, e.g. Jersey or jBoss clientauthenticationDetails - the authentication details with which accessToken will be retrievedpublic GeocodingRequest(javax.ws.rs.client.Client client,
ESRIAuthenticationDetails authenticationDetails,
Map<GeocodingRequest.Option,String> extraOptions)
Note1: The client's lifecycle is not handled here. Please make sure to properly close the client when not
needed anymore.
Note2: For the parallel batch requests it may be required to set a certain connection pool size when client is
created. (e.g. this was necessary for a JBoss client but not for the Jersey client)
client - specified Client implementation to be used, e.g. Jersey or jBoss clientauthenticationDetails - the authentication details with which accessToken will be retrievedextraOptions - see GeocodingRequest.Option for possibilities - null pointer and empty strings will be ignoredpublic GeocodingResponse get(String singleLineAddress) throws Route360ClientException, javax.ws.rs.ProcessingException
String.get in interface GetRequest<String,GeocodingResponse>singleLineAddress - e.g. "Chausseestr. 101, 10115 Berlin"Route360ClientException - when error occurs during requestjavax.ws.rs.ProcessingException - when connection error occurspublic GeocodingResponse get(Address address) throws Route360ClientException, javax.ws.rs.ProcessingException
Address.
Empty or null fields will be ignored by the request.address - e.g. new Address("Chausseestr. 101","","Berlin","10115",null);Route360ClientException - when error occurs during requestjavax.ws.rs.ProcessingException - when connection error occurspublic GeocodingResponse[] getBatchParallel(int parallelThreads, int triesBeforeFail, String... addresses) throws Route360ClientException, javax.ws.rs.ProcessingException
ExecutorService with a specified thread pool size. These threads are used to request single geocoding
results in parallel. Due to temporal unavailability of the service the request may be repeated a number
of times before failing.parallelThreads - greater than or equal to 1 (==1 means sequential processing) - be careful to not create too many ThreadstriesBeforeFail - greater than or equal to 1addresses - not null and with at least on elementRoute360ClientException - when error occurs during requestjavax.ws.rs.ProcessingException - when connection error occursget(String)public GeocodingResponse[] getBatchParallel(int parallelThreads, int triesBeforeFail, Address... addresses) throws Route360ClientException, javax.ws.rs.ProcessingException
Addresses. It uses an
ExecutorService with a specified thread pool size. These threads are used to request single geocoding
results in parallel. Due to temporal unavailability of the service the request may be repeated a number
of times before failing.parallelThreads - greater than or equal to 1 (==1 means sequential processing) - be careful to not create too many ThreadstriesBeforeFail - greater than or equal to 1addresses - not null and with at least on elementRoute360ClientException - when error occurs during requestjavax.ws.rs.ProcessingException - when connection error occursget(Address)public GeocodingResponse[] getBatchSequential(String... addresses) throws Route360ClientException, javax.ws.rs.ProcessingException
addresses - not null and with at least on elementRoute360ClientException - when error occurs during requestjavax.ws.rs.ProcessingException - when connection error occursget(String)public GeocodingResponse[] getBatchSequential(Address... addresses) throws Route360ClientException, javax.ws.rs.ProcessingException
Addresses.addresses - not null and with at least on elementRoute360ClientException - when error occurs during requestjavax.ws.rs.ProcessingException - when connection error occursget(Address)public String getCurrentAccessToken()
Copyright © 2018. All rights reserved.