All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.riskalyze.alerts.drivers.null.NullAlertsService.kt Maven / Gradle / Ivy

Go to download

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.drivers.`null`

import com.riskalyze.alerts.AlertsService
import com.riskalyze.alerts.models.Alert
import com.riskalyze.alerts.models.AlertResponse
import java.util.concurrent.CompletableFuture
import java.util.concurrent.CompletableFuture.completedFuture

internal class NullAlertsService: AlertsService {

    override fun send(alert: Alert): CompletableFuture {
        return emptySuccess()
    }

    override fun close(alias: String): CompletableFuture {
        return emptySuccess()
    }

    override fun report(exception: Exception, tags: List): CompletableFuture {
        return emptySuccess()
    }

    override fun info(message: String, description: String?, tags: List): CompletableFuture {
        return emptySuccess()
    }

    override fun low(message: String, description: String?, tags: List): CompletableFuture {
        return emptySuccess()
    }

    override fun moderate(message: String, description: String?, tags: List): CompletableFuture {
        return emptySuccess()
    }

    override fun high(message: String, description: String?, tags: List): CompletableFuture {
        return emptySuccess()
    }

    override fun critical(message: String, description: String?, tags: List): CompletableFuture {
        return emptySuccess()
    }

    private fun emptySuccess(): CompletableFuture {
        return completedFuture(AlertResponse("0", 0f))
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy