Class AbstractSourceBuilder<B extends AbstractSourceBuilder<B,​U>,​U>

    • Constructor Detail

      • AbstractSourceBuilder

        public AbstractSourceBuilder()
    • Method Detail

      • config

        protected B config​(Config metaConfig)
        Configure builder from meta configuration.

        The following configuration options are supported:

        Optional configuration parameters
        key default value description
        optional false Configure to true if this source should not fail configuration setup when underlying data is missing.
        polling-strategy No polling strategy is added by default Meta configuration of a polling strategy to be used with this source, add configuration to properties sub node.
        change-watcher No change watcher is added by default Meta configuration of a change watcher to be used with this source, add configuration to properties sub node.
        retry-policy No retry policy is added by default Meta configuration of a retry policy to be used to load this source, add configuration to properties sub node.
        Parameters:
        metaConfig - meta configuration of this source
        Returns:
        updated builder instance
      • retryPolicy

        public B retryPolicy​(Supplier<? extends RetryPolicy> policy)
        Description copied from interface: Source.Builder
        Configure a retry policy to be used with this source. If none is configured, the source is invoked directly with no retries.
        Specified by:
        retryPolicy in interface Source.Builder<B extends AbstractSourceBuilder<B,​U>>
        Parameters:
        policy - retry policy to use
        Returns:
        updated builder instance
      • optional

        public B optional​(boolean optional)
        Description copied from interface: Source.Builder
        Whether the source is optional or not. When configured to be optional, missing underlying data do not cause an exception to be raised.
        Specified by:
        optional in interface Source.Builder<B extends AbstractSourceBuilder<B,​U>>
        Parameters:
        optional - true when this source should be optional
        Returns:
        updated builder instance
      • changeWatcher

        protected B changeWatcher​(ChangeWatcher<U> changeWatcher)
        Configure a change watcher. This method must be exposed by builders of sources that change watching (WatchableSource). The type of the change watcher must match the type of the target of this source.
        Parameters:
        changeWatcher - change watcher to use, such as FileSystemWatcher
        Returns:
        updated builder instance
      • pollingStrategy

        protected B pollingStrategy​(PollingStrategy pollingStrategy)
        Configure a polling strategy. This method must be exposed by builders of sources that support polling. If you see this method as being protected in your builder, the source has removed support for polling, such as ClasspathConfigSource.
        Parameters:
        pollingStrategy - polling strategy to use
        Returns:
        updated builder instance