Class HttpHubConnectionBuilder


  • public class HttpHubConnectionBuilder
    extends java.lang.Object
    A builder for configuring HubConnection instances.
    • Method Detail

      • withTransport

        public HttpHubConnectionBuilder withTransport​(TransportEnum transportEnum)
        Sets the transport type to indicate which transport to be used by the HubConnection.
        Parameters:
        transportEnum - The type of transport to be used.
        Returns:
        This instance of the HttpHubConnectionBuilder.
      • shouldSkipNegotiate

        public HttpHubConnectionBuilder shouldSkipNegotiate​(boolean skipNegotiate)
        Indicates to the HubConnection that it should skip the negotiate process. Note: This option only works with the Websockets transport and the Azure SignalR Service require the negotiate step.
        Parameters:
        skipNegotiate - Boolean indicating if the HubConnection should skip the negotiate step.
        Returns:
        This instance of the HttpHubConnectionBuilder.
      • withAccessTokenProvider

        public HttpHubConnectionBuilder withAccessTokenProvider​(io.reactivex.Single<java.lang.String> accessTokenProvider)
        Sets the access token provider for the HubConnection.
        Parameters:
        accessTokenProvider - The access token provider to be used by the HubConnection.
        Returns:
        This instance of the HttpHubConnectionBuilder.
      • withHandshakeResponseTimeout

        public HttpHubConnectionBuilder withHandshakeResponseTimeout​(long timeoutInMilliseconds)
        Sets the duration the HubConnection should wait for a Handshake Response from the server.
        Parameters:
        timeoutInMilliseconds - The duration (specified in milliseconds) that the HubConnection should wait for a Handshake Response from the server.
        Returns:
        This instance of the HttpHubConnectionBuilder.
      • withHeaders

        public HttpHubConnectionBuilder withHeaders​(java.util.Map<java.lang.String,​java.lang.String> headers)
        Sets a collection of Headers for the HubConnection to send with every Http request.
        Parameters:
        headers - A Map representing the collection of Headers that the HubConnection should send.
        Returns:
        This instance of the HttpHubConnectionBuilder.
      • withHeader

        public HttpHubConnectionBuilder withHeader​(java.lang.String name,
                                                   java.lang.String value)
        Sets a single header for the HubConnection to send.
        Parameters:
        name - The name of the header to set.
        value - The value of the header to be set.
        Returns:
        This instance of the HttpHubConnectionBuilder.