Search in sources :

Example 1 with MySQLProperty

use of com.microsoft.tooling.msservices.serviceexplorer.azure.mysql.MySQLProperty in project azure-tools-for-java by Microsoft.

the class MySQLPropertyView method refreshProperty.

private void refreshProperty(String sid, String resourceGroup, String name) {
    final MySQLProperty newProperty = new MySQLProperty();
    newProperty.setSubscriptionId(sid);
    // find server
    try {
        newProperty.setServer(Azure.az(AzureMySql.class).subscription(sid).get(resourceGroup, name));
    } catch (final Exception ex) {
        final String error = "find Azure Database for MySQL server information";
        final String action = "confirm your network is available and your server actually exists.";
        throw new AzureToolkitRuntimeException(error, action);
    }
    if (StringUtils.equalsIgnoreCase("READY", newProperty.getServer().entity().getState())) {
        // find firewalls
        newProperty.setFirewallRules(newProperty.getServer().firewallRules().list());
    }
    this.property = newProperty;
}
Also used : AzureMySql(com.microsoft.azure.toolkit.lib.mysql.AzureMySql) AzureToolkitRuntimeException(com.microsoft.azure.toolkit.lib.common.exception.AzureToolkitRuntimeException) MySQLProperty(com.microsoft.tooling.msservices.serviceexplorer.azure.mysql.MySQLProperty) AzureToolkitRuntimeException(com.microsoft.azure.toolkit.lib.common.exception.AzureToolkitRuntimeException)

Aggregations

AzureToolkitRuntimeException (com.microsoft.azure.toolkit.lib.common.exception.AzureToolkitRuntimeException)1 AzureMySql (com.microsoft.azure.toolkit.lib.mysql.AzureMySql)1 MySQLProperty (com.microsoft.tooling.msservices.serviceexplorer.azure.mysql.MySQLProperty)1