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

java.lang.Object
io.helidon.discovery.providers.eureka.CacheConfig.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>, ConfigBuilderSupport.ConfiguredBuilder<BUILDER,PROTOTYPE>
Direct Known Subclasses:
CacheConfig.Builder
Enclosing interface:
CacheConfig

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

    • BuilderBase

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

    • from

      public BUILDER from(CacheConfig 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(CacheConfig.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

      @Deprecated 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 CacheConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends CacheConfig>
      Parameters:
      config - configuration instance used to obtain values to update this builder
      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 CacheConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends CacheConfig>
      Parameters:
      config - configuration instance used to obtain values to update this builder
      Returns:
      updated builder instance
    • computeChanges

      public BUILDER computeChanges(boolean computeChanges)
      Whether the state of the cache should be computed from changes reported by Eureka, or replaced in full; true by default.
      Parameters:
      computeChanges - whether the state of the cache should be computed
      Returns:
      updated builder instance
      See Also:
    • deferSync

      public BUILDER deferSync(boolean deferSync)
      Whether to defer immediate cache synchronization; false by default.
      Parameters:
      deferSync - true if cache synchronization should be deferred until it is actually needed
      Returns:
      updated builder instance
      See Also:
    • enabled

      public BUILDER enabled(boolean enabled)
      Whether a local cache of Eureka information is used or not; true by default.
      Parameters:
      enabled - true if the cache should be used
      Returns:
      updated builder instance
      See Also:
    • fetchThreadName

      public BUILDER fetchThreadName(String fetchThreadName)
      The name of the Thread used to retrieve service information from the Eureka server; "Eureka registry fetch thread" by default.
      Parameters:
      fetchThreadName - the name of the Thread used to retrieve service information from the Eureka server
      Returns:
      updated builder instance
      See Also:
    • syncInterval

      public BUILDER syncInterval(Duration syncInterval)
      The time between retrievals of service information from the Eureka server; 30 seconds by default.
      Parameters:
      syncInterval - the time between retrievals of service information from the Eureka server
      Returns:
      updated builder instance
      See Also:
    • computeChanges

      public boolean computeChanges()
      Whether the state of the cache should be computed from changes reported by Eureka, or replaced in full; true by default.
      Returns:
      the compute changes
    • deferSync

      public boolean deferSync()
      Whether to defer immediate cache synchronization; false by default.
      Returns:
      the defer sync
    • enabled

      public boolean enabled()
      Whether a local cache of Eureka information is used or not; true by default.
      Returns:
      the enabled
    • fetchThreadName

      public String fetchThreadName()
      The name of the Thread used to retrieve service information from the Eureka server; "Eureka registry fetch thread" by default.
      Returns:
      the fetch thread name
      See Also:
    • syncInterval

      public Duration syncInterval()
      The time between retrievals of service information from the Eureka server; 30 seconds by default.
      Returns:
      the sync interval
      See Also:
    • config

      public Optional<Config> config()
      If this instance was configured, this would be the config instance used.
      Returns:
      config node used to configure this builder, or empty if not configured
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • preBuildPrototype

      protected void preBuildPrototype()
      Handles providers and decorators.
    • validatePrototype

      protected void validatePrototype()
      Validates required properties.