Package eu.cloudhopper.mc.annotations
Annotation Interface ScheduledTrigger
Declares that the annotated function should be executed on a schedule.
This annotation can be used in combination with Function to define
time-based triggers using cron expressions. It enables the generation of scheduled
tasks for serverless platforms that support them (e.g. AWS EventBridge, GCP Cloud Scheduler).
Example
@Function(name = "dailyTask")
@ScheduledTrigger(cron = "0 0 * * *", timezone = "Europe/Berlin")
public Void runDailyTask() {
// perform daily task
return null;
}
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classConstants representing attribute names ofScheduledTrigger. -
Required Element Summary
Required Elements -
Optional Element Summary
Optional Elements
-
Element Details
-
cron
String cronA cron expression defining when the function should run.Uses standard Unix cron syntax (e.g.,
"0 0 * * *"for daily at midnight).- Returns:
- cron expression
-
timezone
String timezoneThe IANA time zone in which the cron expression should be evaluated.Defaults to
"UTC"if not specified.- Returns:
- time zone ID (e.g., "UTC", "Europe/Berlin")
- Default:
"UTC"
-