Skip to content

Commit 8a32c02

Browse files
Merge pull request #6961 from microsoft/endgame-202209
Endgame 202209
2 parents 387fc85 + 85a8fd5 commit 8a32c02

9 files changed

Lines changed: 23 additions & 245 deletions

File tree

PluginsAndFeatures/azure-toolkit-for-eclipse/com.microsoft.azuretools.azureexplorer/src/com/microsoft/azuretools/azureexplorer/forms/OpenSSLFinderForm.java

Lines changed: 0 additions & 172 deletions
This file was deleted.

PluginsAndFeatures/azure-toolkit-for-eclipse/com.microsoft.azuretools.azureexplorer/src/com/microsoft/azuretools/azureexplorer/helpers/UIHelperImpl.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,10 @@
2929
import com.microsoft.azuretools.azureexplorer.editors.container.ContainerRegistryExplorerEditorInput;
3030
import com.microsoft.azuretools.azureexplorer.editors.rediscache.RedisExplorerEditor;
3131
import com.microsoft.azuretools.azureexplorer.editors.rediscache.RedisExplorerEditorInput;
32-
import com.microsoft.azuretools.azureexplorer.forms.OpenSSLFinderForm;
3332
import com.microsoft.azuretools.azureexplorer.views.RedisPropertyView;
3433
import com.microsoft.azuretools.core.utils.PluginUtil;
3534
import com.microsoft.azuretools.telemetry.TelemetryConstants;
3635
import com.microsoft.azuretools.telemetrywrapper.EventUtil;
37-
import com.microsoft.tooling.msservices.components.DefaultLoader;
3836
import com.microsoft.tooling.msservices.helpers.UIHelper;
3937
import com.microsoft.tooling.msservices.serviceexplorer.Node;
4038
import com.microsoft.tooling.msservices.serviceexplorer.azure.container.ContainerRegistryNode;
@@ -121,14 +119,6 @@ public File showFileSaver(String title, String name) {
121119
}
122120
}
123121

124-
@Override
125-
public String promptForOpenSSLPath() {
126-
OpenSSLFinderForm openSSLFinderForm = new OpenSSLFinderForm(PluginUtil.getParentShell());
127-
openSSLFinderForm.open();
128-
129-
return DefaultLoader.getIdeHelper().getProperty("MSOpenSSLPath", "");
130-
}
131-
132122
@Override
133123
public boolean isDarkTheme() {
134124
return false;

PluginsAndFeatures/azure-toolkit-for-eclipse/com.microsoft.azuretools.core/src/com/microsoft/azuretools/core/azureexplorer/helpers/IDEHelperImpl.java

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -43,65 +43,34 @@ public void executeOnPooledThread(final Runnable runnable) {
4343
AzureTaskManager.getInstance().runOnPooledThread(runnable);
4444
}
4545

46-
@Override
47-
public String getProperty(String name, Object projectObject) {
48-
return getProperty(name);
49-
}
50-
5146
public String getProperty(Object projectObject, String name, String defaultValue) {
5247
return null;
5348
}
5449

55-
@Override
56-
public void setProperty(String name, String value, Object projectObject) {
57-
setProperty(name, value);
58-
}
59-
60-
@Override
61-
public void unsetProperty(String name, Object projectObject) {
62-
unsetProperty(name);
63-
}
64-
6550
public boolean isPropertySet(Object projectObject, String name) {
6651
return false;
6752
}
6853

69-
@Override
7054
public String getProperty(String name) {
7155
return PreferenceUtil.loadPreference(name);
7256
}
7357

74-
@Override
75-
public String getPropertyWithDefault(String name, String defaultValue) {
76-
return PreferenceUtil.loadPreference(name, defaultValue);
77-
}
78-
79-
@Override
8058
public void setProperty(String name, String value) {
8159
PreferenceUtil.savePreference(name, value);
8260
}
8361

84-
@Override
8562
public void unsetProperty(String name) {
8663
PreferenceUtil.unsetPreference(name);
8764
}
8865

89-
@Override
9066
public boolean isPropertySet(String name) {
9167
return getProperty(name) != null;
9268
}
9369

94-
@Override
9570
public String[] getProperties(String name) {
9671
return PreferenceUtil.loadPreferences(name);
9772
}
9873

99-
@Override
100-
public String[] getProperties(String name, Object project) {
101-
return getProperties(name);
102-
}
103-
104-
@Override
10574
public void setProperties(String name, String[] value) {
10675
PreferenceUtil.savePreferences(name, value);
10776
}

PluginsAndFeatures/azure-toolkit-for-eclipse/com.microsoft.azuretools.hdinsight/src/com/microsoft/azuretools/hdinsight/Activator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ public void start(BundleContext context) throws Exception {
4545

4646
com.microsoft.azuretools.azureexplorer.helpers.HDInsightHelperImpl.initHDInsightLoader();
4747

48-
String enabledProperty = DefaultLoader.getIdeHelper().getProperty(Messages.HDInsightFeatureEnabled);
48+
String enabledProperty = DefaultLoader.getIdeHelper().getApplicationProperty(Messages.HDInsightFeatureEnabled);
4949
if(StringHelper.isNullOrWhiteSpace(enabledProperty)) {
5050
AppInsightsClient.create(Messages.HDInsightFeatureEnabled, context.getBundle().getVersion().toString());
51-
DefaultLoader.getIdeHelper().setProperty(Messages.HDInsightFeatureEnabled, "true");
51+
DefaultLoader.getIdeHelper().setApplicationProperty(Messages.HDInsightFeatureEnabled, "true");
5252
}
5353
HDInsightJobViewUtils.checkInitlize();
5454
}

PluginsAndFeatures/azure-toolkit-for-eclipse/com.microsoft.azuretools.hdinsight/src/com/microsoft/azuretools/hdinsight/projects/SparkLibraryOptionsPanel.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,12 +180,12 @@ public void widgetSelected(SelectionEvent e) {
180180
}
181181

182182
updateNextPageStatus();
183-
DefaultLoader.getIdeHelper().setProperties(CommonConst.CACHED_SPARK_SDK_PATHS, comboBoxAddSparkManually.getItems());
183+
DefaultLoader.getIdeHelper().setApplicationProperties(CommonConst.CACHED_SPARK_SDK_PATHS, comboBoxAddSparkManually.getItems());
184184
}
185185
}
186186
});
187187

188-
String[] tmp = DefaultLoader.getIdeHelper().getProperties(CommonConst.CACHED_SPARK_SDK_PATHS);
188+
String[] tmp = DefaultLoader.getIdeHelper().getApplicationProperties(CommonConst.CACHED_SPARK_SDK_PATHS);
189189
if (tmp != null) {
190190
cachedLibraryPath.addAll(Arrays.asList(tmp));
191191
}
@@ -220,7 +220,7 @@ public void widgetSelected(SelectionEvent arg0) {
220220
comboBoxAddSparkManually.setData(file, new SparkLibraryInfoForEclipse(file));
221221
comboBoxAddSparkManually.select(0);
222222
updateNextPageStatus();
223-
DefaultLoader.getIdeHelper().setProperties(CommonConst.CACHED_SPARK_SDK_PATHS, comboBoxAddSparkManually.getItems());
223+
DefaultLoader.getIdeHelper().setApplicationProperties(CommonConst.CACHED_SPARK_SDK_PATHS, comboBoxAddSparkManually.getItems());
224224
} catch (Exception e) {
225225
Activator.getDefault().log("Error adding Spark library", e);
226226
}

PluginsAndFeatures/azure-toolkit-for-eclipse/com.microsoft.azuretools.hdinsight/src/com/microsoft/azuretools/hdinsight/util/HDInsightJobViewUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ private static void extractJobViewResource() {
5454
FileUtils.copyURLToFile(url, htmlToFile);
5555
FileUtils.copyURLToFile(hdinsightJobViewJarUrl, hdinsightJobViewToFile);
5656
HDInsightJobViewUtils.unzip(htmlToFile.getAbsolutePath(), htmlToFile.getParent());
57-
DefaultLoader.getIdeHelper().setProperty(HDINSIGHT_JOBVIEW_EXTRACT_FLAG, "true");
57+
DefaultLoader.getIdeHelper().setApplicationProperty(HDINSIGHT_JOBVIEW_EXTRACT_FLAG, "true");
5858
} catch (IOException e) {
5959
DefaultLoader.getUIHelper().showError("Extract Job View Folder error:" + e.getMessage(), "Job view");
6060
}

Utils/azure-toolkit-ide-libs/azure-toolkit-ide-appservice-lib/src/main/java/com/microsoft/azuretools/core/mvp/model/webapp/WebAppSettingModel.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public class WebAppSettingModel {
3939
private String newSlotConfigurationSource;
4040
// create related
4141
private String webAppName = "";
42+
private boolean creatingResGrp = false;
4243
private String resourceGroup = "";
4344
private boolean creatingAppServicePlan = false;
4445
private String appServicePlanName = "";
@@ -97,6 +98,7 @@ public Map<String, String> getTelemetryProperties(Map<String, String> properties
9798
result.put(TelemetryConstants.SUBSCRIPTIONID, getSubscriptionId());
9899
result.put(TelemetryConstants.CREATE_NEWWEBAPP, String.valueOf(isCreatingNew()));
99100
result.put(TelemetryConstants.CREATE_NEWASP, String.valueOf(isCreatingAppServicePlan()));
101+
result.put(TelemetryConstants.CREATE_NEWRG, String.valueOf(isCreatingResGrp()));
100102
result.put(TelemetryConstants.FILETYPE, FilenameUtils.getExtension(getTargetName()));
101103
result.put(TelemetryConstants.PRICING_TIER, pricing);
102104
result.put(TelemetryConstants.REGION, region);

Utils/hdinsight-node-common/src/com/microsoft/azure/hdinsight/sdk/cluster/HDInsightNewAPI/ClusterOperationNewAPIImpl.java

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,8 @@ public Observable<Map> getClusterCoreSiteRequest(@NotNull final String clusterId
5858
.get(url, null, null, Map.class);
5959
}
6060

61-
private Observable<ClusterConfiguration> getClusterConfigurationFromManagementEndpoint(
62-
@NotNull final String clusterId) {
63-
String managementURI = Azure.az(AzureCloud.class).getOrDefault().getManagementEndpoint();
61+
private Observable<ClusterConfiguration> getClusterConfigurationRequest(
62+
@NotNull final String clusterId, String managementURI) {
6463
String url = URI.create(managementURI)
6564
.resolve(clusterId.replaceAll("/+$", "") + "/configurations").toString();
6665
StringEntity entity = new StringEntity("", StandardCharsets.UTF_8);
@@ -70,22 +69,11 @@ private Observable<ClusterConfiguration> getClusterConfigurationFromManagementEn
7069
.post(url, entity, null, null, ClusterConfiguration.class);
7170
}
7271

73-
private Observable<ClusterConfiguration> getClusterConfigurationFromResourceManagerEndpoint(
74-
@NotNull final String clusterId) {
75-
String managementURI = Azure.az(AzureCloud.class).getOrDefault().getResourceManagerEndpoint();
76-
String url = URI.create(managementURI)
77-
.resolve(clusterId.replaceAll("/+$", "") + "/configurations").toString();
78-
StringEntity entity = new StringEntity("", StandardCharsets.UTF_8);
79-
entity.setContentType("application/json");
80-
return getHttp()
81-
.withUuidUserAgent()
82-
.post(url, entity, null, null, ClusterConfiguration.class);
83-
}
8472

8573
public Observable<Boolean> isProbeGetConfigurationSucceed(final ClusterRawInfo clusterRawInfo) {
8674
String clusterId = clusterRawInfo.getId();
87-
88-
return getClusterConfigurationFromResourceManagerEndpoint(clusterId)
75+
String managementURI = Azure.az(AzureCloud.class).getOrDefault().getResourceManagerEndpoint();
76+
return getClusterConfigurationRequest(clusterId,managementURI)
8977
.map(clusterConfiguration -> {
9078
if (isClusterConfigurationValid(clusterRawInfo, clusterConfiguration)) {
9179
setRoleType(HDInsightUserRoleType.OWNER);
@@ -176,13 +164,14 @@ public com.microsoft.azure.hdinsight.sdk.cluster.ClusterConfiguration getCluster
176164
try {
177165
switch (roleType) {
178166
case OWNER:
179-
return getClusterConfigurationFromManagementEndpoint(clusterId)
167+
String managementURI = Azure.az(AzureCloud.class).getOrDefault().getManagementEndpoint();
168+
return getClusterConfigurationRequest(clusterId,managementURI)
180169
// As you can see, the response class is
181170
// com.microsoft.azure.hdinsight.sdk.cluster.HDInsightNewAPI.ClusterConfiguration.
182171
// However, if we want to override method getClusterConfiguration, the method return type should be
183172
// com.microsoft.azure.hdinsight.sdk.cluster.ClusterConfiguration.
184173
// Therefore, we need to convert the new API response to old API.
185-
.map(ClusterOperationNewAPIImpl::convertConfigurationToOldAPI)
174+
.map(ClusterOperationNewAPIImpl::convertConfigurationToOldAPI)
186175
.toBlocking()
187176
.singleOrDefault(null);
188177
case READER:

0 commit comments

Comments
 (0)