-
- Type Parameters:
S
- the type of the stamp used by the source (such as byte[] with a digest of a file)
- All Known Implementing Classes:
ConfigSources.SystemPropertiesConfigSource
,DirectoryConfigSource
,EtcdConfigSource
,FileConfigSource
,FileOverrideSource
,GitConfigSource
,MapConfigSource
,UrlConfigSource
,UrlOverrideSource
public interface PollableSource<S>
A source implementing this interface provides support for polling using aPollingStrategy
. This is achieved through a stamp passed between the source and the strategy to check for changes.- See Also:
PollingStrategy
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
PollableSource.Builder<T extends PollableSource.Builder<T>>
A builder for pollable source.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
isModified(S stamp)
This method is invoked to check if this source has changed.Optional<PollingStrategy>
pollingStrategy()
If a polling strategy is configured with this source, return it.
-
-
-
Method Detail
-
isModified
boolean isModified(S stamp)
This method is invoked to check if this source has changed.- Parameters:
stamp
- the stamp of the last loaded content- Returns:
true
if the current data of this config source differ from the loaded data, including cases when the source has disappeared
-
pollingStrategy
Optional<PollingStrategy> pollingStrategy()
If a polling strategy is configured with this source, return it. The source implementation does not need to handle polling strategy.- Returns:
- polling strategy if one is configured on this source
-
-