This repository has been archived by the owner on Dec 7, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add stub CdnService to turn off the app completely
- Loading branch information
Showing
3 changed files
with
50 additions
and
4 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
app/src/main/java/nl/rijksoverheid/en/applifecycle/service/EndOfLifeCdnService.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Copyright (c) 2020 De Staat der Nederlanden, Ministerie van Volksgezondheid, Welzijn en Sport. | ||
* Licensed under the EUROPEAN UNION PUBLIC LICENCE v. 1.2 | ||
* | ||
* SPDX-License-Identifier: EUPL-1.2 | ||
*/ | ||
package nl.rijksoverheid.en.applifecycle.service | ||
|
||
import nl.rijksoverheid.en.api.CacheStrategy | ||
import nl.rijksoverheid.en.api.CdnService | ||
import nl.rijksoverheid.en.api.model.AppConfig | ||
import nl.rijksoverheid.en.api.model.Manifest | ||
import nl.rijksoverheid.en.api.model.ResourceBundle | ||
import nl.rijksoverheid.en.api.model.RiskCalculationParameters | ||
import okhttp3.ResponseBody | ||
import retrofit2.Response | ||
|
||
/** | ||
* Stub implementation of [CdnService] that produces the appropriate response for the app | ||
* to show that is has been deactivated without hitting the server. | ||
*/ | ||
class EndOfLifeCdnService : CdnService { | ||
override suspend fun getExposureKeySetFile(id: String): Response<ResponseBody> { | ||
throw NotImplementedError() | ||
} | ||
|
||
override suspend fun getManifest(cacheStrategy: CacheStrategy?): Manifest { | ||
return Manifest(emptyList(), "", "end-of-life-id") | ||
} | ||
|
||
override suspend fun getRiskCalculationParameters( | ||
id: String, | ||
cacheStrategy: CacheStrategy? | ||
): RiskCalculationParameters { | ||
throw NotImplementedError() | ||
} | ||
|
||
override suspend fun getAppConfig(id: String, cacheStrategy: CacheStrategy?): AppConfig { | ||
return AppConfig(coronaMelderDeactivated = "deactivated") | ||
} | ||
|
||
override suspend fun getResourceBundle( | ||
id: String, | ||
cacheStrategy: CacheStrategy? | ||
): ResourceBundle { | ||
throw NotImplementedError() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters