@Service public class FlowableClientService extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_FLOWABLE_CONTEXT_ROOT |
static String |
DEFAULT_FLOWABLE_REST_ROOT |
protected com.fasterxml.jackson.databind.ObjectMapper |
objectMapper |
protected static String[] |
PAGING_AND_SORTING_PARAMETER_NAMES |
protected ServerConfigService |
serverConfigService |
| Constructor and Description |
|---|
FlowableClientService() |
| Modifier and Type | Method and Description |
|---|---|
void |
addParameterToBuilder(String name,
com.fasterxml.jackson.databind.JsonNode bodyNode,
org.apache.http.client.utils.URIBuilder builder) |
org.apache.http.client.methods.HttpDelete |
createDelete(org.apache.http.client.utils.URIBuilder builder,
ServerConfig serverConfig) |
org.apache.http.client.methods.HttpPost |
createPost(String uri,
ServerConfig serverConfig) |
org.apache.http.client.methods.HttpPost |
createPost(org.apache.http.client.utils.URIBuilder builder,
ServerConfig serverConfig) |
org.apache.http.client.methods.HttpPut |
createPut(String uri,
ServerConfig serverConfig) |
org.apache.http.client.methods.HttpPut |
createPut(org.apache.http.client.utils.URIBuilder builder,
ServerConfig serverConfig) |
org.apache.http.entity.StringEntity |
createStringEntity(com.fasterxml.jackson.databind.JsonNode json) |
org.apache.http.entity.StringEntity |
createStringEntity(String json) |
org.apache.http.client.utils.URIBuilder |
createUriBuilder(String url) |
void |
execute(org.apache.http.client.methods.HttpUriRequest request,
javax.servlet.http.HttpServletResponse httpResponse,
ServerConfig serverConfig) |
void |
execute(org.apache.http.client.methods.HttpUriRequest request,
javax.servlet.http.HttpServletResponse httpResponse,
String userName,
String password) |
ResponseInfo |
execute(org.apache.http.client.methods.HttpUriRequest request,
ServerConfig serverConfig) |
ResponseInfo |
execute(org.apache.http.client.methods.HttpUriRequest request,
ServerConfig serverConfig,
int... expectedStatusCodes) |
ResponseInfo |
execute(org.apache.http.client.methods.HttpUriRequest request,
String userName,
String password,
int... expectedStatusCodes) |
com.fasterxml.jackson.databind.JsonNode |
executeDownloadRequest(org.apache.http.client.methods.HttpUriRequest request,
javax.servlet.http.HttpServletResponse httpResponse,
ServerConfig serverConfig) |
com.fasterxml.jackson.databind.JsonNode |
executeDownloadRequest(org.apache.http.client.methods.HttpUriRequest request,
javax.servlet.http.HttpServletResponse httpResponse,
ServerConfig serverConfig,
int expectedStatusCode) |
com.fasterxml.jackson.databind.JsonNode |
executeDownloadRequest(org.apache.http.client.methods.HttpUriRequest request,
javax.servlet.http.HttpServletResponse httpResponse,
String userName,
String password,
int expectedStatusCode) |
AttachmentResponseInfo |
executeDownloadRequest(org.apache.http.client.methods.HttpUriRequest request,
ServerConfig serverConfig) |
AttachmentResponseInfo |
executeDownloadRequest(org.apache.http.client.methods.HttpUriRequest request,
ServerConfig serverConfig,
Integer... expectedStatusCodes) |
AttachmentResponseInfo |
executeDownloadRequest(org.apache.http.client.methods.HttpUriRequest request,
String userName,
String password) |
AttachmentResponseInfo |
executeDownloadRequest(org.apache.http.client.methods.HttpUriRequest request,
String userName,
String password,
Integer... expectedStatusCodes) |
com.fasterxml.jackson.databind.JsonNode |
executeRequest(org.apache.http.client.methods.HttpUriRequest request,
ServerConfig serverConfig)
Execute the given request.
|
com.fasterxml.jackson.databind.JsonNode |
executeRequest(org.apache.http.client.methods.HttpUriRequest request,
ServerConfig serverConfig,
int expectedStatusCode) |
com.fasterxml.jackson.databind.JsonNode |
executeRequest(org.apache.http.client.methods.HttpUriRequest request,
String userName,
String password) |
com.fasterxml.jackson.databind.JsonNode |
executeRequest(org.apache.http.client.methods.HttpUriRequest request,
String userName,
String password,
int expectedStatusCode)
Execute the given request.
|
String |
executeRequestAsString(org.apache.http.client.methods.HttpUriRequest request,
ServerConfig serverConfig,
int expectedStatusCode) |
void |
executeRequestNoResponseBody(org.apache.http.client.methods.HttpUriRequest request,
ServerConfig serverConfig,
int expectedStatusCode)
Execute the given request, without using the response body.
|
String |
extractError(com.fasterxml.jackson.databind.JsonNode errorBody,
String defaultValue) |
String |
getAppServerUrl(ServerConfig serverConfig,
String uri) |
org.apache.http.impl.client.CloseableHttpClient |
getHttpClient(ServerConfig serverConfig) |
org.apache.http.impl.client.CloseableHttpClient |
getHttpClient(String userName,
String password) |
String |
getServerUrl(ServerConfig serverConfig,
String uri) |
String |
getServerUrl(ServerConfig serverConfig,
org.apache.http.client.utils.URIBuilder builder) |
String |
getServerUrl(String contextRoot,
String restRoot,
String serverAddress,
Integer port,
String uri) |
String |
getUriWithPagingAndOrderParameters(org.apache.http.client.utils.URIBuilder builder,
com.fasterxml.jackson.databind.JsonNode bodyNode) |
protected com.fasterxml.jackson.databind.JsonNode |
readJsonContent(InputStream requestContent) |
protected String |
stripSlashes(String url) |
FlowableServiceException |
wrapException(Exception e,
org.apache.http.client.methods.HttpUriRequest request) |
protected static final String[] PAGING_AND_SORTING_PARAMETER_NAMES
public static final String DEFAULT_FLOWABLE_CONTEXT_ROOT
public static final String DEFAULT_FLOWABLE_REST_ROOT
@Autowired protected ServerConfigService serverConfigService
@Autowired protected com.fasterxml.jackson.databind.ObjectMapper objectMapper
public org.apache.http.impl.client.CloseableHttpClient getHttpClient(ServerConfig serverConfig)
public org.apache.http.impl.client.CloseableHttpClient getHttpClient(String userName, String password)
public com.fasterxml.jackson.databind.JsonNode executeRequest(org.apache.http.client.methods.HttpUriRequest request,
ServerConfig serverConfig)
FlowableServiceException is thrown with the error message received from the client, if possible.public com.fasterxml.jackson.databind.JsonNode executeRequest(org.apache.http.client.methods.HttpUriRequest request,
ServerConfig serverConfig,
int expectedStatusCode)
public com.fasterxml.jackson.databind.JsonNode executeRequest(org.apache.http.client.methods.HttpUriRequest request,
String userName,
String password)
public com.fasterxml.jackson.databind.JsonNode executeRequest(org.apache.http.client.methods.HttpUriRequest request,
String userName,
String password,
int expectedStatusCode)
FlowableServiceException is thrown with the error message received from the client, if possible.public com.fasterxml.jackson.databind.JsonNode executeDownloadRequest(org.apache.http.client.methods.HttpUriRequest request,
javax.servlet.http.HttpServletResponse httpResponse,
ServerConfig serverConfig)
public com.fasterxml.jackson.databind.JsonNode executeDownloadRequest(org.apache.http.client.methods.HttpUriRequest request,
javax.servlet.http.HttpServletResponse httpResponse,
ServerConfig serverConfig,
int expectedStatusCode)
public com.fasterxml.jackson.databind.JsonNode executeDownloadRequest(org.apache.http.client.methods.HttpUriRequest request,
javax.servlet.http.HttpServletResponse httpResponse,
String userName,
String password,
int expectedStatusCode)
public AttachmentResponseInfo executeDownloadRequest(org.apache.http.client.methods.HttpUriRequest request, ServerConfig serverConfig)
public AttachmentResponseInfo executeDownloadRequest(org.apache.http.client.methods.HttpUriRequest request, ServerConfig serverConfig, Integer... expectedStatusCodes)
public AttachmentResponseInfo executeDownloadRequest(org.apache.http.client.methods.HttpUriRequest request, String userName, String password)
public AttachmentResponseInfo executeDownloadRequest(org.apache.http.client.methods.HttpUriRequest request, String userName, String password, Integer... expectedStatusCodes)
public ResponseInfo execute(org.apache.http.client.methods.HttpUriRequest request, ServerConfig serverConfig)
public ResponseInfo execute(org.apache.http.client.methods.HttpUriRequest request, ServerConfig serverConfig, int... expectedStatusCodes)
public ResponseInfo execute(org.apache.http.client.methods.HttpUriRequest request, String userName, String password, int... expectedStatusCodes)
public void execute(org.apache.http.client.methods.HttpUriRequest request,
javax.servlet.http.HttpServletResponse httpResponse,
ServerConfig serverConfig)
public void execute(org.apache.http.client.methods.HttpUriRequest request,
javax.servlet.http.HttpServletResponse httpResponse,
String userName,
String password)
public String executeRequestAsString(org.apache.http.client.methods.HttpUriRequest request, ServerConfig serverConfig, int expectedStatusCode)
public FlowableServiceException wrapException(Exception e, org.apache.http.client.methods.HttpUriRequest request)
public void executeRequestNoResponseBody(org.apache.http.client.methods.HttpUriRequest request,
ServerConfig serverConfig,
int expectedStatusCode)
FlowableServiceException is thrown with the error
message received from the client, if possible.public String extractError(com.fasterxml.jackson.databind.JsonNode errorBody, String defaultValue)
public org.apache.http.client.methods.HttpPost createPost(String uri, ServerConfig serverConfig)
public org.apache.http.client.methods.HttpPost createPost(org.apache.http.client.utils.URIBuilder builder,
ServerConfig serverConfig)
public org.apache.http.client.methods.HttpPut createPut(String uri, ServerConfig serverConfig)
public org.apache.http.client.methods.HttpPut createPut(org.apache.http.client.utils.URIBuilder builder,
ServerConfig serverConfig)
public org.apache.http.client.methods.HttpDelete createDelete(org.apache.http.client.utils.URIBuilder builder,
ServerConfig serverConfig)
public org.apache.http.entity.StringEntity createStringEntity(com.fasterxml.jackson.databind.JsonNode json)
public org.apache.http.entity.StringEntity createStringEntity(String json)
public String getServerUrl(ServerConfig serverConfig, String uri)
public String getServerUrl(String contextRoot, String restRoot, String serverAddress, Integer port, String uri)
public String getAppServerUrl(ServerConfig serverConfig, String uri)
public org.apache.http.client.utils.URIBuilder createUriBuilder(String url)
public String getServerUrl(ServerConfig serverConfig, org.apache.http.client.utils.URIBuilder builder)
public String getUriWithPagingAndOrderParameters(org.apache.http.client.utils.URIBuilder builder, com.fasterxml.jackson.databind.JsonNode bodyNode) throws URISyntaxException
URISyntaxExceptionpublic void addParameterToBuilder(String name, com.fasterxml.jackson.databind.JsonNode bodyNode, org.apache.http.client.utils.URIBuilder builder)
protected com.fasterxml.jackson.databind.JsonNode readJsonContent(InputStream requestContent)
Copyright © 2020 Flowable. All rights reserved.