public class RESTWorkItemHandler extends AbstractLogOrThrowWorkItemHandler
Modifier and Type | Class and Description |
---|---|
static class |
RESTWorkItemHandler.AuthenticationType |
Modifier and Type | Field and Description |
---|---|
protected static boolean |
HTTP_CLIENT_API_43 |
logThrownException
Constructor and Description |
---|
RESTWorkItemHandler()
Used when no authentication is required
|
RESTWorkItemHandler(ClassLoader classLoader)
Used when no authentication is required
|
RESTWorkItemHandler(String username,
String password)
Dedicated constructor when BASIC authentication method shall be used
|
RESTWorkItemHandler(String username,
String password,
ClassLoader classLoader)
Dedicated constructor when BASIC authentication method shall be used
|
RESTWorkItemHandler(String username,
String password,
String authUrl)
Dedicated constructor when FORM BASED authentication method shall be used
|
RESTWorkItemHandler(String username,
String password,
String authUrl,
ClassLoader classLoader)
Dedicated constructor when FORM BASED authentication method shall be used
|
Modifier and Type | Method and Description |
---|---|
void |
abortWorkItem(org.kie.api.runtime.process.WorkItem workItem,
org.kie.api.runtime.process.WorkItemManager manager) |
protected void |
close(org.apache.http.client.HttpClient httpClient,
Object httpMethod) |
protected Object |
configureRequest(String method,
String urlStr,
Map<String,Object> params) |
protected org.apache.http.HttpResponse |
doRequestWithAuthorization(org.apache.http.client.HttpClient httpclient,
org.apache.http.client.methods.HttpRequestBase httpMethod,
Map<String,Object> params,
RESTWorkItemHandler.AuthenticationType type) |
protected org.apache.http.HttpResponse |
doRequestWithAuthorization(org.apache.http.client.HttpClient httpclient,
Object method,
Map<String,Object> params,
RESTWorkItemHandler.AuthenticationType authType) |
protected org.apache.http.HttpResponse |
doRequestWithAuthorization(org.apache.http.client.HttpClient httpclient,
org.apache.http.client.methods.RequestBuilder requestBuilder,
Map<String,Object> params,
RESTWorkItemHandler.AuthenticationType type)
This method does the actual request, including the setup for authorization.
|
void |
executeWorkItem(org.kie.api.runtime.process.WorkItem workItem,
org.kie.api.runtime.process.WorkItemManager manager) |
String |
getAuthUrl() |
protected org.apache.http.client.HttpClient |
getHttpClient(Integer readTimeout,
Integer connectTimeout) |
protected Integer |
getParamAsInt(Object param) |
protected void |
postProcessResult(String result,
String resultClass,
String contentType,
Map<String,Object> results) |
protected void |
setBody(org.apache.http.client.methods.HttpRequestBase theMethod,
Map<String,Object> params) |
protected void |
setBody(org.apache.http.client.methods.RequestBuilder builder,
Map<String,Object> params) |
protected String |
transformRequest(Object data,
String contentType) |
protected Object |
transformResult(Class<?> clazz,
String contentType,
String content) |
handleException, handleException, setLogThrownException
public RESTWorkItemHandler()
public RESTWorkItemHandler(String username, String password)
username
- - user name to be used for authenticationpassword
- - password to be used for authenticationpublic RESTWorkItemHandler(String username, String password, String authUrl)
username
- - user name to be used for authenticationpassword
- - password to be used for authenticationauthUrl
- public RESTWorkItemHandler(ClassLoader classLoader)
public RESTWorkItemHandler(String username, String password, ClassLoader classLoader)
username
- - user name to be used for authenticationpassword
- - password to be used for authenticationpublic RESTWorkItemHandler(String username, String password, String authUrl, ClassLoader classLoader)
username
- - user name to be used for authenticationpassword
- - password to be used for authenticationauthUrl
- public String getAuthUrl()
public void executeWorkItem(org.kie.api.runtime.process.WorkItem workItem, org.kie.api.runtime.process.WorkItemManager manager)
protected void setBody(org.apache.http.client.methods.RequestBuilder builder, Map<String,Object> params)
protected void setBody(org.apache.http.client.methods.HttpRequestBase theMethod, Map<String,Object> params)
protected void postProcessResult(String result, String resultClass, String contentType, Map<String,Object> results)
protected Object transformResult(Class<?> clazz, String contentType, String content) throws Exception
Exception
protected org.apache.http.HttpResponse doRequestWithAuthorization(org.apache.http.client.HttpClient httpclient, Object method, Map<String,Object> params, RESTWorkItemHandler.AuthenticationType authType)
protected org.apache.http.HttpResponse doRequestWithAuthorization(org.apache.http.client.HttpClient httpclient, org.apache.http.client.methods.RequestBuilder requestBuilder, Map<String,Object> params, RESTWorkItemHandler.AuthenticationType type)
httpclient
- The HttpClient
instancerequestBuilder
- The RequestBuilder
instanceparams
- The parameters that may be needed for authenticationHttpResponse
instance from which we can extract the contentprotected org.apache.http.HttpResponse doRequestWithAuthorization(org.apache.http.client.HttpClient httpclient, org.apache.http.client.methods.HttpRequestBase httpMethod, Map<String,Object> params, RESTWorkItemHandler.AuthenticationType type)
public void abortWorkItem(org.kie.api.runtime.process.WorkItem workItem, org.kie.api.runtime.process.WorkItemManager manager)
protected org.apache.http.client.HttpClient getHttpClient(Integer readTimeout, Integer connectTimeout)
protected void close(org.apache.http.client.HttpClient httpClient, Object httpMethod) throws IOException
IOException
Copyright © 2001–2015 JBoss by Red Hat. All rights reserved.