- java.lang.Object
-
- io.helidon.config.AbstractSource
-
- io.helidon.config.UrlOverrideSource
-
- All Implemented Interfaces:
OverrideSource,PollableSource<Instant>,Source,WatchableSource<URL>,Supplier<OverrideSource>
public class UrlOverrideSource extends AbstractSource implements OverrideSource, PollableSource<Instant>, WatchableSource<URL>
OverrideSourceimplementation that loads configuration override content from specified endpoint URL.- See Also:
AbstractSource,OverrideSources
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classUrlOverrideSource.BuilderUrl Override Source Builder.-
Nested classes/interfaces inherited from interface io.helidon.config.spi.OverrideSource
OverrideSource.OverrideData
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static UrlOverrideSource.Builderbuilder()Create a new fluent API builder to create URL override source.Optional<ChangeWatcher<Object>>changeWatcher()A change watcher of this source, if it implementsWatchableSourceand has one configured.static UrlOverrideSourcecreate(Config metaConfig)Create a new URL override source from meta configuration.booleanisModified(Instant stamp)This method is invoked to check if this source has changed.Optional<ConfigContent.OverrideContent>load()Load override data from the underlying source.Optional<PollingStrategy>pollingStrategy()A polling strategy of this source, if it implementsPollableSourceand has one configured.URLtarget()The target of this source.Class<URL>targetType()Target type as supported by this source.protected Stringuid()Returns universal id of source to be used to constructAbstractSource.description().-
Methods inherited from class io.helidon.config.AbstractSource
description, optional, retryPolicy
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.helidon.config.spi.OverrideSource
get
-
Methods inherited from interface io.helidon.config.spi.Source
description, exists, optional, retryPolicy
-
-
-
-
Method Detail
-
create
public static UrlOverrideSource create(Config metaConfig)
Create a new URL override source from meta configuration.- Parameters:
metaConfig- meta configuration containing at least theurlkey- Returns:
- a new URL override source
-
builder
public static UrlOverrideSource.Builder builder()
Create a new fluent API builder to create URL override source.- Returns:
- a new builder
-
isModified
public boolean isModified(Instant stamp)
Description copied from interface:PollableSourceThis method is invoked to check if this source has changed.- Specified by:
isModifiedin interfacePollableSource<Instant>- Parameters:
stamp- the stamp of the last loaded content- Returns:
trueif the current data of this config source differ from the loaded data, including cases when the source has disappeared
-
pollingStrategy
public Optional<PollingStrategy> pollingStrategy()
Description copied from class:AbstractSourceA polling strategy of this source, if it implementsPollableSourceand has one configured.- Specified by:
pollingStrategyin interfacePollableSource<Instant>- Overrides:
pollingStrategyin classAbstractSource- Returns:
- polling strategy if any configured
-
target
public URL target()
Description copied from interface:WatchableSourceThe target of this source.- Specified by:
targetin interfaceWatchableSource<URL>- Returns:
- target this source is configured with, never
null
-
targetType
public Class<URL> targetType()
Description copied from interface:WatchableSourceTarget type as supported by this source.- Specified by:
targetTypein interfaceWatchableSource<URL>- Returns:
- class of the target, by default used for
WatchableSource.target()
-
changeWatcher
public Optional<ChangeWatcher<Object>> changeWatcher()
Description copied from class:AbstractSourceA change watcher of this source, if it implementsWatchableSourceand has one configured.- Specified by:
changeWatcherin interfaceWatchableSource<URL>- Overrides:
changeWatcherin classAbstractSource- Returns:
- change watcher if any configured
-
load
public Optional<ConfigContent.OverrideContent> load() throws ConfigException
Description copied from interface:OverrideSourceLoad override data from the underlying source.- Specified by:
loadin interfaceOverrideSource- Returns:
- override data if present, empty otherwise
- Throws:
ConfigException- in case the loading of data failed
-
uid
protected String uid()
Description copied from class:AbstractSourceReturns universal id of source to be used to constructAbstractSource.description().- Overrides:
uidin classAbstractSource- Returns:
- universal id of source
-
-