Skip to content

Commit a08194c

Browse files
committed
remove unused interface
1 parent 2d2ffaf commit a08194c

File tree

4 files changed

+8
-17
lines changed

4 files changed

+8
-17
lines changed

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

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,6 @@ private const val NOTIFICATION_ENDPOINT = "https://idetoolkits-hostedfiles.amazo
2727
private const val MAX_RETRIES = 3
2828
private const val RETRY_DELAY_MS = 1000L
2929

30-
interface NotificationPollingService {
31-
fun startPolling()
32-
fun addObserver(observer: (Path) -> Unit)
33-
fun dispose()
34-
}
35-
3630
object NotificationFileValidator : RemoteResolveParser {
3731
override fun canBeParsed(data: InputStream): Boolean {
3832
return try {
@@ -45,9 +39,8 @@ object NotificationFileValidator : RemoteResolveParser {
4539
}
4640

4741
@Service(Service.Level.APP)
48-
class NotificationPollingServiceImpl :
49-
NotificationPollingService,
50-
PersistentStateComponent<NotificationPollingServiceImpl.State>,
42+
class NotificationPollingService :
43+
PersistentStateComponent<NotificationPollingService.State>,
5144
Disposable {
5245

5346
private val observers = mutableListOf<(Path) -> Unit>()
@@ -61,7 +54,7 @@ class NotificationPollingServiceImpl :
6154
override val remoteResolveParser: RemoteResolveParser = NotificationFileValidator
6255
}
6356

64-
override fun startPolling() {
57+
fun startPolling() {
6558
val newNotifications = pollForNotifications()
6659
if (newNotifications) {
6760
getCachedPath()?.let { path ->
@@ -126,7 +119,7 @@ class NotificationPollingServiceImpl :
126119
fun getCachedPath(): Path? =
127120
state.cachedFilePath?.let { Paths.get(it) }
128121

129-
override fun addObserver(observer: (Path) -> Unit) {
122+
fun addObserver(observer: (Path) -> Unit) {
130123
observers.add(observer)
131124
}
132125

@@ -139,7 +132,7 @@ class NotificationPollingServiceImpl :
139132
}
140133

141134
companion object {
142-
private val LOG = getLogger<NotificationPollingServiceImpl>()
135+
private val LOG = getLogger<NotificationPollingService>()
143136
fun getInstance(): NotificationPollingService =
144137
ApplicationManager.getApplication().getService(NotificationPollingService::class.java)
145138
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import com.intellij.openapi.startup.ProjectActivity
1010
class NotificationServiceInitializer : ProjectActivity {
1111

1212
override suspend fun execute(project: Project) {
13-
val service = NotificationPollingServiceImpl.getInstance()
13+
val service = NotificationPollingService.getInstance()
1414
RunOnceUtil.runOnceForApp(this::class.qualifiedName.toString()) {
1515
service.startPolling()
1616
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ object NotificationMapperUtil {
1616

1717
class ProcessNotificationsBase {
1818
init {
19-
NotificationPollingServiceImpl.getInstance().addObserver { path ->
19+
NotificationPollingService.getInstance().addObserver { path ->
2020
getNotificationsFromFile(path)
2121
}
2222
}

plugins/core/src/main/resources/META-INF/plugin.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@
2323
<applicationService serviceImplementation="migration.software.aws.toolkits.jetbrains.core.coroutines.PluginCoroutineScopeTracker"/>
2424
<projectService serviceImplementation="migration.software.aws.toolkits.jetbrains.core.coroutines.PluginCoroutineScopeTracker"/>
2525
<postStartupActivity implementation = "software.aws.toolkits.jetbrains.core.notifications.NotificationServiceInitializer"/>
26-
<applicationService
27-
serviceInterface="software.aws.toolkits.jetbrains.core.notifications.NotificationPollingService"
28-
serviceImplementation="software.aws.toolkits.jetbrains.core.notifications.NotificationPollingServiceImpl"/>
26+
<applicationService serviceImplementation="software.aws.toolkits.jetbrains.core.notifications.NotificationPollingService"/>
2927
</extensions>
3028
<projectListeners>
3129
<listener class="software.aws.toolkits.jetbrains.services.telemetry.OpenedFileTypesMetricsListener" topic="com.intellij.openapi.fileEditor.FileEditorManagerListener"/>

0 commit comments

Comments
 (0)