use of com.microsoft.azure.toolkit.lib.appservice.model.JavaVersion in project azure-tools-for-java by Microsoft.
the class WebAppBasePropertyViewPresenter method generateProperty.
protected <T extends AppServiceBaseEntity> WebAppProperty generateProperty(@Nonnull final IAppService<T> appService, @Nonnull final IAppServicePlan plan) {
final AppServiceBaseEntity appServiceEntity = appService.entity();
final AppServicePlanEntity planEntity = plan.entity();
final Map<String, String> appSettingsMap = appServiceEntity.getAppSettings();
final Map<String, Object> propertyMap = new HashMap<>();
propertyMap.put(KEY_NAME, appServiceEntity.getName());
propertyMap.put(KEY_RESOURCE_GRP, appServiceEntity.getResourceGroup());
propertyMap.put(KEY_LOCATION, appServiceEntity.getRegion().getLabel());
propertyMap.put(KEY_SUB_ID, appService.subscriptionId());
propertyMap.put(KEY_STATUS, appService.state());
propertyMap.put(KEY_PLAN, plan.name());
propertyMap.put(KEY_URL, appService.hostName());
final PricingTier pricingTier = planEntity.getPricingTier();
propertyMap.put(KEY_PRICING, String.format("%s_%s", pricingTier.getTier(), pricingTier.getSize()));
final Runtime runtime = appService.getRuntime();
final JavaVersion javaVersion = runtime.getJavaVersion();
if (javaVersion != null && ObjectUtils.notEqual(javaVersion, JavaVersion.OFF)) {
propertyMap.put(KEY_JAVA_VERSION, javaVersion.getValue());
propertyMap.put(KEY_JAVA_CONTAINER, runtime.getWebContainer().getValue());
}
propertyMap.put(KEY_OPERATING_SYS, runtime.getOperatingSystem());
propertyMap.put(KEY_APP_SETTING, appSettingsMap);
return new WebAppProperty(propertyMap);
}
use of com.microsoft.azure.toolkit.lib.appservice.model.JavaVersion in project azure-tools-for-java by Microsoft.
the class AppServiceCreateDialog method fillWebContainers.
protected void fillWebContainers() {
try {
if (MavenUtils.isMavenProject(project)) {
packaging = MavenUtils.getPackaging(project);
}
} catch (Exception e) {
LOG.log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "fillWebContainers@AppServiceCreateDialog", e));
}
final boolean isJarPacking = packaging.equals("jar");
final JavaVersion jdkModel = getSelectedJavaVersion();
final List<WebContainer> webContainers = isJarPacking ? Arrays.asList(WebContainer.JAVA_SE) : listWindowsWebContainersForWarFile(jdkModel);
comboWebContainer.removeAll();
binderWebConteiners = new ArrayList<>();
for (int i = 0; i < webContainers.size(); i++) {
WebContainer webContainerMod = webContainers.get(i);
comboWebContainer.add(webContainerMod.toString());
binderWebConteiners.add(webContainerMod);
if (i == 0 || webContainerMod == DEFAULT_WEB_CONTAINER) {
comboWebContainer.select(i);
}
}
String webContainer = CommonUtils.getPreference(CommonUtils.RUNTIME_WEBCONTAINER);
CommonUtils.selectComboIndex(comboWebContainer, webContainer);
}
use of com.microsoft.azure.toolkit.lib.appservice.model.JavaVersion in project azure-tools-for-java by Microsoft.
the class AppServiceCreateDialog method fillJavaVersion.
protected void fillJavaVersion() {
binderJavaVersions = new ArrayList<JavaVersion>();
for (JavaVersion javaVersion : JavaVersion.values()) {
cbJavaVersion.add(javaVersion.toString());
binderJavaVersions.add(javaVersion);
if (Objects.equals(javaVersion, DEFAULT_JAVA_VERSION)) {
cbJavaVersion.select(binderJavaVersions.size() - 1);
}
}
String javaversion = CommonUtils.getPreference(CommonUtils.RUNTIME_JAVAVERSION);
CommonUtils.selectComboIndex(cbJavaVersion, javaversion);
}
Aggregations