public class RemoteConnectorServiceImpl extends java.lang.Object implements RemoteConnectorService
RemoteConnectorService
, which
performs requests to remote HTTP servers.
Note - this class assumes direct connectivity is available to the destination
system, and does not support proxies.Constructor and Description |
---|
RemoteConnectorServiceImpl() |
Modifier and Type | Method and Description |
---|---|
RemoteConnectorRequest |
buildRequest(java.lang.String url,
java.lang.Class method)
Builds a new Request object, using HttpClient method descriptions
|
RemoteConnectorRequest |
buildRequest(java.lang.String url,
java.lang.String method)
Builds a new Request object
|
static org.json.simple.JSONObject |
doExecuteJSONRequest(RemoteConnectorRequest request,
RemoteConnectorService service) |
org.json.simple.JSONObject |
executeJSONRequest(RemoteConnectorRequest request)
Executes the given request, requesting a JSON response, and
returns the parsed JSON received back
|
RemoteConnectorResponse |
executeRequest(RemoteConnectorRequest request)
Executes the specified request, and return the response
|
public RemoteConnectorRequest buildRequest(java.lang.String url, java.lang.String method)
buildRequest
in interface RemoteConnectorService
public RemoteConnectorRequest buildRequest(java.lang.String url, java.lang.Class method)
public RemoteConnectorResponse executeRequest(RemoteConnectorRequest request) throws java.io.IOException, org.alfresco.repo.security.authentication.AuthenticationException, RemoteConnectorClientException, RemoteConnectorServerException
executeRequest
in interface RemoteConnectorService
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 requestpublic org.json.simple.JSONObject executeJSONRequest(RemoteConnectorRequest request) throws org.json.simple.parser.ParseException, java.io.IOException, org.alfresco.repo.security.authentication.AuthenticationException
executeJSONRequest
in interface RemoteConnectorService
org.json.simple.parser.ParseException
- If the response is not valid JSONjava.io.IOException
org.alfresco.repo.security.authentication.AuthenticationException
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
org.json.simple.parser.ParseException
java.io.IOException
org.alfresco.repo.security.authentication.AuthenticationException
Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.