Package jadex.extension.rs.invoke
Class RestInvocationHelper
- java.lang.Object
-
- jadex.extension.rs.invoke.RestInvocationHelper
-
public class RestInvocationHelper extends java.lang.Object
Simple API for calling JSON-based REST services.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RestInvocationHelper.RequestFailedException
Exception
-
Field Summary
Fields Modifier and Type Field Description static boolean
USE_THREADS
Use daemon threads for REST call.
-
Constructor Summary
Constructors Constructor Description RestInvocationHelper()
Creates the helper.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description IFuture<java.lang.String>
invokeJson(IInternalAccess component, java.lang.String uri, java.lang.String path, java.util.Map<java.lang.String,java.lang.Object> headers, java.util.Map<java.lang.String,java.lang.Object> params, java.lang.Class<?> resttype, boolean inurlparams)
Invokes the REST service for a JSON response.IFuture<java.lang.String>
invokeJson(IInternalAccess component, java.lang.String uri, java.lang.String path, java.util.Map<java.lang.String,java.lang.Object> headers, java.util.Map<java.lang.String,java.lang.Object> params, java.lang.String postplainjson, java.lang.Class<?> resttype, boolean inurlparams)
Invokes the REST service for a JSON response.static void
performRequest(IExternalAccess exta, java.lang.String uri, java.lang.String path, java.util.Map<java.lang.String,java.lang.Object> headers, java.util.Map<java.lang.String,java.lang.Object> params, java.lang.String postplainjson, java.lang.Class<?> resttype, boolean inurlparams, Future<java.lang.String> ret)
Perform the REST call.
-
-
-
Method Detail
-
invokeJson
public IFuture<java.lang.String> invokeJson(IInternalAccess component, java.lang.String uri, java.lang.String path, java.util.Map<java.lang.String,java.lang.Object> headers, java.util.Map<java.lang.String,java.lang.Object> params, java.lang.Class<?> resttype, boolean inurlparams)
Invokes the REST service for a JSON response.- Parameters:
uri
- URI to invoke.path
- Path to invoke.headers
- Header fields.params
- Parameters.- Returns:
- Reply string
-
invokeJson
public IFuture<java.lang.String> invokeJson(IInternalAccess component, java.lang.String uri, java.lang.String path, java.util.Map<java.lang.String,java.lang.Object> headers, java.util.Map<java.lang.String,java.lang.Object> params, java.lang.String postplainjson, java.lang.Class<?> resttype, boolean inurlparams)
Invokes the REST service for a JSON response.- Parameters:
uri
- URI to invoke.path
- Path to invoke.headers
- Header fields.params
- Parameters.- Returns:
- Reply string
-
performRequest
public static final void performRequest(IExternalAccess exta, java.lang.String uri, java.lang.String path, java.util.Map<java.lang.String,java.lang.Object> headers, java.util.Map<java.lang.String,java.lang.Object> params, java.lang.String postplainjson, java.lang.Class<?> resttype, boolean inurlparams, Future<java.lang.String> ret)
Perform the REST call.
-
-