public interface GatewayRestServices
extends java.io.Serializable
Modifier and Type | Method and Description |
---|---|
RestResponse |
delete(java.lang.String gatewayId,
java.lang.String endpoint)
Performs a REST HTTP DELETE call and returns the HTTP response code.
|
RestResponse |
delete(java.lang.String gatewayId,
java.lang.String endpoint,
java.util.Map<java.lang.String,java.lang.Object> headers,
java.util.Map<java.lang.String,java.lang.Object> parameters)
Performs a REST HTTP DELETE call and returns the HTTP response code.
|
RestResponse |
delete(java.lang.String gatewayId,
java.lang.String endpoint,
java.util.Map<java.lang.String,java.lang.Object> headers,
java.util.Map<java.lang.String,java.lang.Object> parameters,
RestOptions options)
Performs a REST HTTP DELETE call and returns the HTTP response code.
|
RestResponse |
get(java.lang.String gatewayId,
java.lang.String endpoint)
Performs a REST HTTP GET call and returns a
RestResponse representing the response. |
RestResponse |
get(java.lang.String gatewayId,
java.lang.String endpoint,
java.util.Map<java.lang.String,java.lang.Object> headers,
java.util.Map<java.lang.String,java.lang.Object> parameters)
Performs a REST HTTP GET call supplying any request headers and/or parameters.
|
RestResponse |
get(java.lang.String gatewayId,
java.lang.String endpoint,
java.util.Map<java.lang.String,java.lang.Object> headers,
java.util.Map<java.lang.String,java.lang.Object> parameters,
RestOptions options)
Performs a REST HTTP GET call supplying any request headers and/or parameters.
|
RestResponse |
head(java.lang.String gatewayId,
java.lang.String endpoint)
Performs a REST HTTP HEAD call on a resource.
|
RestResponse |
head(java.lang.String gatewayId,
java.lang.String endpoint,
java.util.Map<java.lang.String,java.lang.Object> headers,
java.util.Map<java.lang.String,java.lang.Object> parameters)
Performs a REST HTTP HEAD call on a resource.
|
RestResponse |
head(java.lang.String gatewayId,
java.lang.String endpoint,
java.util.Map<java.lang.String,java.lang.Object> headers,
java.util.Map<java.lang.String,java.lang.Object> parameters,
RestOptions options)
Performs a REST HTTP HEAD call on a resource.
|
RestResponse |
patch(java.lang.String gatewayId,
java.lang.String endpoint,
java.lang.String body)
Performs a REST HTTP PATCH call.
|
RestResponse |
patch(java.lang.String gatewayId,
java.lang.String endpoint,
java.lang.String body,
java.util.Map<java.lang.String,java.lang.Object> headers,
java.util.Map<java.lang.String,java.lang.Object> parameters)
Performs a REST HTTP PATCH call supplying any headers and/or parameters required.
|
RestResponse |
patch(java.lang.String gatewayId,
java.lang.String endpoint,
java.lang.String body,
java.util.Map<java.lang.String,java.lang.Object> headers,
java.util.Map<java.lang.String,java.lang.Object> parameters,
RestOptions options)
Performs a REST HTTP PATCH call supplying any headers and/or parameters required.
|
RestResponse |
post(java.lang.String gatewayId,
java.lang.String endpoint,
java.lang.String body)
Performs a REST HTTP POST call.
|
RestResponse |
post(java.lang.String gatewayId,
java.lang.String endpoint,
java.lang.String body,
java.util.Map<java.lang.String,java.lang.Object> headers,
java.util.Map<java.lang.String,java.lang.Object> parameters)
Performs a REST HTTP POST call supplying any headers and/or parameters required.
|
RestResponse |
post(java.lang.String gatewayId,
java.lang.String endpoint,
java.lang.String body,
java.util.Map<java.lang.String,java.lang.Object> headers,
java.util.Map<java.lang.String,java.lang.Object> parameters,
RestOptions options)
Performs a REST HTTP POST call supplying any headers and/or parameters required.
|
RestResponse |
put(java.lang.String gatewayId,
java.lang.String endpoint,
java.lang.String body)
Performs a REST HTTP PUT call.
|
RestResponse |
put(java.lang.String gatewayId,
java.lang.String endpoint,
java.lang.String body,
java.util.Map<java.lang.String,java.lang.Object> headers,
java.util.Map<java.lang.String,java.lang.Object> parameters)
Performs a REST HTTP PUT call supplying any headers and/or parameters required.
|
RestResponse |
put(java.lang.String gatewayId,
java.lang.String endpoint,
java.lang.String body,
java.util.Map<java.lang.String,java.lang.Object> headers,
java.util.Map<java.lang.String,java.lang.Object> parameters,
RestOptions options)
Performs a REST HTTP PUT call supplying any headers and/or parameters required.
|
RestResponse get(java.lang.String gatewayId, java.lang.String endpoint)
RestResponse
representing the response. A GET is a read only call.
RestResponse
contains the following data:
Example:
var response = gateway.rest.get("myGateway", "/users"); if(response.isSuccess()) { var results = JSON.parse(response.getBody()); if(results) { //populate results using the JSON object populateResults(results); } }Further documentation.
gatewayId
- the full URI of the requestendpoint
- path to invokeRestResponse
,
get(String, String, Map, Map)
RestResponse get(java.lang.String gatewayId, java.lang.String endpoint, java.util.Map<java.lang.String,java.lang.Object> headers, java.util.Map<java.lang.String,java.lang.Object> parameters)
RestResponse
representing the response.
A GET is a read only call.
RestResponse
contains the following data:
Example:
var gatewayId = "myGateway"; //set any headers var headers = {"Content-Type":"application/json", "Accept":"application/json"}; //set params var params = {"userId":fields.filter.value}; var response = services.rest.get(gatewayId, "/users", headers, params); if(response.isSuccess()) { var results = JSON.parse(response.getBody()); if(results) { //populate results using the JSON object populateResults(results); } }Further documentation.
gatewayId
- the full URI of the requestendpoint
- path to invokeheaders
- Map of HTTP request headersparameters
- Map of HTTP request query parametersRestResponse
,
get(String, String, Map, Map, RestOptions)
RestResponse get(java.lang.String gatewayId, java.lang.String endpoint, java.util.Map<java.lang.String,java.lang.Object> headers, java.util.Map<java.lang.String,java.lang.Object> parameters, RestOptions options)
RestResponse
representing the response.
A GET is a read only call.
RestResponse
contains the following data:
Example:
var gatewayId = "myGateway"; //set any headers var headers = {"Content-Type":"application/json", "Accept":"application/json"}; //set params var params = {"userId":fields.filter.value}; var opts = new RestOptions(); //setting the wait time to establish a connection to the target server to 5 seconds opts.setConnectionTimeout(5); //set the time to wait for no inactivity from the rest call to 10 seconds opts.setSocketTimeout(10); //set UTF-8 character set when decoding the response opts.setResponseCharset("UTF-8"); var response = services.rest.get(gatewayId, "/users", headers, params, opts); if(response.isSuccess()) { var results = JSON.parse(response.getBody()); if(results) { //populate results using the JSON object populateResults(results); } }Further documentation.
gatewayId
- the full URI of the requestendpoint
- path to invokeheaders
- Map of HTTP request headersparameters
- Map of HTTP request query parametersoptions
- rest configuration options RestOptions
RestResponse
,
get(String, String)
,
get(String, String, Map, Map)
RestResponse post(java.lang.String gatewayId, java.lang.String endpoint, java.lang.String body)
RestResponse
representing the response. A POST is used to insert a new resource
or can also create a new one if one does not exist.
RestResponse
contains the following data:
Example:
var user = {}; user.userId = 1; user.title = 'foo'; user.body = 'bar'; var response = services.rest.post("myGateway", "/update/user", JSON.stringify(user)); if(response.isSuccess()) { var result = JSON.parse(response.getBody()); if(result) { //populate response using the JSON object displayResult(result); } }Further documentation.
gatewayId
- the full URI of the requestendpoint
- path to invokebody
- String representation of the HTTP body for the requestRestResponse
,
post(String, String, String, Map, Map)
RestResponse post(java.lang.String gatewayId, java.lang.String endpoint, java.lang.String body, java.util.Map<java.lang.String,java.lang.Object> headers, java.util.Map<java.lang.String,java.lang.Object> parameters)
RestResponse
representing the response.
A POST is used to insert a new resource or can also create a new one if one does not exist.
RestResponse
contains the following data:
Example:
var user = {}; user.userId = 1; user.title = 'foo'; user.body = 'bar'; //set any headers var headers = {"Content-Type":"application/json", "Accept":"application/json"}; //set params var params = {"userId":fields.filter.value}; var response = services.rest.post("myGateway", "/update/users", JSON.stringify(user), headers, params); if(response.isSuccess()) { var result = JSON.parse(response.getBody()); if(result) { //populate response using the JSON object displayResult(result); } }Further documentation.
gatewayId
- the full URI of the requestendpoint
- path to invokebody
- String representation of the HTTP body for the requestheaders
- Map of HTTP request headersparameters
- Map of HTTP request query parametersRestResponse
,
post(String, String, String, Map, Map, RestOptions)
RestResponse post(java.lang.String gatewayId, java.lang.String endpoint, java.lang.String body, java.util.Map<java.lang.String,java.lang.Object> headers, java.util.Map<java.lang.String,java.lang.Object> parameters, RestOptions options)
RestResponse
representing the response.
A POST is used to insert a new resource or can also create a new one if one does not exist.
RestResponse
contains the following data:
Example:
var user = {}; user.userId = 1; user.title = 'foo'; user.body = 'bar'; //set any headers var headers = {"Content-Type":"application/json", "Accept":"application/json"}; //set params var params = {"userId":fields.filter.value}; var opts = new RestOptions(); //setting the wait time to establish a connection to the target server to 5 seconds opts.setConnectionTimeout(5); //set the time to wait for no inactivity from the rest call to 10 seconds opts.setSocketTimeout(10); var response = services.rest.post("myGateway", "/update/users", JSON.stringify(user), headers, params, opts); if(response.isSuccess()) { var result = JSON.parse(response.getBody()); if(result) { //populate response using the JSON object displayResult(result); } }Further documentation.
gatewayId
- the full URI of the requestendpoint
- path to invokebody
- String representation of the HTTP body for the requestheaders
- Map of HTTP request headersparameters
- Map of HTTP request query parametersoptions
- rest configuration options RestOptions
RestResponse
,
post(String, String, String)
,
patch(String, String, String, Map, Map)
RestResponse patch(java.lang.String gatewayId, java.lang.String endpoint, java.lang.String body)
RestResponse
representing the response. A PATCH call should be
used for a partial update to a resource.
RestResponse
contains the following data:
Example:
var user = {}; user.title = 'foo'; var response = services.rest.patch("myGateway", "update/users", JSON.stringify(user)); if(response.isSuccess()) { var result = JSON.parse(response.getBody()); if(result) { //populate response using the JSON object displayResult(result); } }Further documentation.
gatewayId
- the full URI of the requestendpoint
- path to invokebody
- String representation of the HTTP body for the requestRestResponse
,
patch(String, String, String, Map, Map)
RestResponse patch(java.lang.String gatewayId, java.lang.String endpoint, java.lang.String body, java.util.Map<java.lang.String,java.lang.Object> headers, java.util.Map<java.lang.String,java.lang.Object> parameters)
RestResponse
representing the response.
A PATCH call should be used for a partial update to a resource.
RestResponse
contains the following data:
Example:
var user = {}; user.title = 'foo'; //set any headers var headers = {"Content-Type":"application/json", "Accept":"application/json"}; //set params var params = {"userId":fields.filter.value}; var response = services.rest.patch("myGateway", "/update/users", JSON.stringify(user), headers, params); if(response.isSuccess()) { var result = JSON.parse(response.getBody()); if(result) { //populate response using the JSON object displayResult(result); } }Further documentation.
gatewayId
- the full URI of the requestendpoint
- path to invokebody
- String representation of the HTTP body for the requestheaders
- Map of HTTP request headersparameters
- Map of HTTP request query parametersRestResponse
,
patch(String, String, String, Map, Map, RestOptions)
RestResponse patch(java.lang.String gatewayId, java.lang.String endpoint, java.lang.String body, java.util.Map<java.lang.String,java.lang.Object> headers, java.util.Map<java.lang.String,java.lang.Object> parameters, RestOptions options)
RestResponse
representing the response.
A PATCH call should be used for a partial update to a resource.
RestResponse
contains the following data:
Example:
var user = {}; user.title = 'foo'; //set any headers var headers = {"Content-Type":"application/json", "Accept":"application/json"}; //set params var params = {"userId":fields.filter.value}; var opts = new RestOptions(); //setting the wait time to establish a connection to the target server to 5 seconds opts.setConnectionTimeout(5); //set the time to wait for no inactivity from the rest call to 10 seconds opts.setSocketTimeout(10); var response = services.rest.patch("myGateway", "/update/users", JSON.stringify(user), headers, params, opts); if(response.isSuccess()) { var result = JSON.parse(response.getBody()); if(result) { //populate response using the JSON object displayResult(result); } }Further documentation.
gatewayId
- the full URI of the requestendpoint
- path to invokebody
- String representation of the HTTP body for the requestheaders
- Map of HTTP request headersparameters
- Map of HTTP request query parametersoptions
- rest configuration options RestOptions
RestResponse
,
patch(String, String, String)
,
patch(String, String, String, Map, Map)
RestResponse put(java.lang.String gatewayId, java.lang.String endpoint, java.lang.String body)
RestResponse
representing the response. A PUT is used to insert a new resource
or update an existing one.
RestResponse
contains the following data:
Example:
var user = {}; user.userId = 1; user.title = 'foo'; user.body = 'bar'; var response = services.rest.put("myGateway", "/update/user", JSON.stringify(user)); if(response.isSuccess()) { var result = JSON.parse(response.getBody()); if(result) { //populate response using the JSON object displayResult(result); } }Further documentation.
gatewayId
- the full URI of the requestendpoint
- path to invokebody
- String representation of the HTTP body for the requestRestResponse
,
put(String, String, String, Map, Map)
RestResponse put(java.lang.String gatewayId, java.lang.String endpoint, java.lang.String body, java.util.Map<java.lang.String,java.lang.Object> headers, java.util.Map<java.lang.String,java.lang.Object> parameters)
RestResponse
representing the response.
A PUT is used to insert a new resource or update an existing one.
RestResponse
contains the following data:
Example:
var user = {}; user.userId = 1; user.title = 'foo'; user.body = 'bar'; //set any headers var headers = {"Content-Type":"application/json", "Accept":"application/json"}; //set params var params = {"userId":fields.filter.value}; var response = services.rest.put("myGateway", "/update/user", JSON.stringify(user), headers, params); if(response.isSuccess()) { var result = JSON.parse(response.getBody()); if(result) { //populate response using the JSON object displayResult(result); } }Further documentation.
gatewayId
- the full URI of the requestendpoint
- path to invokebody
- String representation of the HTTP body for the requestheaders
- Map of HTTP request headersparameters
- Map of HTTP request query parametersRestResponse
,
put(String, String, String, Map, Map, RestOptions)
RestResponse put(java.lang.String gatewayId, java.lang.String endpoint, java.lang.String body, java.util.Map<java.lang.String,java.lang.Object> headers, java.util.Map<java.lang.String,java.lang.Object> parameters, RestOptions options)
RestResponse
representing the response.
A PUT is used to insert a new resource or update an existing one.
RestResponse
contains the following data:
Example:
var user = {}; user.userId = 1; user.title = 'foo'; user.body = 'bar'; //set any headers var headers = {"Content-Type":"application/json", "Accept":"application/json"}; //set params var params = {"userId":fields.filter.value}; var opts = new RestOptions(); //setting the wait time to establish a connection to the target server to 5 seconds opts.setConnectionTimeout(5); //set the time to wait for no inactivity from the rest call to 10 seconds opts.setSocketTimeout(10); var response = services.rest.put("myGateway", "/update/user", JSON.stringify(user), headers, params, opts); if(response.isSuccess()) { var result = JSON.parse(response.getBody()); if(result) { //populate response using the JSON object displayResult(result); } }Further documentation.
gatewayId
- the full URI of the requestendpoint
- path to invokebody
- String representation of the HTTP body for the requestheaders
- Map of HTTP request headersparameters
- Map of HTTP request query parametersoptions
- rest configuration options RestOptions
RestResponse
,
put(String, String, String)
,
patch(String, String, String, Map, Map)
RestResponse delete(java.lang.String gatewayId, java.lang.String endpoint)
RestResponse
representing the response.
A DELETE is used to delete a resource if it exists. The response code returned is 200 if successfully deleted or 404 if the resource does not exist.
Example:
var response = services.rest.delete("myGateway", "users/1"); if(response.isSuccess()) { //display success message } else { //display failure message }Further documentation.
gatewayId
- the full URI of the requestendpoint
- path to invokedelete(String, String, Map, Map)
RestResponse delete(java.lang.String gatewayId, java.lang.String endpoint, java.util.Map<java.lang.String,java.lang.Object> headers, java.util.Map<java.lang.String,java.lang.Object> parameters)
RestResponse
representing the response.
A DELETE is used to delete a resource if it exists. The response code returned is 200 if successfully deleted or 404 if the resource does not exist.
Example:
//set any headers var headers = {}; //set params var params = {"userId":fields.filter.value}; var response = services.rest.delete("myGateway", "/users", headers, params); if(response.isSuccess()) { //display success message } else { //display failure message }Further documentation.
gatewayId
- the full URI of the requestendpoint
- path to invokeheaders
- Map of HTTP request headersparameters
- Map of HTTP request query parametersdelete(String, String, Map, Map, RestOptions)
RestResponse delete(java.lang.String gatewayId, java.lang.String endpoint, java.util.Map<java.lang.String,java.lang.Object> headers, java.util.Map<java.lang.String,java.lang.Object> parameters, RestOptions options)
RestResponse
representing the response.
A DELETE is used to delete a resource if it exists. The response code returned is 200 if successfully deleted or 404 if the resource does not exist.
Example:
//set any headers var headers = {}; //set params var params = {"userId":fields.filter.value}; var opts = new RestOptions(); //setting the wait time to establish a connection to the target server to 5 seconds opts.setConnectionTimeout(5); //set the time to wait for no inactivity from the rest call to 10 seconds opts.setSocketTimeout(10); var response = services.rest.delete("myGateway", "/users", headers, params, opts); if(response.isSuccess()) { //display success message } else { //display failure message }Further documentation.
gatewayId
- the full URI of the requestendpoint
- path to invokeheaders
- Map of HTTP request headersparameters
- Map of HTTP request query parametersoptions
- rest configuration options RestOptions
delete(String, String)
RestResponse head(java.lang.String gatewayId, java.lang.String endpoint)
RestResponse
representing the response.
A HEAD is the same as a GET, apart from it does not have a body. This is only used to determine whether a resource is available.
Example:
var response = services.rest.head("myGateway", "users"); if(response.isSuccess()) { //display available message } else { //display failure message }Further documentation.
gatewayId
- the full URI of the requestendpoint
- path to invokehead(String, String, Map, Map)
,
get(String, String, Map, Map)
RestResponse head(java.lang.String gatewayId, java.lang.String endpoint, java.util.Map<java.lang.String,java.lang.Object> headers, java.util.Map<java.lang.String,java.lang.Object> parameters)
RestResponse
representing the response.
A HEAD is the same as a GET, apart from it does not have a body. This is only used to determine whether a resource is available.
Example:
//set any headers var headers = {}; //set params var params = {"userId":fields.filter.value}; var response = services.rest.head("myGateway", "/users", headers, params); if(response.isSuccess()) { //display available message } else { //display failure message }Further documentation.
gatewayId
- the full URI of the requestendpoint
- path to invokeendpoint
- path to invokeheaders
- Map of HTTP request headersparameters
- Map of HTTP request query parametershead(String, String, Map, Map)
,
get(String, String, Map, Map)
RestResponse head(java.lang.String gatewayId, java.lang.String endpoint, java.util.Map<java.lang.String,java.lang.Object> headers, java.util.Map<java.lang.String,java.lang.Object> parameters, RestOptions options)
RestResponse
representing the response.
A HEAD is the same as a GET, apart from it does not have a body. This is only used to determine whether a resource is available.
Example:
//set any headers var headers = {}; //set params var params = {"userId":fields.filter.value}; var opts = new RestOptions(); //setting the wait time to establish a connection to the target server to 5 seconds opts.setConnectionTimeout(5); //set the time to wait for no inactivity from the rest call to 10 seconds opts.setSocketTimeout(10); var response = services.rest.head("myGateway", "/users", headers, params, opts); if(response.isSuccess()) { //display available message } else { //display failure message }Further documentation.
gatewayId
- the full URI of the requestendpoint
- path to invokeheaders
- Map of HTTP request headersparameters
- Map of HTTP request query parametersoptions
- rest configuration options RestOptions
get(String, String, Map, Map)