Class RestInvocationHelper


  • public class RestInvocationHelper
    extends java.lang.Object
    Simple API for calling JSON-based REST services.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static boolean USE_THREADS
      Use daemon threads for REST call.
    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • USE_THREADS

        public static boolean USE_THREADS
        Use daemon threads for REST call.
    • Constructor Detail

      • RestInvocationHelper

        public RestInvocationHelper()
        Creates the helper.
        Parameters:
        component - The component using this helper.
    • 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.