Interface RemoteConnectorService
- All Known Implementing Classes:
RemoteConnectorServiceImpl
public interface RemoteConnectorService
Helper Service for performing remote web requests from within the repository tier.
The default implementation of the service works with HttpClient internally, but other implementations (such as testing loopback) can be used.
- Since:
- 4.0.2
- Author:
- Nick Burch
-
Method Summary
Modifier and TypeMethodDescriptionbuildRequest(String url, String method) Builds a new Request object, to talk to the given URL with the supplied methodorg.json.simple.JSONObjectexecuteJSONRequest(RemoteConnectorRequest request) Executes the given request, requesting a JSON response, and returns the parsed JSON received backexecuteRequest(RemoteConnectorRequest request) Executes the specified request, and return the response.
-
Method Details
-
buildRequest
Builds a new Request object, to talk to the given URL with the supplied method -
executeRequest
RemoteConnectorResponse executeRequest(RemoteConnectorRequest request) throws IOException, AuthenticationException, RemoteConnectorClientException, RemoteConnectorServerException Executes the specified request, and return the response.- Throws:
IOException- If there was a problem with the communication to the serverAuthenticationException- If the authentication details supplied were not acceptedRemoteConnectorClientException- If the server indicates the client request was invalidRemoteConnectorServerException- If the server was itself unable to perform the request
-
executeJSONRequest
org.json.simple.JSONObject executeJSONRequest(RemoteConnectorRequest request) throws IOException, AuthenticationException, org.json.simple.parser.ParseException Executes the given request, requesting a JSON response, and returns the parsed JSON received back- Throws:
org.json.simple.parser.ParseException- If the response is not valid JSONIOExceptionAuthenticationException
-