Class RemoteConnectorServiceImpl
- java.lang.Object
-
- org.alfresco.repo.remoteconnector.RemoteConnectorServiceImpl
-
- All Implemented Interfaces:
RemoteConnectorService
public class RemoteConnectorServiceImpl extends java.lang.Object implements RemoteConnectorService
HttpClient powered implementation ofRemoteConnectorService, which performs requests to remote HTTP servers.- Since:
- 4.0.2
- Author:
- Nick Burch
-
-
Constructor Summary
Constructors Constructor Description RemoteConnectorServiceImpl()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description RemoteConnectorRequestbuildRequest(java.lang.String url, java.lang.Class<? extends org.apache.commons.httpclient.HttpMethodBase> method)Builds a new Request object, using HttpClient method descriptionsRemoteConnectorRequestbuildRequest(java.lang.String url, java.lang.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 backRemoteConnectorResponseexecuteRequest(RemoteConnectorRequest request)Executes the specified request, and return the response
-
-
-
Method Detail
-
buildRequest
public RemoteConnectorRequest buildRequest(java.lang.String url, java.lang.String method)
Builds a new Request object- Specified by:
buildRequestin interfaceRemoteConnectorService
-
buildRequest
public RemoteConnectorRequest buildRequest(java.lang.String url, java.lang.Class<? extends org.apache.commons.httpclient.HttpMethodBase> method)
Builds a new Request object, using HttpClient method descriptions
-
executeRequest
public RemoteConnectorResponse executeRequest(RemoteConnectorRequest request) throws java.io.IOException, org.alfresco.repo.security.authentication.AuthenticationException, RemoteConnectorClientException, RemoteConnectorServerException
Executes the specified request, and return the response- Specified by:
executeRequestin interfaceRemoteConnectorService- Throws:
java.io.IOException- If there was a problem with the communication to the serverorg.alfresco.repo.security.authentication.AuthenticationException- 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, java.io.IOException, org.alfresco.repo.security.authentication.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 JSONjava.io.IOExceptionorg.alfresco.repo.security.authentication.AuthenticationException
-
doExecuteJSONRequest
public static org.json.simple.JSONObject doExecuteJSONRequest(RemoteConnectorRequest request, RemoteConnectorService service) throws org.json.simple.parser.ParseException, java.io.IOException, org.alfresco.repo.security.authentication.AuthenticationException
- Throws:
org.json.simple.parser.ParseExceptionjava.io.IOExceptionorg.alfresco.repo.security.authentication.AuthenticationException
-
-