Record Class TriggerRunningEvent
java.lang.Object
java.lang.Record
org.sterl.spring.persistent_tasks.trigger.event.TriggerRunningEvent
- All Implemented Interfaces:
PersistentTasksEvent,HasTrigger,TriggerLifeCycleEvent
public record TriggerRunningEvent(Long id, TriggerEntity data, Serializable state, String runningOn)
extends Record
implements TriggerLifeCycleEvent
Event fired before a trigger is executed
This event is maybe not in a transaction and so a transactional event listener will not work.
-
Constructor Summary
ConstructorsConstructorDescriptionTriggerRunningEvent(Long id, TriggerEntity data, Serializable state, String runningOn) Creates an instance of aTriggerRunningEventrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondata()Returns the value of thedatarecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.booleanisDone()If a trigger is done, it finished it's execution either successfully or with an final error without retries left.booleanisRunningOn(String name) Returns the value of therunningOnrecord component.state()Returns the value of thestaterecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.sterl.spring.persistent_tasks.shared.model.HasTrigger
executionCount, isRunning, key, newTaskId, shouldRunInFuture, statusMethods inherited from interface org.sterl.spring.persistent_tasks.trigger.event.TriggerLifeCycleEvent
getData, getId, timePassedMs
-
Constructor Details
-
Method Details
-
isRunningOn
-
isDone
public boolean isDone()Description copied from interface:TriggerLifeCycleEventIf a trigger is done, it finished it's execution either successfully or with an final error without retries left.- Specified by:
isDonein interfaceTriggerLifeCycleEvent- Returns:
trueif the trigger was completed, either with success, error or canceled.
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
id
Returns the value of theidrecord component.- Specified by:
idin interfaceTriggerLifeCycleEvent- Returns:
- the value of the
idrecord component
-
data
Returns the value of thedatarecord component.- Specified by:
datain interfaceTriggerLifeCycleEvent- Returns:
- the value of the
datarecord component
-
state
Returns the value of thestaterecord component.- Specified by:
statein interfaceTriggerLifeCycleEvent- Returns:
- the value of the
staterecord component
-
runningOn
Returns the value of therunningOnrecord component.- Returns:
- the value of the
runningOnrecord component
-