Skip to content

Commit

Permalink
Update README and CHANGELOG
Browse files Browse the repository at this point in the history
  • Loading branch information
AriZavala2 committed Nov 17, 2021
1 parent 16a6737 commit 5ecf04c
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# Release History

## 1.0.0-beta.2 (Unreleased)
## 1.0.0-beta.2 (2021-11-18)

### Features Added

- Made User Identity an optional parameter when getting a Relay Configuration.
- Added RouteType as optional parameter when getting a Relay Configuration so users can
choose the routing type protocol of the requested Relay Configuration.

### Breaking Changes

### Bugs Fixed
Expand All @@ -17,5 +21,6 @@ The first preview of the Azure Communication Relay Client has the following feat
- get a relay configuration by creating a CommunicationRelayClient

### Features Added

- Added CommunicationRelayClient in preview.
- Added CommunicationRelayClient.getRelayConfiguration in preview.
62 changes: 51 additions & 11 deletions sdk/communication/azure-communication-networktraversal/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ It will provide TURN credentials to a user.
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-communication-networktraversal</artifactId>
<version>1.0.0-beta.1</version>
<version>1.0.0-beta.3</version>
</dependency>
```

Expand Down Expand Up @@ -81,7 +81,8 @@ CommunicationRelayClient communicationRelayClient = new CommunicationRelayClient

## Examples

### Getting a new Relay Configuration
### Getting a new Relay Configuration providing a user

Use the `createUser` function to create a new user from CommunicationIdentityClient
Use the `getRelayConfiguration` function to get a Relay Configuration

Expand All @@ -96,14 +97,53 @@ System.out.println("User id: " + user.getId());

CommunicationRelayConfiguration config = communicationRelayClient.getRelayConfiguration(user);

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("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());
}
```

### Getting a new Relay Configuration without providing a user

<!-- embedme ./src/samples/java/com/azure/communication/networktraversal/ReadmeSamples.java#L116-L127 -->
```java
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());
}
return config;
```

### Getting a new Relay Configuration providing a Route Type

<!-- embedme ./src/samples/java/com/azure/communication/networktraversal/ReadmeSamples.java#L137-L48 -->
```java
CommunicationRelayClient communicationRelayClient = createCommunicationNetworkTraversalClient();
CommunicationRelayConfiguration config = communicationRelayClient.getRelayConfiguration(RouteType.ANY);

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());
}
return config;
```

## Troubleshooting
Expand Down Expand Up @@ -141,4 +181,4 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m
[product_docs]: https://docs.microsoft.com/azure/communication-services/
[api_documentation]: https://aka.ms/java-docs

![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fcommunication%2Fazure-communication-networktraversal%2FREADME.png)
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fcommunication%2Fazure-communication-networktraversal%2FREADME.png)
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.azure.communication.identity.CommunicationIdentityClient;
import com.azure.communication.identity.CommunicationIdentityClientBuilder;
import com.azure.communication.networktraversal.models.CommunicationRelayConfiguration;
import com.azure.communication.networktraversal.models.RouteType;
import com.azure.communication.networktraversal.models.CommunicationIceServer;
import java.util.List;

Expand Down Expand Up @@ -93,15 +94,58 @@ public CommunicationRelayConfiguration getRelayConfiguration() {

CommunicationRelayClient communicationRelayClient = createCommunicationNetworkTraversalClient();
CommunicationRelayConfiguration config = communicationRelayClient.getRelayConfiguration(user);


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());
}
return config;
}

/**
* Sample code for getting a relay configuration without identity
*
* @return the created user
*/
public CommunicationRelayConfiguration getRelayConfigurationWithoutIdentity() {
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());
}
return config;
}

/**
* Sample code for getting a relay configuration providing RouteType
*
* @return the created user
*/
public CommunicationRelayConfiguration getRelayConfigurationWithRouteType() {
CommunicationRelayClient communicationRelayClient = createCommunicationNetworkTraversalClient();
CommunicationRelayConfiguration config = communicationRelayClient.getRelayConfiguration(RouteType.ANY);

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());
}
return config;
}

Expand Down

0 comments on commit 5ecf04c

Please sign in to comment.