Class CronConfig.BuilderBase<BUILDER extends CronConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends CronConfig>

java.lang.Object
io.helidon.scheduling.TaskConfig.BuilderBase<BUILDER, PROTOTYPE>
io.helidon.scheduling.CronConfig.BuilderBase<BUILDER, PROTOTYPE>
Type Parameters:
BUILDER - type of the builder extending this abstract builder
PROTOTYPE - type of the prototype interface that would be built by Prototype.Builder.buildPrototype()
All Implemented Interfaces:
Prototype.Builder<BUILDER, PROTOTYPE>, ConfigBuilderSupport.ConfiguredBuilder<BUILDER, PROTOTYPE>
Direct Known Subclasses:
CronConfig.Builder
Enclosing interface:
CronConfig

public abstract static class CronConfig.BuilderBase<BUILDER extends CronConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends CronConfig> extends TaskConfig.BuilderBase<BUILDER, PROTOTYPE> implements ConfigBuilderSupport.ConfiguredBuilder<BUILDER, PROTOTYPE>
Fluent API builder base for CronConfig.
  • Constructor Details

    • BuilderBase

      protected BuilderBase()
      Protected to support extensibility.
  • Method Details

    • from

      public BUILDER from(CronConfig prototype)
      Update this builder from an existing prototype instance. This method disables automatic service discovery.
      Parameters:
      prototype - existing prototype to update this builder from
      Returns:
      updated builder instance
    • from

      public BUILDER from(CronConfig.BuilderBase<?,?> builder)
      Update this builder from an existing prototype builder instance.
      Parameters:
      builder - existing builder prototype to update this builder from
      Returns:
      updated builder instance
    • config

      public BUILDER config(Config config)
      Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.
      Specified by:
      config in interface ConfigBuilderSupport.ConfiguredBuilder<BUILDER extends CronConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends CronConfig>
      Overrides:
      config in class TaskConfig.BuilderBase<BUILDER extends CronConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends CronConfig>
      Parameters:
      config - configuration instance used to obtain values to update this builder
      Returns:
      updated builder instance
    • expression

      public BUILDER expression(String expression)
      Cron expression for specifying period of execution.

      Examples:

      • 0/2 * * * * ? * - Every 2 seconds
      • 0 45 9 ? * * - Every day at 9:45
      • 0 15 8 ? * MON-FRI - Every workday at 8:15
      Parameters:
      expression - cron expression
      Returns:
      updated builder instance
      See Also:
    • zone

      public BUILDER zone(ZoneId zone)
      Time zone to use for cron expression evaluation. Defaults to ZoneId.systemDefault().

      The time zone determines when the cron expression triggers. For example, a cron expression 0 0 9 * * ? (every day at 9:00 AM) with zone America/New_York will trigger at 9:00 AM Eastern Time, regardless of the system's default time zone.

      Parameters:
      zone - time zone for cron expression evaluation
      Returns:
      updated builder instance
      See Also:
    • concurrentExecution

      public BUILDER concurrentExecution(boolean concurrentExecution)
      Allow concurrent execution if previous task didn't finish before next execution. Default value is true.
      Parameters:
      concurrentExecution - true for allow concurrent execution.
      Returns:
      updated builder instance
      See Also:
    • task

      Task to be scheduled for execution.
      Parameters:
      task - scheduled for execution
      Returns:
      updated builder instance
      See Also:
    • expression

      public Optional<String> expression()
      Cron expression for specifying period of execution.

      Examples:

      • 0/2 * * * * ? * - Every 2 seconds
      • 0 45 9 ? * * - Every day at 9:45
      • 0 15 8 ? * MON-FRI - Every workday at 8:15
      Returns:
      cron expression
    • zone

      public ZoneId zone()
      Time zone to use for cron expression evaluation. Defaults to ZoneId.systemDefault().

      The time zone determines when the cron expression triggers. For example, a cron expression 0 0 9 * * ? (every day at 9:00 AM) with zone America/New_York will trigger at 9:00 AM Eastern Time, regardless of the system's default time zone.

      Returns:
      time zone for cron expression evaluation
    • concurrentExecution

      public boolean concurrentExecution()
      Allow concurrent execution if previous task didn't finish before next execution. Default value is true.
      Returns:
      true for allow concurrent execution.
    • task

      Task to be scheduled for execution.
      Returns:
      scheduled for execution
    • toString

      public String toString()
      Overrides:
      toString in class TaskConfig.BuilderBase<BUILDER extends CronConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends CronConfig>
    • preBuildPrototype

      protected void preBuildPrototype()
      Handles providers and decorators.
      Overrides:
      preBuildPrototype in class TaskConfig.BuilderBase<BUILDER extends CronConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends CronConfig>
    • validatePrototype

      protected void validatePrototype()
      Validates required properties.
      Overrides:
      validatePrototype in class TaskConfig.BuilderBase<BUILDER extends CronConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends CronConfig>