Class RestApiUtil


  • @Deprecated
    public class RestApiUtil
    extends java.lang.Object
    Deprecated.
    Utility methods for calling external APIs in a standardized way.
    Since:
    0.8.0 This utility is deprecated. Use HttpApiClient which is more efficient for API communications.
    • Constructor Detail

      • RestApiUtil

        public RestApiUtil()
        Deprecated.
    • Method Detail

      • callApi

        public static ServiceResponse callApi​(java.lang.String url,
                                              java.lang.String path,
                                              java.lang.String username,
                                              java.lang.String password)
                                       throws java.net.URISyntaxException,
                                              java.lang.Exception
        Deprecated.
        Throws:
        java.net.URISyntaxException
        java.lang.Exception
      • callApi

        public static ServiceResponse callApi​(java.lang.String url,
                                              java.lang.String path,
                                              java.lang.String username,
                                              java.lang.String password,
                                              RestApiUtil.RestOptions opts)
                                       throws java.net.URISyntaxException,
                                              java.lang.Exception
        Deprecated.
        Throws:
        java.net.URISyntaxException
        java.lang.Exception
      • callApi

        public static ServiceResponse callApi​(java.lang.String url,
                                              java.lang.String path,
                                              java.lang.String username,
                                              java.lang.String password,
                                              RestApiUtil.RestOptions opts,
                                              java.lang.String method)
                                       throws java.net.URISyntaxException,
                                              java.lang.Exception
        Deprecated.
        Throws:
        java.net.URISyntaxException
        java.lang.Exception
      • callJsonApi

        public static ServiceResponse callJsonApi​(java.lang.String url,
                                                  java.lang.String path)
                                           throws java.net.URISyntaxException,
                                                  java.lang.Exception
        Deprecated.
        Throws:
        java.net.URISyntaxException
        java.lang.Exception
      • callJsonApi

        public static ServiceResponse callJsonApi​(java.lang.String url,
                                                  java.lang.String path,
                                                  RestApiUtil.RestOptions opts)
                                           throws java.net.URISyntaxException,
                                                  java.lang.Exception
        Deprecated.
        Throws:
        java.net.URISyntaxException
        java.lang.Exception
      • callJsonApi

        public static ServiceResponse callJsonApi​(java.lang.String url,
                                                  java.lang.String path,
                                                  RestApiUtil.RestOptions opts,
                                                  java.lang.String method)
                                           throws java.net.URISyntaxException,
                                                  java.lang.Exception
        Deprecated.
        Throws:
        java.net.URISyntaxException
        java.lang.Exception
      • callJsonApi

        public static ServiceResponse callJsonApi​(java.lang.String url,
                                                  java.lang.String path,
                                                  java.lang.String username,
                                                  java.lang.String password,
                                                  RestApiUtil.RestOptions opts)
                                           throws java.net.URISyntaxException,
                                                  java.lang.Exception
        Deprecated.
        Throws:
        java.net.URISyntaxException
        java.lang.Exception
      • callJsonApi

        public static ServiceResponse callJsonApi​(java.lang.String url,
                                                  java.lang.String path,
                                                  java.lang.String username,
                                                  java.lang.String password,
                                                  RestApiUtil.RestOptions opts,
                                                  java.lang.String method)
                                           throws java.net.URISyntaxException,
                                                  java.lang.Exception
        Deprecated.
        Throws:
        java.net.URISyntaxException
        java.lang.Exception
      • callXmlApi

        public static ServiceResponse callXmlApi​(java.lang.String url,
                                                 java.lang.String path,
                                                 RestApiUtil.RestOptions opts)
                                          throws java.net.URISyntaxException,
                                                 java.lang.Exception
        Deprecated.
        Throws:
        java.net.URISyntaxException
        java.lang.Exception
      • callXmlApi

        public static ServiceResponse callXmlApi​(java.lang.String url,
                                                 java.lang.String path,
                                                 java.lang.String username,
                                                 java.lang.String password,
                                                 RestApiUtil.RestOptions opts,
                                                 java.lang.String method)
                                          throws java.net.URISyntaxException,
                                                 java.lang.Exception
        Deprecated.
        Throws:
        java.net.URISyntaxException
        java.lang.Exception
      • addRequiredHeader

        public static java.util.Map<java.lang.String,​java.lang.String> addRequiredHeader​(java.util.Map<java.lang.String,​java.lang.String> headers,
                                                                                               java.lang.String name,
                                                                                               java.lang.String value)
        Deprecated.
      • shutdownClient

        public static void shutdownClient​(org.apache.http.client.HttpClient httpClient)
        Deprecated.
        Wrapper method for shutting down an HttpClient connection Manager This is typically used when using a Keep-Alive connection manager
        Parameters:
        httpClient - the HttpClient we wish to permanently shutdown.
      • shutdownClient

        public static void shutdownClient​(org.apache.http.conn.HttpClientConnectionManager connectionManager)
        Deprecated.