public class RestServiceInvoker extends Object implements ServiceInvoker
Modifier and Type | Class and Description |
---|---|
protected static class |
RestServiceInvoker.TimeoutTask |
Modifier and Type | Field and Description |
---|---|
static String |
KEY |
protected com.fasterxml.jackson.databind.ObjectMapper |
objectMapper |
protected ServiceRegistryEngineConfiguration |
serviceRegistryEngineConfiguration |
protected Timer |
timer |
Constructor and Description |
---|
RestServiceInvoker(ServiceRegistryEngineConfiguration serviceRegistryEngineConfiguration,
com.fasterxml.jackson.databind.ObjectMapper objectMapper) |
Modifier and Type | Method and Description |
---|---|
protected com.fasterxml.jackson.databind.JsonNode |
applyOutputPathIfApplicable(ServiceDefinitionModel serviceDefinitionModel,
ServiceOperation serviceOperation,
com.fasterxml.jackson.databind.JsonNode resultJsonNode) |
protected com.fasterxml.jackson.databind.JsonNode |
applyOutputReductionIfApplicable(ServiceOperation serviceOperation,
com.fasterxml.jackson.databind.JsonNode resultJsonNode) |
protected void |
configureRequest(ServiceDefinitionModel serviceDefinitionModel,
ServiceOperation serviceOperation,
org.flowable.http.HttpRequest request,
ServiceInvocationVariablesContainer variablesContainer) |
protected org.apache.http.impl.client.HttpClientBuilder |
createHttpClientBuilder(ServiceDefinitionModel serviceDefinitionModel,
ServiceOperation serviceOperation,
ServiceInvocationContext context) |
protected String |
decode(String string) |
protected URI |
ensureUrlIsEncodedAndConvertToUri(URL url) |
org.flowable.http.HttpResponse |
execute(org.flowable.http.HttpRequest request,
ServiceDefinitionModel serviceDefinitionModel,
ServiceOperation serviceOperation,
ServiceInvocationContext context) |
protected String |
getBody(ServiceOperation serviceOperation,
org.flowable.common.engine.impl.el.ExpressionManager expressionManager,
ServiceInvocationVariablesContainer serviceInvocationVariablesContainer) |
protected String |
getHeadersAsString(org.apache.http.Header[] headers) |
protected String |
getUrl(ServiceDefinitionModel serviceDefinitionModel,
ServiceOperation serviceOperation) |
ServiceInvocationResponse |
invoke(ServiceDefinitionModel serviceDefinitionModel,
ServiceOperation serviceOperation,
ServiceInvocationContext context) |
protected boolean |
isJsonContentType(org.flowable.http.HttpResponse httpResponse) |
protected boolean |
lookupBooleanProperty(ServiceDefinitionModel serviceDefinitionModel,
ServiceOperation serviceOperation,
String field,
boolean defaultValue) |
protected int |
lookupIntegerProperty(ServiceDefinitionModel serviceDefinitionModel,
ServiceOperation serviceOperation,
String field,
int defaultValue) |
protected String |
lookupStringProperty(ServiceDefinitionModel serviceDefinitionModel,
ServiceOperation serviceOperation,
String field,
String defaultValue) |
org.flowable.http.HttpResponse |
perform(org.apache.http.impl.client.CloseableHttpClient client,
ServiceDefinitionModel serviceDefinitionModel,
ServiceOperation serviceOperation,
ServiceInvocationContext context,
org.flowable.http.HttpRequest httpRequest) |
protected void |
processInputParameter(ServiceInvocationVariablesContainer serviceInvocationVariablesContainer,
org.flowable.common.engine.impl.el.ExpressionManager expressionManager,
com.fasterxml.jackson.databind.node.ObjectNode bodyJson,
ServiceInputParameter inputParameter) |
protected void |
setConfig(org.apache.http.client.methods.HttpRequestBase base,
org.flowable.http.HttpRequest requestInfo,
int socketTimeout,
int connectTimeout,
int connectionRequestTimeout) |
protected void |
setHeaders(org.apache.http.HttpMessage base,
String headers) |
protected void |
setRequestEntity(org.flowable.http.HttpRequest requestInfo,
org.apache.http.client.methods.HttpEntityEnclosingRequestBase requestBase) |
protected void |
validate(org.flowable.http.HttpRequest request) |
public static final String KEY
protected ServiceRegistryEngineConfiguration serviceRegistryEngineConfiguration
protected com.fasterxml.jackson.databind.ObjectMapper objectMapper
protected final Timer timer
public RestServiceInvoker(ServiceRegistryEngineConfiguration serviceRegistryEngineConfiguration, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
public ServiceInvocationResponse invoke(ServiceDefinitionModel serviceDefinitionModel, ServiceOperation serviceOperation, ServiceInvocationContext context)
invoke
in interface ServiceInvoker
protected void configureRequest(ServiceDefinitionModel serviceDefinitionModel, ServiceOperation serviceOperation, org.flowable.http.HttpRequest request, ServiceInvocationVariablesContainer variablesContainer)
protected String getUrl(ServiceDefinitionModel serviceDefinitionModel, ServiceOperation serviceOperation)
protected String getBody(ServiceOperation serviceOperation, org.flowable.common.engine.impl.el.ExpressionManager expressionManager, ServiceInvocationVariablesContainer serviceInvocationVariablesContainer)
protected void processInputParameter(ServiceInvocationVariablesContainer serviceInvocationVariablesContainer, org.flowable.common.engine.impl.el.ExpressionManager expressionManager, com.fasterxml.jackson.databind.node.ObjectNode bodyJson, ServiceInputParameter inputParameter)
protected String lookupStringProperty(ServiceDefinitionModel serviceDefinitionModel, ServiceOperation serviceOperation, String field, String defaultValue)
protected int lookupIntegerProperty(ServiceDefinitionModel serviceDefinitionModel, ServiceOperation serviceOperation, String field, int defaultValue)
protected boolean lookupBooleanProperty(ServiceDefinitionModel serviceDefinitionModel, ServiceOperation serviceOperation, String field, boolean defaultValue)
protected com.fasterxml.jackson.databind.JsonNode applyOutputPathIfApplicable(ServiceDefinitionModel serviceDefinitionModel, ServiceOperation serviceOperation, com.fasterxml.jackson.databind.JsonNode resultJsonNode)
protected com.fasterxml.jackson.databind.JsonNode applyOutputReductionIfApplicable(ServiceOperation serviceOperation, com.fasterxml.jackson.databind.JsonNode resultJsonNode)
public org.flowable.http.HttpResponse execute(org.flowable.http.HttpRequest request, ServiceDefinitionModel serviceDefinitionModel, ServiceOperation serviceOperation, ServiceInvocationContext context)
protected org.apache.http.impl.client.HttpClientBuilder createHttpClientBuilder(ServiceDefinitionModel serviceDefinitionModel, ServiceOperation serviceOperation, ServiceInvocationContext context)
protected void validate(org.flowable.http.HttpRequest request)
public org.flowable.http.HttpResponse perform(org.apache.http.impl.client.CloseableHttpClient client, ServiceDefinitionModel serviceDefinitionModel, ServiceOperation serviceOperation, ServiceInvocationContext context, org.flowable.http.HttpRequest httpRequest)
protected void setRequestEntity(org.flowable.http.HttpRequest requestInfo, org.apache.http.client.methods.HttpEntityEnclosingRequestBase requestBase) throws UnsupportedEncodingException
UnsupportedEncodingException
protected void setConfig(org.apache.http.client.methods.HttpRequestBase base, org.flowable.http.HttpRequest requestInfo, int socketTimeout, int connectTimeout, int connectionRequestTimeout)
protected String getHeadersAsString(org.apache.http.Header[] headers)
protected void setHeaders(org.apache.http.HttpMessage base, String headers) throws IOException
IOException
protected URI ensureUrlIsEncodedAndConvertToUri(URL url) throws URISyntaxException
URISyntaxException
protected boolean isJsonContentType(org.flowable.http.HttpResponse httpResponse)
Copyright © 2019. All rights reserved.