Skip to content

Commit 3396c43

Browse files
committed
Add missing properties for service link
1 parent 3b66acd commit 3396c43

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

PluginsAndFeatures/azure-toolkit-for-intellij/src/com/microsoft/azure/toolkit/intellij/link/mysql/MySQLConnectionUtils.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,16 @@
55

66
package com.microsoft.azure.toolkit.intellij.link.mysql;
77

8+
import com.microsoft.azuretools.ActionConstants;
9+
import com.microsoft.azuretools.telemetry.TelemetryConstants;
10+
import com.microsoft.azuretools.telemetrywrapper.EventType;
11+
import com.microsoft.azuretools.telemetrywrapper.EventUtil;
812
import com.mysql.cj.jdbc.ConnectionImpl;
913
import lombok.AllArgsConstructor;
1014
import lombok.Getter;
1115

1216
import java.sql.*;
17+
import java.util.Collections;
1318

1419
public class MySQLConnectionUtils {
1520

@@ -45,6 +50,9 @@ public static ConnectResult connectWithPing(String url, String username, String
4550
} catch (ClassNotFoundException | SQLException exception) {
4651
errorMessage = exception.getMessage();
4752
}
53+
EventUtil.logEvent(EventType.info, ActionConstants.parse(ActionConstants.MySQL.TEST_CONNECTION).getServiceName(),
54+
ActionConstants.parse(ActionConstants.MySQL.TEST_CONNECTION).getOperationName(),
55+
Collections.singletonMap("result", String.valueOf(connected)));
4856
return new ConnectResult(connected, errorMessage, pingCost, serverVersion);
4957
}
5058

PluginsAndFeatures/azure-toolkit-for-intellij/src/com/microsoft/azure/toolkit/lib/link/AzureLinkService.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
import com.microsoft.azure.toolkit.intellij.link.po.LinkPO;
1717
import com.microsoft.azure.toolkit.intellij.link.po.ModulePO;
1818
import com.microsoft.azure.toolkit.intellij.link.po.MySQLResourcePO;
19+
import com.microsoft.azuretools.ActionConstants;
20+
import com.microsoft.azuretools.telemetrywrapper.EventType;
21+
import com.microsoft.azuretools.telemetrywrapper.EventUtil;
1922
import com.microsoft.intellij.AzureLinkStorage;
2023
import com.microsoft.intellij.AzureMySQLStorage;
2124
import org.apache.commons.codec.digest.DigestUtils;
@@ -128,6 +131,8 @@ private String readPasswordCredentials(Project project, MySQLResourcePO service)
128131
passwordConfigReference.set(data);
129132
});
130133
dialog.show();
134+
EventUtil.logEvent(EventType.info, ActionConstants.parse(ActionConstants.MySQL.UPDATE_PASSWORD).getServiceName(),
135+
ActionConstants.parse(ActionConstants.MySQL.UPDATE_PASSWORD).getOperationName(), null);
131136
});
132137
PasswordConfig passwordConfig = passwordConfigReference.get();
133138
if (Objects.nonNull(passwordConfig)) {

Utils/azuretools-core/src/com/microsoft/azuretools/ActionConstants.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ public interface MySQL {
103103
String BIND_INTO = OPERATION_PREFIX + "bind-into";
104104
String LINK_TO_MODULE = OPERATION_PREFIX + "link-to-module";
105105
String DO_SERVICE_LINK = OPERATION_PREFIX + "do-link";
106+
String TEST_CONNECTION = OPERATION_PREFIX + "test-connection";
107+
String UPDATE_PASSWORD = OPERATION_PREFIX + "update-password";
106108
}
107109

108110
public interface SpringCloud {

0 commit comments

Comments
 (0)