Class CommunicationRelayAsyncClient
java.lang.Object
com.azure.communication.networktraversal.CommunicationRelayAsyncClient
Asynchronous client interface for Azure Communication Network Traversal
operations
Instantiating an asynchronous CommunicationRelayClient
// You can find your endpoint and access key from your resource in the Azure Portal String endpoint = "https://<RESOURCE_NAME>.communication.azure.com"; AzureKeyCredential keyCredential = new AzureKeyCredential("<access-key>"); CommunicationRelayAsyncClient communicationRelayClient = new CommunicationRelayClientBuilder() .endpoint(endpoint) .credential(keyCredential) .buildAsyncClient();
View this
for additional ways to construct the client.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionGets a Relay Configuration.Gets a Relay Configuration for a CommunicationUserIdentifier.Gets a Relay Configuration for a CommunicationUserIdentifier given options with response.
-
Method Details
-
getRelayConfiguration
Gets a Relay Configuration.Sample code for getting a relay configuration without parameters
CommunicationRelayClient communicationRelayClient = createCommunicationNetworkTraversalClient(); CommunicationRelayConfiguration config = communicationRelayClient.getRelayConfiguration(); System.out.println("Expires on:" + config.getExpiresOn()); List<CommunicationIceServer> iceServers = config.getIceServers(); for (CommunicationIceServer iceS : iceServers) { System.out.println("URLS: " + iceS.getUrls()); System.out.println("Username: " + iceS.getUsername()); System.out.println("Credential: " + iceS.getCredential()); System.out.println("RouteType: " + iceS.getRouteType()); }
- Returns:
- The obtained Communication Relay Configuration.
-
getRelayConfiguration
public Mono<CommunicationRelayConfiguration> getRelayConfiguration(GetRelayConfigurationOptions options) Gets a Relay Configuration for a CommunicationUserIdentifier.Sample code for getting a relay configuration
CommunicationIdentityClient communicationIdentityClient = createCommunicationIdentityClient(); CommunicationUserIdentifier user = communicationIdentityClient.createUser(); System.out.println("User id: " + user.getId()); GetRelayConfigurationOptions options = new GetRelayConfigurationOptions(); options.setCommunicationUserIdentifier(user); CommunicationRelayClient communicationRelayClient = createCommunicationNetworkTraversalClient(); CommunicationRelayConfiguration config = communicationRelayClient.getRelayConfiguration(options); System.out.println("Expires on:" + config.getExpiresOn()); List<CommunicationIceServer> iceServers = config.getIceServers(); for (CommunicationIceServer iceS : iceServers) { System.out.println("URLS: " + iceS.getUrls()); System.out.println("Username: " + iceS.getUsername()); System.out.println("Credential: " + iceS.getCredential()); System.out.println("RouteType: " + iceS.getRouteType()); }
- Parameters:
options
- of the GetRelayConfigurationOptions request- Returns:
- The obtained Communication Relay Configuration.
-
getRelayConfigurationWithResponse
public Mono<Response<CommunicationRelayConfiguration>> getRelayConfigurationWithResponse(GetRelayConfigurationOptions options) Gets a Relay Configuration for a CommunicationUserIdentifier given options with response.- Parameters:
options
- of the GetRelayConfigurationOptions request- Returns:
- The obtained Communication Relay Configuration.
-