Skip to content

Commit

Permalink
Release 1.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
anuchandy committed Mar 4, 2018
1 parent b0d19f8 commit 3589e20
Show file tree
Hide file tree
Showing 2 changed files with 119 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure</artifactId>
<version>1.6.0</version>
<version>1.7.0</version>
</dependency>
<dependency>
<groupId>commons-net</groupId>
<artifactId>commons-net</artifactId>
<version>3.3</version>
<version>3.6</version>
</dependency>
</dependencies>
</project>
117 changes: 117 additions & 0 deletions src/main/java/com/microsoft/azure/management/samples/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@
import com.microsoft.azure.management.dns.SrvRecordSet;
import com.microsoft.azure.management.dns.TxtRecord;
import com.microsoft.azure.management.dns.TxtRecordSet;
import com.microsoft.azure.management.eventhub.EventHubDisasterRecoveryPairing;
import com.microsoft.azure.management.eventhub.EventHubNamespace;
import com.microsoft.azure.management.eventhub.EventHub;
import com.microsoft.azure.management.eventhub.DisasterRecoveryPairingAuthorizationRule;
import com.microsoft.azure.management.eventhub.DisasterRecoveryPairingAuthorizationKey;
import com.microsoft.azure.management.eventhub.EventHubConsumerGroup;
import com.microsoft.azure.management.graphrbac.ActiveDirectoryApplication;
import com.microsoft.azure.management.graphrbac.ActiveDirectoryGroup;
import com.microsoft.azure.management.graphrbac.ActiveDirectoryObject;
Expand Down Expand Up @@ -2502,6 +2508,117 @@ public static void print(ContainerGroup resource) {
System.out.println(info.toString());
}

/**
* Print event hub namespace.
*
* @param resource a virtual machine
*/
public static void print(EventHubNamespace resource) {
StringBuilder info = new StringBuilder();
info.append("Eventhub Namespace: ").append(resource.id())
.append("\n\tName: ").append(resource.name())
.append("\n\tRegion: ").append(resource.region())
.append("\n\tTags: ").append(resource.tags())
.append("\n\tAzureInsightMetricId: ").append(resource.azureInsightMetricId())
.append("\n\tIsAutoScale enabled: ").append(resource.isAutoScaleEnabled())
.append("\n\tServiceBus endpoint: ").append(resource.serviceBusEndpoint())
.append("\n\tThroughPut upper limit: ").append(resource.throughputUnitsUpperLimit())
.append("\n\tCurrent ThroughPut: ").append(resource.currentThroughputUnits())
.append("\n\tCreated time: ").append(resource.createdAt())
.append("\n\tUpdated time: ").append(resource.updatedAt());

System.out.println(info.toString());
}

/**
* Print event hub.
*
* @param resource event hub
*/
public static void print(EventHub resource) {
StringBuilder info = new StringBuilder();
info.append("Eventhub: ").append(resource.id())
.append("\n\tName: ").append(resource.name())
.append("\n\tNamespace resource group: ").append(resource.namespaceResourceGroupName())
.append("\n\tNamespace: ").append(resource.namespaceName())
.append("\n\tIs data capture enabled: ").append(resource.isDataCaptureEnabled())
.append("\n\tPartition ids: ").append(resource.partitionIds());
if (resource.isDataCaptureEnabled()) {
info.append("\n\t\t\tData capture window size in MB: ").append(resource.dataCaptureWindowSizeInMB());
info.append("\n\t\t\tData capture window size in seconds: ").append(resource.dataCaptureWindowSizeInSeconds());
if (resource.captureDestination() != null) {
info.append("\n\t\t\tData capture storage account: ").append(resource.captureDestination().storageAccountResourceId());
info.append("\n\t\t\tData capture storage container: ").append(resource.captureDestination().blobContainer());
}
}
System.out.println(info.toString());
}

/**
* Print event hub namespace recovery pairing.
*
* @param resource event hub namespace disaster recovery pairing
*/
public static void print(EventHubDisasterRecoveryPairing resource) {
StringBuilder info = new StringBuilder();
info.append("DisasterRecoveryPairing: ").append(resource.id())
.append("\n\tName: ").append(resource.name())
.append("\n\tPrimary namespace resource group name: ").append(resource.primaryNamespaceResourceGroupName())
.append("\n\tPrimary namespace name: ").append(resource.primaryNamespaceName())
.append("\n\tSecondary namespace: ").append(resource.secondaryNamespaceId())
.append("\n\tNamespace role: ").append(resource.namespaceRole());
System.out.println(info.toString());
}

/**
* Print event hub namespace recovery pairing auth rules.
*
* @param resource event hub namespace disaster recovery pairing auth rule
*/
public static void print(DisasterRecoveryPairingAuthorizationRule resource) {
StringBuilder info = new StringBuilder();
info.append("DisasterRecoveryPairing auth rule: ").append(resource.name());
List<String> rightsStr = new ArrayList<>();
for (com.microsoft.azure.management.eventhub.AccessRights rights : resource.rights()) {
rightsStr.add(rights.toString());
}
info.append("\n\tRights: ").append(rightsStr);
System.out.println(info.toString());
}

/**
* Print event hub namespace recovery pairing auth rule key.
*
* @param resource event hub namespace disaster recovery pairing auth rule key
*/
public static void print(DisasterRecoveryPairingAuthorizationKey resource) {
StringBuilder info = new StringBuilder();
info.append("DisasterRecoveryPairing auth key: ")
.append("\n\t Alias primary connection string: ").append(resource.aliasPrimaryConnectionString())
.append("\n\t Alias secondary connection string: ").append(resource.aliasSecondaryConnectionString())
.append("\n\t Primary key: ").append(resource.primaryKey())
.append("\n\t Secondary key: ").append(resource.secondaryKey())
.append("\n\t Primary connection string: ").append(resource.primaryConnectionString())
.append("\n\t Secondary connection string: ").append(resource.secondaryConnectionString());
System.out.println(info.toString());
}

/**
* Print event hub consumer group.
*
* @param resource event hub consumer group
*/
public static void print(EventHubConsumerGroup resource) {
StringBuilder info = new StringBuilder();
info.append("Event hub consumer group: ").append(resource.id())
.append("\n\tName: ").append(resource.name())
.append("\n\tNamespace resource group: ").append(resource.namespaceResourceGroupName())
.append("\n\tNamespace: ").append(resource.namespaceName())
.append("\n\tEvent hub name: ").append(resource.eventHubName())
.append("\n\tUser metadata: ").append(resource.userMetadata());
System.out.println(info.toString());
}

private static OkHttpClient httpClient;

/**
Expand Down

0 comments on commit 3589e20

Please sign in to comment.