use of com.microsoft.azure.toolkit.lib.springcloud.SpringCloudCluster in project azure-tools-for-java by Microsoft.
the class AbstractSpringCloudAppInfoPanel method onClusterChanged.
private void onClusterChanged(final ItemEvent e) {
if (e.getStateChange() == ItemEvent.SELECTED || e.getStateChange() == ItemEvent.DESELECTED) {
final SpringCloudCluster c = (SpringCloudCluster) e.getItem();
final String appName = StringUtils.firstNonBlank(this.getTextName().getName(), this.defaultAppName);
final SpringCloudApp app = c.app(new SpringCloudAppEntity(appName, c.entity()));
this.onAppChanged(app);
}
}
use of com.microsoft.azure.toolkit.lib.springcloud.SpringCloudCluster in project azure-tools-for-java by Microsoft.
the class SpringCloudDeploymentConfigurationState method execute.
@AzureOperation(name = "springcloud|app.create_update", params = { "this.config.getAppConfig().getAppName()" }, type = AzureOperation.Type.ACTION)
public SpringCloudDeployment execute(IAzureMessager messager) {
AzureMessager.getContext().setMessager(messager);
AzureTelemetry.getContext().setProperties(getTelemetryProperties());
final SpringCloudAppConfig appConfig = this.config.getAppConfig();
final DeploySpringCloudAppTask task = new DeploySpringCloudAppTask(appConfig);
final SpringCloudDeployment deployment = task.execute();
final SpringCloudApp app = deployment.app();
final SpringCloudCluster cluster = app.getCluster();
if (!deployment.waitUntilReady(GET_STATUS_TIMEOUT)) {
messager.warning(GET_DEPLOYMENT_STATUS_TIMEOUT, NOTIFICATION_TITLE);
}
printPublicUrl(app);
return deployment;
}
use of com.microsoft.azure.toolkit.lib.springcloud.SpringCloudCluster in project azure-tools-for-java by Microsoft.
the class SpringCloudExplorerContributor method getModuleNode.
@Override
public Node<?> getModuleNode() {
final AzureActionManager am = AzureActionManager.getInstance();
final IAzureMessager messager = AzureMessager.getDefaultMessager();
final AzureSpringCloud service = az(AzureSpringCloud.class);
return new Node<>(service).view(new AzureServiceLabelView<>(service, "Spring Cloud", ICON)).actions(SpringCloudActionsContributor.SERVICE_ACTIONS).addChildren(AzureSpringCloud::clusters, (cluster, ascNode) -> new Node<>(cluster).view(new AzureResourceLabelView<>(cluster)).actions(SpringCloudActionsContributor.CLUSTER_ACTIONS).addChildren(SpringCloudCluster::apps, (app, clusterNode) -> new Node<>(app).view(new AzureResourceLabelView<>(app)).actions(SpringCloudActionsContributor.APP_ACTIONS)));
}
use of com.microsoft.azure.toolkit.lib.springcloud.SpringCloudCluster in project azure-tools-for-java by Microsoft.
the class SpringCloudDeploymentConfigurationPanel method onClusterChanger.
private void onClusterChanger(final ItemEvent e) {
if (e.getStateChange() == ItemEvent.SELECTED || e.getStateChange() == ItemEvent.DESELECTED) {
final SpringCloudCluster cluster = (SpringCloudCluster) e.getItem();
this.selectorApp.setCluster(cluster);
}
}
use of com.microsoft.azure.toolkit.lib.springcloud.SpringCloudCluster 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))));
}
Aggregations