Class RemoteConfigManager<T>
Class to handle fetching of remote config objects.
Inherited Members
Namespace: Cognite.Extractor.Utils
Assembly: ExtractorUtils.dll
Syntax
public class RemoteConfigManager<T> where T : VersionedConfig
Type Parameters
Name | Description |
---|---|
T |
Constructors
| Edit this page View SourceRemoteConfigManager(CogniteDestination, ILogger?, RemoteConfig, RemoteConfigState<T>, string?, bool, int[]?)
Constructor.
Declaration
public RemoteConfigManager(CogniteDestination destination, ILogger? logger, RemoteConfig remoteConfig, RemoteConfigState<T> state, string? configFilePath, bool bufferConfigFile, int[]? acceptedConfigVersions)
Parameters
Type | Name | Description |
---|---|---|
CogniteDestination | destination | Cognite destination to use to fetch data from CDF. |
ILogger | logger | Logger to use |
RemoteConfig | remoteConfig | Remote config object |
RemoteConfigState<T> | state | Shared remote config manager state |
string | configFilePath | Path to local config file, used for buffering. |
bool | bufferConfigFile | True to buffer the config file. |
int[] | acceptedConfigVersions | List of accepted values of the "version" parameter, or null. |
Properties
| Edit this page View SourceConfig
Current configuration object, if fetched.
Declaration
public T? Config { get; }
Property Value
Type | Description |
---|---|
T |
Revision
Current revision, 0 if it is not known.
Declaration
public int Revision { get; }
Property Value
Type | Description |
---|---|
int |
UpdatePeriod
Period between each check for new config revisions.
Declaration
public ITimeSpanProvider UpdatePeriod { get; set; }
Property Value
Type | Description |
---|---|
ITimeSpanProvider |
Methods
| Edit this page View SourceFetchLatest(CancellationToken)
Fetch latest configuration file from CDF.
Declaration
public Task<T?> FetchLatest(CancellationToken token)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | token | Cancellation token. |
Returns
Type | Description |
---|---|
Task<T> | The new configuration object if one was found. If none was found or the revision number was unchanged, this returns null. |