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

jvmMain.zakadabar.lib.schedule.business.events.kt Maven / Gradle / Ivy

There is a newer version: 2023.4.20
Show newest version
/*
 * Copyright © 2020-2021, Simplexion, Hungary and contributors. Use of this source code is governed by the Apache 2.0 license.
 */
package zakadabar.lib.schedule.business

import kotlinx.datetime.Instant
import zakadabar.core.data.EntityId
import zakadabar.core.util.UUID
import zakadabar.lib.schedule.data.Job
import zakadabar.lib.schedule.data.Subscription

interface DispatcherEvent {
    val actionNamespace: String?
    val actionType: String?
}

interface JobEvent : DispatcherEvent {
    override val actionNamespace: String
    override val actionType: String
    val jobId: EntityId
    val specific: Boolean
}

open class JobCreateEvent(
    override val actionNamespace: String,
    override val actionType: String,
    override val jobId: EntityId,
    override val specific: Boolean,
    val actionData : String,
    val startAt: Instant?
) : JobEvent

open class JobSuccessEvent(
    override val actionNamespace: String,
    override val actionType: String,
    override val jobId: EntityId,
    override val specific: Boolean,
) : JobEvent

open class JobFailEvent(
    override val actionNamespace: String,
    override val actionType: String,
    override val jobId: EntityId,
    override val specific: Boolean,
    val retryAt: Instant?,
    val actionData : String
) : JobEvent

open class JobCancelEvent(
    override val actionNamespace: String,
    override val actionType: String,
    override val jobId: EntityId,
    override val specific: Boolean
) : JobEvent

open class RequestJobCancelEvent(
    override val actionNamespace: String,
    override val actionType: String,
    override val jobId: EntityId,
    override val specific: Boolean
) : JobEvent

open class SubscriptionCreateEvent(
    override val actionNamespace: String?,
    override val actionType: String?,
    var subscriptionId: EntityId,
    var nodeUrl: String,
    var nodeId: UUID,
) : DispatcherEvent

open class SubscriptionDeleteEvent(
    override val actionNamespace: String?,
    override val actionType: String?,
    var subscriptionId: EntityId
) : DispatcherEvent

open class PushFailEvent(
    override val actionNamespace: String,
    override val actionType: String,
    override val jobId: EntityId,
    override val specific: Boolean
) : JobEvent

open class PendingCheckEvent(
    override val actionNamespace: String? = null,
    override val actionType: String? = null
) : DispatcherEvent




© 2015 - 2025 Weber Informatics LLC | Privacy Policy