Class RemoteConnectorServiceImpl
java.lang.Object
org.alfresco.repo.remoteconnector.RemoteConnectorServiceImpl
- All Implemented Interfaces:
RemoteConnectorService
HttpClient powered implementation of
RemoteConnectorService, which performs requests to remote HTTP servers.- Since:
- 4.0.2
- Author:
- Nick Burch
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuildRequest(String url, Class<? extends org.apache.commons.httpclient.HttpMethodBase> method) Builds a new Request object, using HttpClient method descriptionsbuildRequest(String url, String method) Builds a new Request objectstatic org.json.simple.JSONObjectdoExecuteJSONRequest(RemoteConnectorRequest request, RemoteConnectorService service) org.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
-
Constructor Details
-
RemoteConnectorServiceImpl
public RemoteConnectorServiceImpl()
-
-
Method Details
-
buildRequest
Builds a new Request object- Specified by:
buildRequestin interfaceRemoteConnectorService
-
buildRequest
public RemoteConnectorRequest buildRequest(String url, Class<? extends org.apache.commons.httpclient.HttpMethodBase> method) Builds a new Request object, using HttpClient method descriptions -
executeRequest
public RemoteConnectorResponse executeRequest(RemoteConnectorRequest request) throws IOException, AuthenticationException, RemoteConnectorClientException, RemoteConnectorServerException Executes the specified request, and return the response- Specified by:
executeRequestin interfaceRemoteConnectorService- 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
public org.json.simple.JSONObject executeJSONRequest(RemoteConnectorRequest request) throws org.json.simple.parser.ParseException, IOException, AuthenticationException Executes the given request, requesting a JSON response, and returns the parsed JSON received back- Specified by:
executeJSONRequestin interfaceRemoteConnectorService- Throws:
org.json.simple.parser.ParseException- If the response is not valid JSONIOExceptionAuthenticationException
-
doExecuteJSONRequest
public static org.json.simple.JSONObject doExecuteJSONRequest(RemoteConnectorRequest request, RemoteConnectorService service) throws org.json.simple.parser.ParseException, IOException, AuthenticationException - Throws:
org.json.simple.parser.ParseExceptionIOExceptionAuthenticationException
-