-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy pathAfdConfigurationClientManager.cs
More file actions
57 lines (48 loc) · 1.6 KB
/
AfdConfigurationClientManager.cs
File metadata and controls
57 lines (48 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
//
using Azure.Data.AppConfiguration;
using Microsoft.Extensions.Azure;
using System;
using System.Collections.Generic;
namespace Microsoft.Extensions.Configuration.AzureAppConfiguration.Afd
{
internal class AfdConfigurationClientManager : IConfigurationClientManager
{
private readonly ConfigurationClientWrapper _clientWrapper;
public AfdConfigurationClientManager(
IAzureClientFactory<ConfigurationClient> clientFactory,
Uri endpoint)
{
if (clientFactory == null)
{
throw new ArgumentNullException(nameof(clientFactory));
}
if (endpoint == null)
{
throw new ArgumentNullException(nameof(endpoint));
}
_clientWrapper = new ConfigurationClientWrapper(endpoint, clientFactory.CreateClient(endpoint.AbsoluteUri));
}
public IEnumerable<ConfigurationClient> GetClients()
{
return new List<ConfigurationClient> { _clientWrapper.Client };
}
public void RefreshClients()
{
return;
}
public bool UpdateSyncToken(Uri endpoint, string syncToken)
{
return false;
}
public Uri GetEndpointForClient(ConfigurationClient client)
{
if (client == null)
{
throw new ArgumentNullException(nameof(client));
}
return _clientWrapper.Client == client ? _clientWrapper.Endpoint : null;
}
}
}