Package com.microsoft.signalr
Class HttpHubConnectionBuilder
- java.lang.Object
-
- com.microsoft.signalr.HttpHubConnectionBuilder
-
public class HttpHubConnectionBuilder extends java.lang.Object
A builder for configuringHubConnection
instances.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HubConnection
build()
Builds a new instance ofHubConnection
.HttpHubConnectionBuilder
shouldSkipNegotiate(boolean skipNegotiate)
Indicates to theHubConnection
that it should skip the negotiate process.HttpHubConnectionBuilder
withAccessTokenProvider(io.reactivex.Single<java.lang.String> accessTokenProvider)
Sets the access token provider for theHubConnection
.HttpHubConnectionBuilder
withHandshakeResponseTimeout(long timeoutInMilliseconds)
Sets the duration theHubConnection
should wait for a Handshake Response from the server.HttpHubConnectionBuilder
withHeader(java.lang.String name, java.lang.String value)
Sets a single header for theHubConnection
to send.HttpHubConnectionBuilder
withHeaders(java.util.Map<java.lang.String,java.lang.String> headers)
Sets a collection of Headers for theHubConnection
to send with every Http request.HttpHubConnectionBuilder
withTransport(TransportEnum transportEnum)
Sets the transport type to indicate which transport to be used by theHubConnection
.
-
-
-
Method Detail
-
withTransport
public HttpHubConnectionBuilder withTransport(TransportEnum transportEnum)
Sets the transport type to indicate which transport to be used by theHubConnection
.- Parameters:
transportEnum
- The type of transport to be used.- Returns:
- This instance of the HttpHubConnectionBuilder.
-
shouldSkipNegotiate
public HttpHubConnectionBuilder shouldSkipNegotiate(boolean skipNegotiate)
Indicates to theHubConnection
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 theHubConnection
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 theHubConnection
.- Parameters:
accessTokenProvider
- The access token provider to be used by theHubConnection
.- Returns:
- This instance of the HttpHubConnectionBuilder.
-
withHandshakeResponseTimeout
public HttpHubConnectionBuilder withHandshakeResponseTimeout(long timeoutInMilliseconds)
Sets the duration theHubConnection
should wait for a Handshake Response from the server.- Parameters:
timeoutInMilliseconds
- The duration (specified in milliseconds) that theHubConnection
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 theHubConnection
to send with every Http request.- Parameters:
headers
- A Map representing the collection of Headers that theHubConnection
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 theHubConnection
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.
-
build
public HubConnection build()
Builds a new instance ofHubConnection
.- Returns:
- A new instance of
HubConnection
.
-
-