use of com.microsoft.azure.toolkit.lib.springcloud.config.SpringCloudAppConfig in project azure-tools-for-java by Microsoft.
the class SpringCloudAppPropertiesEditor method getConfig.
@Nonnull
private SpringCloudAppConfig getConfig() {
final SpringCloudAppConfig config = this.formConfig.getData();
config.setSubscriptionId(this.app.subscriptionId());
config.setClusterName(this.app.getCluster().name());
config.setAppName(this.app.name());
return config;
}
use of com.microsoft.azure.toolkit.lib.springcloud.config.SpringCloudAppConfig in project azure-tools-for-java by Microsoft.
the class SpringCloudDeploymentConfigurationPanel method setData.
public synchronized void setData(SpringCloudAppConfig appConfig) {
final SpringCloudCluster cluster = Azure.az(AzureSpringCloud.class).cluster(appConfig.getClusterName());
if (Objects.nonNull(cluster) && !cluster.app(appConfig.getAppName()).exists()) {
this.selectorApp.addLocalItem(cluster.app(appConfig));
}
final SpringCloudDeploymentConfig deploymentConfig = appConfig.getDeployment();
final AzureArtifactManager manager = AzureArtifactManager.getInstance(this.project);
Optional.ofNullable(deploymentConfig.getArtifact()).map(a -> ((WrappedAzureArtifact) a)).ifPresent((a -> this.selectorArtifact.setArtifact(a.getArtifact())));
Optional.ofNullable(appConfig.getSubscriptionId()).ifPresent((id -> this.selectorSubscription.setValue(new ItemReference<>(id, Subscription::getId))));
Optional.ofNullable(appConfig.getClusterName()).ifPresent((id -> this.selectorCluster.setValue(new ItemReference<>(id, SpringCloudCluster::name))));
Optional.ofNullable(appConfig.getAppName()).ifPresent((id -> this.selectorApp.setValue(new ItemReference<>(id, SpringCloudApp::name))));
}
use of com.microsoft.azure.toolkit.lib.springcloud.config.SpringCloudAppConfig in project azure-tools-for-java by Microsoft.
the class SpringCloudDeploymentConfigurationPanel method getData.
@Nullable
public SpringCloudAppConfig getData() {
SpringCloudAppConfig appConfig = this.selectorApp.getValue().entity().getConfig();
if (Objects.isNull(appConfig)) {
appConfig = SpringCloudAppConfig.builder().deployment(SpringCloudDeploymentConfig.builder().build()).build();
}
this.getData(appConfig);
return appConfig;
}
Aggregations