public abstract class AbstractKieServicesClientImpl extends Object
Modifier and Type | Field and Description |
---|---|
protected String |
baseURI |
protected static Boolean |
BYPASS_AUTH_USER |
protected ClassLoader |
classLoader |
protected KieServicesConfiguration |
config |
protected org.kie.server.api.marshalling.Marshaller |
marshaller |
protected KieServicesClientImpl |
owner |
Constructor and Description |
---|
AbstractKieServicesClientImpl(KieServicesConfiguration config) |
AbstractKieServicesClientImpl(KieServicesConfiguration config,
ClassLoader classLoader) |
Modifier and Type | Method and Description |
---|---|
protected String |
buildQueryString(String paramName,
List<?> items) |
protected void |
checkResultType(org.kie.server.api.model.ServiceResponse<?> serviceResponse,
Class<?> expectedResultType)
Checks whether the specified
ServiceResponse contains the expected result type. |
protected RuntimeException |
createExceptionForUnexpectedResponseCode(org.kie.remote.common.rest.KieRemoteHttpRequest request,
org.kie.remote.common.rest.KieRemoteHttpResponse response) |
protected <T> T |
deserialize(String content,
Class<T> type) |
protected org.kie.server.api.model.ServiceResponsesList |
executeJmsCommand(org.kie.server.api.commands.CommandScript command)
Method to communicate with the backend via JMS.
|
protected org.kie.server.api.model.ServiceResponsesList |
executeJmsCommand(org.kie.server.api.commands.CommandScript command,
String classType) |
protected org.kie.server.api.model.ServiceResponsesList |
executeJmsCommand(org.kie.server.api.commands.CommandScript command,
String classType,
String targetCapability) |
protected org.kie.server.api.model.ServiceResponsesList |
executeJmsCommand(org.kie.server.api.commands.CommandScript command,
String classType,
String targetCapability,
String containerId) |
protected String |
getAdditionalParams(String inQueryString,
String name,
List<?> values) |
String |
getConversationId() |
protected Map<String,String> |
getHeaders(Object object) |
protected String |
getMediaType(org.kie.server.api.marshalling.MarshallingFormat format) |
protected String |
getMessage(org.kie.remote.common.rest.KieRemoteHttpResponse response) |
protected String |
getPagingQueryString(String inQueryString,
Integer page,
Integer pageSize) |
ResponseHandler |
getResponseHandler() |
protected String |
getUserAndAdditionalParam(String userId,
String name,
String value) |
protected String |
getUserAndAdditionalParams(String userId,
String name,
List<?> values) |
protected String |
getUserAndPagingQueryString(String userId,
Integer page,
Integer pageSize) |
protected String |
getUserQueryStr(String userId) |
protected String |
initializeURI(URL url,
String servicePrefix)
Initializes the URL that will be used for web service access
|
protected <T> org.kie.server.api.model.ServiceResponse<T> |
makeBackwardCompatibleHttpPostRequestAndCreateServiceResponse(String uri,
Object body,
Class<T> resultType,
Map<String,String> headers) |
protected <T> org.kie.server.api.model.ServiceResponse<T> |
makeBackwardCompatibleHttpPostRequestAndCreateServiceResponse(String uri,
String body,
Class<T> resultType) |
protected <T> T |
makeHttpDeleteRequestAndCreateCustomResponse(String uri,
Class<T> resultType) |
protected <T> org.kie.server.api.model.ServiceResponse<T> |
makeHttpDeleteRequestAndCreateServiceResponse(String uri,
Class<T> resultType) |
protected <T> T |
makeHttpGetRequestAndCreateCustomResponse(String uri,
Class<T> resultType) |
protected String |
makeHttpGetRequestAndCreateRawResponse(String uri) |
protected String |
makeHttpGetRequestAndCreateRawResponse(String uri,
Map<String,String> headers) |
protected <T> org.kie.server.api.model.ServiceResponse<T> |
makeHttpGetRequestAndCreateServiceResponse(String uri,
Class<T> resultType) |
protected <T> T |
makeHttpPostRequestAndCreateCustomResponse(String uri,
Object bodyObject,
Class<T> resultType) |
protected <T> T |
makeHttpPostRequestAndCreateCustomResponse(String uri,
Object bodyObject,
Class<T> resultType,
Map<String,String> headers) |
protected <T> T |
makeHttpPostRequestAndCreateCustomResponse(String uri,
String body,
Class<T> resultType,
Map<String,String> headers) |
protected <T> org.kie.server.api.model.ServiceResponse<T> |
makeHttpPostRequestAndCreateServiceResponse(String uri,
Object bodyObject,
Class<T> resultType) |
protected <T> org.kie.server.api.model.ServiceResponse<T> |
makeHttpPostRequestAndCreateServiceResponse(String uri,
Object bodyObject,
Class<T> resultType,
Map<String,String> headers) |
protected <T> org.kie.server.api.model.ServiceResponse<T> |
makeHttpPostRequestAndCreateServiceResponse(String uri,
String body,
Class<T> resultType) |
protected <T> org.kie.server.api.model.ServiceResponse<T> |
makeHttpPostRequestAndCreateServiceResponse(String uri,
String body,
Class<T> resultType,
Map<String,String> headers) |
protected <T> T |
makeHttpPutRequestAndCreateCustomResponse(String uri,
Object bodyObject,
Class<T> resultType,
Map<String,String> headers) |
protected <T> T |
makeHttpPutRequestAndCreateCustomResponse(String uri,
String body,
Class<T> resultType,
Map<String,String> headers) |
protected <T> org.kie.server.api.model.ServiceResponse<T> |
makeHttpPutRequestAndCreateServiceResponse(String uri,
Object bodyObject,
Class<T> resultType) |
protected <T> org.kie.server.api.model.ServiceResponse<T> |
makeHttpPutRequestAndCreateServiceResponse(String uri,
String body,
Class<T> resultType) |
protected org.kie.remote.common.rest.KieRemoteHttpRequest |
newRequest(String uri) |
protected List<?> |
safeList(List<?> list) |
protected Map<?,?> |
safeMap(Map<?,?> map) |
protected void |
sendTaskOperation(String containerId,
Long taskId,
String operation,
String queryString) |
protected String |
serialize(Object object) |
void |
setOwner(KieServicesClientImpl owner) |
void |
setResponseHandler(ResponseHandler responseHandler) |
protected boolean |
shouldReturnWithNullResponse(org.kie.server.api.model.ServiceResponse<?> serviceResponse) |
protected void |
throwExceptionOnFailure(org.kie.server.api.model.ServiceResponse<?> serviceResponse) |
protected static final Boolean BYPASS_AUTH_USER
protected String baseURI
protected final KieServicesConfiguration config
protected final org.kie.server.api.marshalling.Marshaller marshaller
protected ClassLoader classLoader
protected KieServicesClientImpl owner
public AbstractKieServicesClientImpl(KieServicesConfiguration config)
public AbstractKieServicesClientImpl(KieServicesConfiguration config, ClassLoader classLoader)
protected String initializeURI(URL url, String servicePrefix)
url
- URL of the server instancepublic void setOwner(KieServicesClientImpl owner)
public ResponseHandler getResponseHandler()
public void setResponseHandler(ResponseHandler responseHandler)
protected void throwExceptionOnFailure(org.kie.server.api.model.ServiceResponse<?> serviceResponse)
protected boolean shouldReturnWithNullResponse(org.kie.server.api.model.ServiceResponse<?> serviceResponse)
protected void sendTaskOperation(String containerId, Long taskId, String operation, String queryString)
protected <T> org.kie.server.api.model.ServiceResponse<T> makeHttpGetRequestAndCreateServiceResponse(String uri, Class<T> resultType)
protected <T> T makeHttpGetRequestAndCreateCustomResponse(String uri, Class<T> resultType)
protected String makeHttpGetRequestAndCreateRawResponse(String uri)
protected String makeHttpGetRequestAndCreateRawResponse(String uri, Map<String,String> headers)
protected <T> org.kie.server.api.model.ServiceResponse<T> makeHttpPostRequestAndCreateServiceResponse(String uri, Object bodyObject, Class<T> resultType)
protected <T> org.kie.server.api.model.ServiceResponse<T> makeHttpPostRequestAndCreateServiceResponse(String uri, Object bodyObject, Class<T> resultType, Map<String,String> headers)
protected <T> org.kie.server.api.model.ServiceResponse<T> makeHttpPostRequestAndCreateServiceResponse(String uri, String body, Class<T> resultType)
protected <T> org.kie.server.api.model.ServiceResponse<T> makeHttpPostRequestAndCreateServiceResponse(String uri, String body, Class<T> resultType, Map<String,String> headers)
protected <T> T makeHttpPostRequestAndCreateCustomResponse(String uri, Object bodyObject, Class<T> resultType, Map<String,String> headers)
protected <T> T makeHttpPostRequestAndCreateCustomResponse(String uri, Object bodyObject, Class<T> resultType)
protected <T> T makeHttpPostRequestAndCreateCustomResponse(String uri, String body, Class<T> resultType, Map<String,String> headers)
protected <T> org.kie.server.api.model.ServiceResponse<T> makeHttpPutRequestAndCreateServiceResponse(String uri, Object bodyObject, Class<T> resultType)
protected <T> org.kie.server.api.model.ServiceResponse<T> makeHttpPutRequestAndCreateServiceResponse(String uri, String body, Class<T> resultType)
protected <T> T makeHttpPutRequestAndCreateCustomResponse(String uri, Object bodyObject, Class<T> resultType, Map<String,String> headers)
protected <T> T makeHttpPutRequestAndCreateCustomResponse(String uri, String body, Class<T> resultType, Map<String,String> headers)
protected <T> org.kie.server.api.model.ServiceResponse<T> makeHttpDeleteRequestAndCreateServiceResponse(String uri, Class<T> resultType)
protected <T> T makeHttpDeleteRequestAndCreateCustomResponse(String uri, Class<T> resultType)
protected org.kie.remote.common.rest.KieRemoteHttpRequest newRequest(String uri)
protected org.kie.server.api.model.ServiceResponsesList executeJmsCommand(org.kie.server.api.commands.CommandScript command)
command
- The Command
object to be executed.Command
object execution.protected org.kie.server.api.model.ServiceResponsesList executeJmsCommand(org.kie.server.api.commands.CommandScript command, String classType)
protected org.kie.server.api.model.ServiceResponsesList executeJmsCommand(org.kie.server.api.commands.CommandScript command, String classType, String targetCapability)
protected org.kie.server.api.model.ServiceResponsesList executeJmsCommand(org.kie.server.api.commands.CommandScript command, String classType, String targetCapability, String containerId)
protected String getMediaType(org.kie.server.api.marshalling.MarshallingFormat format)
protected void checkResultType(org.kie.server.api.model.ServiceResponse<?> serviceResponse, Class<?> expectedResultType)
ServiceResponse
contains the expected result type. In case the type is different,
KieServicesClientException
is thrown. This catches the errors early, before returning the result from the client.
Without this check users could experience ClassCastException
when retrieving the result that does not have
the expected type.protected RuntimeException createExceptionForUnexpectedResponseCode(org.kie.remote.common.rest.KieRemoteHttpRequest request, org.kie.remote.common.rest.KieRemoteHttpResponse response)
protected String getMessage(org.kie.remote.common.rest.KieRemoteHttpResponse response)
protected String getUserAndPagingQueryString(String userId, Integer page, Integer pageSize)
protected String getUserAndAdditionalParam(String userId, String name, String value)
protected String getUserAndAdditionalParams(String userId, String name, List<?> values)
protected String getPagingQueryString(String inQueryString, Integer page, Integer pageSize)
protected String getAdditionalParams(String inQueryString, String name, List<?> values)
protected <T> org.kie.server.api.model.ServiceResponse<T> makeBackwardCompatibleHttpPostRequestAndCreateServiceResponse(String uri, Object body, Class<T> resultType, Map<String,String> headers)
protected <T> org.kie.server.api.model.ServiceResponse<T> makeBackwardCompatibleHttpPostRequestAndCreateServiceResponse(String uri, String body, Class<T> resultType)
public String getConversationId()
Copyright © 2001–2018 JBoss by Red Hat. All rights reserved.