
com.riskalyze.alerts.AlertsServiceFactory.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of alerts-kotlin Show documentation
Show all versions of alerts-kotlin Show documentation
This alerts module is used to standardize alerting for JVM-based application. It uses a modular driver system to allow easily swapping out alerting services.
The newest version!
package com.riskalyze.alerts
import com.riskalyze.alerts.drivers.`null`.NullAlertsService
import com.riskalyze.alerts.drivers.opsgenie.OpsGenieAdapter
import com.riskalyze.alerts.drivers.opsgenie.OpsGenieAlertsService
import com.riskalyze.alerts.enumerations.ServiceDriver
import com.riskalyze.alerts.enumerations.ServiceDriver.NULL
import com.riskalyze.alerts.enumerations.ServiceDriver.OPS_GENIE
import com.riskalyze.alerts.http.OkHttpClient
import com.riskalyze.alerts.models.Credentials
class AlertsServiceFactory {
fun make(driver: ServiceDriver, credentials: Credentials): AlertsService = when (driver) {
OPS_GENIE -> OpsGenieAlertsService(OkHttpClient(), OpsGenieAdapter(), credentials)
NULL -> NullAlertsService()
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy