public class AnywhereConnector
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
protected static class |
AnywhereConnector.Builder
Builds an instance of an AnywhereConnector.
|
static class |
AnywhereConnector.RequestMethod
The HTTP method (or verb)
|
| Modifier and Type | Method and Description |
|---|---|
protected FssApiVersion |
getLatestCommonApiVersion()
Returns the latest
FssApiVersion that is supported by
both this client and the server. |
protected <T> T |
invokeNoBody(AnywhereConnector.RequestMethod method,
FssApiVersion apiVersion,
AuthToken auth,
java.lang.String path,
java.util.Map<java.lang.String,java.lang.String> parameters,
java.lang.Class<T> responseType)
Sends an HTTP request with no request body and returns the response body converted to an
object of type T.
|
protected <T> T |
invokeNoBody(AnywhereConnector.RequestMethod method,
FssApiVersion apiVersion,
AuthToken auth,
java.lang.String path,
java.util.Map<java.lang.String,java.lang.String> parameters,
java.io.OutputStream outputStream,
java.lang.Class<T> responseType,
java.lang.String responseHeaderKey)
Sends an HTTP request with no request body.
|
protected <T> T |
invokeWithFormData(AnywhereConnector.RequestMethod method,
FssApiVersion apiVersion,
java.lang.String username,
java.lang.String password,
java.lang.String path,
java.util.Map<java.lang.String,java.lang.String> parameters,
java.lang.String content,
java.lang.Class<T> responseType)
Sends an HTTP request that sends form data and returns the response body converted to an
object of type T.
|
protected <U> void |
invokeWithObject(AnywhereConnector.RequestMethod method,
FssApiVersion apiVersion,
AuthToken auth,
java.lang.String path,
java.util.Map<java.lang.String,java.lang.String> parameters,
U body)
Sends an HTTP request that sends a JSON string as the request body.
|
protected <U,T> T |
invokeWithObject(AnywhereConnector.RequestMethod method,
FssApiVersion apiVersion,
AuthToken auth,
java.lang.String path,
java.util.Map<java.lang.String,java.lang.String> parameters,
U body,
java.lang.Class<T> responseType)
Sends an HTTP request that sends a JSON string as the request body and returns the response
body converted to an object of type T.
|
protected <U,T> InputStreamResult<T> |
invokeWithObject(AnywhereConnector.RequestMethod method,
FssApiVersion apiVersion,
AuthToken auth,
java.lang.String path,
java.util.Map<java.lang.String,java.lang.String> parameters,
U body,
java.lang.Class<T> responseType,
java.lang.String responseHeaderKey)
Sends an HTTP request that sends a JSON string as the request body.
|
protected <U,T> T |
invokeWithObject(AnywhereConnector.RequestMethod method,
FssApiVersion apiVersion,
AuthToken auth,
java.lang.String path,
java.util.Map<java.lang.String,java.lang.String> parameters,
U body,
java.io.OutputStream outputStream,
java.lang.Class<T> responseType,
java.lang.String responseHeaderKey)
Sends an HTTP request that sends a JSON string as the request body.
|
protected <T> T |
invokeWithStream(AnywhereConnector.RequestMethod method,
FssApiVersion apiVersion,
AuthToken auth,
java.lang.String path,
java.util.Map<java.lang.String,java.lang.String> parameters,
java.io.InputStream content,
java.io.OutputStream outputStream,
java.lang.Class<T> responseType,
java.lang.String responseHeaderKey)
Sends an HTTP request that sends the contents of an InputStream as the request body.
|
protected <T> T |
invokeWithStream(AnywhereConnector.RequestMethod method,
FssApiVersion apiVersion,
AuthToken auth,
java.lang.String path,
java.util.Map<java.lang.String,java.lang.String> parameters,
java.lang.String ifMatch,
java.io.InputStream content,
java.lang.Class<T> responseType)
Sends an HTTP request that sends the contents of an InputStream as the request body and
returns the response body converted to an object of type T.
|
protected FssApiVersion getLatestCommonApiVersion()
FssApiVersion that is supported by
both this client and the server. If no communications have yet occurred with the server via
this AnywhereConnector, thereby rendering the latest common version unknown, then the latest
version supported by this client is returned.
Every time a request to the server is made via the methods of this AnywhereConnector, the
latest common API version may be updated.FssApiVersion that is
supported by both this client and the server, or the latest version supported by this
client if the server's supported versions is unknown.protected <T> T invokeWithFormData(AnywhereConnector.RequestMethod method, FssApiVersion apiVersion, java.lang.String username, java.lang.String password, java.lang.String path, java.util.Map<java.lang.String,java.lang.String> parameters, java.lang.String content, java.lang.Class<T> responseType) throws java.io.IOException, AnywhereException
method - the HTTP AnywhereConnector.RequestMethod to useapiVersion - the FssApiVersion to use for the
requestusername - username of user performing actionpassword - password for user performing actionpath - the endpoint to send the request to. Roughly equates to a URI. It does not
include the protocol, server or port.parameters - a Map from request parameter name to request parameter value. All entries
in the Map will be added to the HTTP request as request parameters.content - the content to send as the request body, using MediaType
MEDIA_TYPE_FORM_ENCODEDresponseType - the Class of the JSON bean to be returnedjava.io.IOExceptionAnywhereExceptionprotected <T> T invokeWithStream(AnywhereConnector.RequestMethod method, FssApiVersion apiVersion, AuthToken auth, java.lang.String path, java.util.Map<java.lang.String,java.lang.String> parameters, java.lang.String ifMatch, java.io.InputStream content, java.lang.Class<T> responseType) throws java.io.IOException, AnywhereException
method - the HTTP AnywhereConnector.RequestMethod to useapiVersion - the FssApiVersion to use for the
request, and corresponding to the version of the returned objectauth - authentication token for the user performing the requestpath - the endpoint to send the request to. Roughly equates to a URI. It does not
include the protocol, server or port.parameters - a Map from request parameter name to request parameter value. All entries
in the Map will be added to the HTTP request as request parameters.ifMatch - the etag to be sent in the "If-Match" request headercontent - The contents of this InputStream will be sent as the request body.responseType - the Class of the JSON bean to be returnedjava.io.IOExceptionAnywhereExceptionprotected <T> T invokeWithStream(AnywhereConnector.RequestMethod method, FssApiVersion apiVersion, AuthToken auth, java.lang.String path, java.util.Map<java.lang.String,java.lang.String> parameters, java.io.InputStream content, java.io.OutputStream outputStream, java.lang.Class<T> responseType, java.lang.String responseHeaderKey) throws java.io.IOException, AnywhereException
method - the HTTP AnywhereConnector.RequestMethod to useapiVersion - the FssApiVersion to use for the
request, and corresponding to the version of the returned objectauth - authentication token for the user performing the requestpath - the endpoint to send the request to. Roughly equates to a URI. It does not
include the protocol, server or port.parameters - a Map from request parameter name to request parameter value. All entries
in the Map will be added to the HTTP request as request parameters.content - The contents of this InputStream will be sent as the request body.outputStream - The response body will be written to this OutputStream.responseType - the Class of the JSON bean to be returnedresponseHeaderKey - the name (key) of the response header in which the JSON of type
responseType will be returnedjava.io.IOExceptionAnywhereExceptionprotected <U,T> T invokeWithObject(AnywhereConnector.RequestMethod method, FssApiVersion apiVersion, AuthToken auth, java.lang.String path, java.util.Map<java.lang.String,java.lang.String> parameters, U body, java.lang.Class<T> responseType) throws java.io.IOException, AnywhereException
method - the HTTP AnywhereConnector.RequestMethod to useapiVersion - the FssApiVersion to use for the
request, and corresponding to the version of the supplied body object and the
returned objectauth - authentication token for the user performing the requestpath - the endpoint to send the request to. Roughly equates to a URI. It does not
include the protocol, server or port.parameters - a Map from request parameter name to request parameter value. All entries
in the Map will be added to the HTTP request as request parameters.body - the JSON bean to be sent as the request body. Will be converted to a JSON String.responseType - the Class of the JSON bean to be returnedjava.io.IOExceptionAnywhereExceptionprotected <U> void invokeWithObject(AnywhereConnector.RequestMethod method, FssApiVersion apiVersion, AuthToken auth, java.lang.String path, java.util.Map<java.lang.String,java.lang.String> parameters, U body) throws java.io.IOException, AnywhereException
method - the HTTP AnywhereConnector.RequestMethod to useapiVersion - the FssApiVersion to use for the
request, and corresponding to the version of the supplied body objectauth - authentication token for the user performing the requestpath - the endpoint to send the request to. Roughly equates to a URI. It does not
include the protocol, server or port.parameters - a Map from request parameter name to request parameter value. All entries
in the Map will be added to the HTTP request as request parameters.body - the JSON bean to be sent as the request body. Will be converted to a JSON String.java.io.IOExceptionAnywhereExceptionprotected <U,T> T invokeWithObject(AnywhereConnector.RequestMethod method, FssApiVersion apiVersion, AuthToken auth, java.lang.String path, java.util.Map<java.lang.String,java.lang.String> parameters, U body, java.io.OutputStream outputStream, java.lang.Class<T> responseType, java.lang.String responseHeaderKey) throws java.io.IOException, AnywhereException
method - the HTTP AnywhereConnector.RequestMethod to useapiVersion - the FssApiVersion to use for the
request, and corresponding to the version of the supplied body object and the
returned objectauth - authentication token for the user performing the requestpath - the endpoint to send the request to. Roughly equates to a URI. It does not
include the protocol, server or port.parameters - a Map from request parameter name to request parameter value. All entries
in the Map will be added to the HTTP request as request parameters.body - the JSON bean to be sent as the request body. Will be converted to a JSON String.outputStream - The response body will be written to this OutputStream.responseType - the Class of the JSON bean to be returnedresponseHeaderKey - the name (key) of the response header in which the JSON of type
responseType will be returnedjava.io.IOExceptionAnywhereExceptionprotected <U,T> InputStreamResult<T> invokeWithObject(AnywhereConnector.RequestMethod method, FssApiVersion apiVersion, AuthToken auth, java.lang.String path, java.util.Map<java.lang.String,java.lang.String> parameters, U body, java.lang.Class<T> responseType, java.lang.String responseHeaderKey) throws java.io.IOException, AnywhereException
method - the HTTP AnywhereConnector.RequestMethod to useapiVersion - the FssApiVersion to use for the
request, and corresponding to the version of the supplied body object and the
returned objectauth - authentication token for the user performing the requestpath - the endpoint to send the request to. Roughly equates to a URI. It does not
include the protocol, server or port.parameters - a Map from request parameter name to request parameter value. All entries
in the Map will be added to the HTTP request as request parameters.body - the JSON bean to be sent as the request body. Will be converted to a JSON String.responseType - the Class of the JSON bean returned in a headerresponseHeaderKey - the name (key) of the response header in which the JSON of type
responseType will be returnedjava.io.IOExceptionAnywhereExceptionprotected <T> T invokeNoBody(AnywhereConnector.RequestMethod method, FssApiVersion apiVersion, AuthToken auth, java.lang.String path, java.util.Map<java.lang.String,java.lang.String> parameters, java.io.OutputStream outputStream, java.lang.Class<T> responseType, java.lang.String responseHeaderKey) throws java.io.IOException, AnywhereException
method - the HTTP AnywhereConnector.RequestMethod to useapiVersion - the FssApiVersion to use for the
request, and corresponding to the version of the returned objectauth - authentication token for the user performing the requestpath - the endpoint to send the request to. Roughly equates to a URI. It does not
include the protocol, server or port.parameters - a Map from request parameter name to request parameter value. All entries
in the Map will be added to the HTTP request as request parameters.outputStream - The response body will be written to this OutputStream.responseType - the Class of the JSON bean to be returnedresponseHeaderKey - the name (key) of the response header in which the JSON of type
responseType will be returnedjava.io.IOExceptionAnywhereExceptionprotected <T> T invokeNoBody(AnywhereConnector.RequestMethod method, FssApiVersion apiVersion, AuthToken auth, java.lang.String path, java.util.Map<java.lang.String,java.lang.String> parameters, java.lang.Class<T> responseType) throws java.io.IOException, AnywhereException
method - the HTTP AnywhereConnector.RequestMethod to useapiVersion - the FssApiVersion to use for the
request, and corresponding to the version of the returned objectauth - authentication token for the user performing the requestpath - the endpoint to send the request to. Roughly equates to a URI. It does not
include the protocol, server or port.parameters - a Map from request parameter name to request parameter value. All entries
in the Map will be added to the HTTP request as request parameters.responseType - the Class of the JSON bean to be returnedjava.io.IOExceptionAnywhereException