|
jBPM distribution 6.2.0.CR4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jbpm.process.workitem.AbstractLogOrThrowWorkItemHandler
org.jbpm.process.workitem.rest.RESTWorkItemHandler
public class RESTWorkItemHandler
WorkItemHandler that is capable of interacting with REST service. Supports both types of services secured (that requires authentication) and open (no authentication). Authentication methods currently supported:
Nested Class Summary | |
---|---|
static class |
RESTWorkItemHandler.AuthenticationType
|
Field Summary | |
---|---|
protected static boolean |
HTTP_CLIENT_API_43
|
Fields inherited from class org.jbpm.process.workitem.AbstractLogOrThrowWorkItemHandler |
---|
logThrownException |
Constructor Summary | |
---|---|
RESTWorkItemHandler()
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,
String authUrl)
Dedicated constructor when FORM BASED authentication method shall be used |
Method Summary | |
---|---|
void |
abortWorkItem(WorkItem workItem,
WorkItemManager manager)
The given work item should be aborted. |
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)
|
protected org.apache.http.HttpResponse |
doRequestWithAuthorization(org.apache.http.client.HttpClient httpclient,
Object method,
Map<String,Object> params)
|
protected org.apache.http.HttpResponse |
doRequestWithAuthorization(org.apache.http.client.HttpClient httpclient,
org.apache.http.client.methods.RequestBuilder requestBuilder,
Map<String,Object> params)
This method does the actual request, including the setup for authorization. |
void |
executeWorkItem(WorkItem workItem,
WorkItemManager manager)
The given work item should be executed. |
String |
getAuthUrl()
|
protected org.apache.http.client.HttpClient |
getHttpClient(Integer readTimeout,
Integer connectTimeout)
|
protected Integer |
getParamAsInt(Object param)
|
protected void |
postProcessResult(String result,
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)
|
Methods inherited from class org.jbpm.process.workitem.AbstractLogOrThrowWorkItemHandler |
---|
handleException, handleException, setLogThrownException |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static boolean HTTP_CLIENT_API_43
Constructor Detail |
---|
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
- Method Detail |
---|
public String getAuthUrl()
public void executeWorkItem(WorkItem workItem, WorkItemManager manager)
WorkItemHandler
workItem
- the work item that should be executedmanager
- the manager that requested the work item to be executedprotected Integer getParamAsInt(Object param)
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, Map<String,Object> results)
protected org.apache.http.HttpResponse doRequestWithAuthorization(org.apache.http.client.HttpClient httpclient, Object method, Map<String,Object> params)
protected org.apache.http.HttpResponse doRequestWithAuthorization(org.apache.http.client.HttpClient httpclient, org.apache.http.client.methods.RequestBuilder requestBuilder, Map<String,Object> params)
httpclient
- The HttpClient
instancerequestBuilder
- The RequestBuilder
instanceparams
- The parameters that may be needed for authentication
HttpResponse
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)
public void abortWorkItem(WorkItem workItem, WorkItemManager manager)
WorkItemHandler
workItem
- the work item that should be abortedmanager
- the manager that requested the work item to be abortedprotected org.apache.http.client.HttpClient getHttpClient(Integer readTimeout, Integer connectTimeout)
protected void close(org.apache.http.client.HttpClient httpClient, Object httpMethod) throws IOException
IOException
protected Object configureRequest(String method, String urlStr, Map<String,Object> params)
|
jBPM distribution 6.2.0.CR4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |