Skip to content

Commit 8546d4a

Browse files
committed
endpoint as registryKey
1 parent 26caf31 commit 8546d4a

File tree

2 files changed

+7
-16
lines changed

2 files changed

+7
-16
lines changed

plugins/core/jetbrains-community/resources/META-INF/aws.toolkit.core.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@
7777
restartRequired="true"/>
7878
<registryKey key="aws.toolkit.developerMode" description="Enables features to facilitate development of the toolkit" restartRequired="false"
7979
defaultValue="false"/>
80+
<registryKey key="aws.toolkit.notification.endpoint" description="Endpoint for AWS Toolkit notifications"
81+
defaultValue=""/>
82+
8083

8184
<notificationGroup id="aws.plugin.version.mismatch" displayType="STICKY_BALLOON" key="aws.settings.title"/>
8285

plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/notifications/NotificationPollingService.kt

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ import com.fasterxml.jackson.module.kotlin.readValue
77
import com.intellij.openapi.Disposable
88
import com.intellij.openapi.application.ApplicationManager
99
import com.intellij.openapi.components.Service
10+
import com.intellij.openapi.util.registry.Registry
1011
import com.intellij.util.Alarm
1112
import com.intellij.util.AlarmFactory
1213
import com.intellij.util.io.HttpRequests
1314
import kotlinx.coroutines.delay
1415
import kotlinx.coroutines.runBlocking
15-
import org.jetbrains.annotations.VisibleForTesting
1616
import software.aws.toolkits.core.utils.RemoteResolveParser
1717
import software.aws.toolkits.core.utils.RemoteResource
1818
import software.aws.toolkits.core.utils.error
@@ -40,23 +40,11 @@ object NotificationFileValidator : RemoteResolveParser {
4040
}
4141

4242
object NotificationEndpoint {
43-
private var overriddenEndpoint: String? = null
44-
45-
fun getEndpoint(): String = overriddenEndpoint ?: DEFAULT_ENDPOINT
46-
47-
@VisibleForTesting
48-
fun setTestEndpoint(endpoint: String) {
49-
overriddenEndpoint = endpoint
50-
}
51-
52-
@VisibleForTesting
53-
fun resetEndpoint() {
54-
overriddenEndpoint = null
55-
}
56-
57-
private const val DEFAULT_ENDPOINT = "" // TODO: Replace with actual endpoint
43+
fun getEndpoint(): String =
44+
Registry.get("aws.toolkit.notification.endpoint").asString()
5845
}
5946

47+
6048
@Service(Service.Level.APP)
6149
internal final class NotificationPollingService : Disposable {
6250
private val isFirstPoll = AtomicBoolean(true)

0 commit comments

Comments
 (0)