Class HttpCore


  • public class HttpCore
    extends java.lang.Object
    HttpCore performs authenticated HTTP synchronously. Internal; use Http or HttpScheduler instead.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  HttpCore.AuthRequiredException
      Exception signifying that an httpCore request failed with a WWW-Authenticate response
      static interface  HttpCore.BodyHandler<T>
      Interface for an entity that performs type-specific processing on an httpCore response body
      static interface  HttpCore.RequestBody
      Interface for an entity that supplies an httpCore request body
      static class  HttpCore.Response
      A type encapsulating an httpCore response
      static interface  HttpCore.ResponseHandler<T>
      Interface for an entity that performs type-specific processing on an httpCore response
    • Field Summary

      Fields 
      Modifier and Type Field Description
      int port  
      java.lang.String scheme  
    • Field Detail

      • scheme

        public final java.lang.String scheme
      • port

        public final int port
    • Method Detail

      • httpExecuteWithRetry

        public <T> T httpExecuteWithRetry​(java.net.URL url,
                                          java.lang.String method,
                                          Param[] headers,
                                          HttpCore.RequestBody requestBody,
                                          HttpCore.ResponseHandler<T> responseHandler,
                                          boolean requireAblyAuth)
                                   throws AblyException
        Make a synchronous HTTP request specified by URL and proxy, retrying if necessary on WWW-Authenticate
        Parameters:
        url -
        method -
        headers -
        requestBody -
        responseHandler -
        Returns:
        Throws:
        AblyException
      • setPreferredHost

        public void setPreferredHost​(java.lang.String host)
        Sets host for this HTTP client
        Parameters:
        host - URL string
      • getPreferredHost

        public java.lang.String getPreferredHost()
        Gets host for this HTTP client
        Returns:
      • getPrimaryHost

        public java.lang.String getPrimaryHost()
        Gets host for this HTTP client
        Returns:
      • httpExecute

        public <T> T httpExecute​(java.net.URL url,
                                 java.net.Proxy proxy,
                                 java.lang.String method,
                                 Param[] headers,
                                 HttpCore.RequestBody requestBody,
                                 boolean withCredentials,
                                 HttpCore.ResponseHandler<T> responseHandler)
                          throws AblyException
        Make a synchronous HTTP request specified by URL and proxy
        Parameters:
        url -
        proxy -
        method -
        headers -
        requestBody -
        withCredentials -
        responseHandler -
        Returns:
        Throws:
        AblyException