Class HybridConnectionClient

java.lang.Object
com.microsoft.azure.relay.HybridConnectionClient
All Implemented Interfaces:
RelayTraceSource

public class HybridConnectionClient extends Object implements RelayTraceSource
  • Constructor Details

    • HybridConnectionClient

      public HybridConnectionClient(URI address)
      Create a new HybridConnectionClient instance for initiating HybridConnections where no client authentication is required.
      Parameters:
      address - The address on which to listen for HybridConnections. This address should be of the format "sb://contoso.servicebus.windows.net/yourhybridconnection".
    • HybridConnectionClient

      public HybridConnectionClient(URI address, TokenProvider tokenProvider)
      Create a new HybridConnectionClient instance for initiating HybridConnections with client authentication.
      Parameters:
      address - The address on which to listen for HybridConnections. This address should be of the format "sb://contoso.servicebus.windows.net/yourhybridconnection".
      tokenProvider - The TokenProvider for authenticating this HybridConnection client.
    • HybridConnectionClient

      public HybridConnectionClient(String connectionString) throws URISyntaxException
      Create a new HybridConnectionClient instance for initiating HybridConnections.
      Parameters:
      connectionString - The connection string to use. This connection string must include the EntityPath property.
      Throws:
      URISyntaxException - Thrown when the format of the connectionSring is incorrect
    • HybridConnectionClient

      public HybridConnectionClient(String connectionString, String path) throws URISyntaxException
      Create a new HybridConnectionListener instance for initiating HybridConnections.
      Parameters:
      connectionString - The connection string to use. This connection string must include the EntityPath property.
      path - The path to the HybridConnection.
      Throws:
      URISyntaxException - Thrown when the format of the connectionSring is incorrect
  • Method Details

    • getAddress

      public URI getAddress()
      The address on which this HybridConnection will connect to. This address should be of the format "sb://contoso.servicebus.windows.net/yourhybridconnection".
    • getTokenProvider

      public TokenProvider getTokenProvider()
      Returns:
      Get the TokenProvider for authenticating this HybridConnection listener.
    • getOperationTimeout

      public Duration getOperationTimeout()
      Returns:
      The default timeout for connecting a HybridConnection. Default value is 70 seconds.
    • setOperationTimeout

      public void setOperationTimeout(Duration operationTimeout)
    • getTrackingContext

      public TrackingContext getTrackingContext()
      Specified by:
      getTrackingContext in interface RelayTraceSource
    • toString

      public String toString()
      Specified by:
      toString in interface RelayTraceSource
      Overrides:
      toString in class Object
    • createConnectionAsync

      public CompletableFuture<HybridConnectionChannel> createConnectionAsync()
      Establishes a new send-side HybridConnection and returns the websocket with established connections.
      Returns:
      A CompletableFuture which returns the ClientWebSocket instance when its connection established with the remote endpoint.
    • createConnectionAsync

      public CompletableFuture<HybridConnectionChannel> createConnectionAsync(Map<String,List<String>> customHeaders)
      Establishes a new send-side HybridConnection and returns the websocket with established connections.
      Parameters:
      customHeaders - Headers to add to the connection HTTP request.
      Returns:
      A CompletableFuture which returns the ClientWebSocket instance when its connection established with the remote endpoint.