Class DiscoveryClient
- Namespace
- Steeltoe.Discovery.Eureka
- Assembly
- Steeltoe.Discovery.Eureka.dll
public class DiscoveryClient : IEurekaClient, ILookupService
- Inheritance
-
DiscoveryClient
- Implements
-
- Derived
-
- Inherited Members
-
Constructors
DiscoveryClient(ApplicationInfoManager, ILoggerFactory)
protected DiscoveryClient(ApplicationInfoManager appInfoManager, ILoggerFactory logFactory = null)
Parameters
appInfoManager
ApplicationInfoManager
logFactory
ILoggerFactory
DiscoveryClient(IEurekaClientConfig, IEurekaHttpClient, ILoggerFactory)
public DiscoveryClient(IEurekaClientConfig clientConfig, IEurekaHttpClient httpClient = null, ILoggerFactory logFactory = null)
Parameters
clientConfig
IEurekaClientConfig
httpClient
IEurekaHttpClient
logFactory
ILoggerFactory
Fields
_appInfoManager
protected ApplicationInfoManager _appInfoManager
Field Value
- ApplicationInfoManager
_cacheRefreshTimer
protected Timer _cacheRefreshTimer
Field Value
- Timer
_heartBeatTimer
protected Timer _heartBeatTimer
Field Value
- Timer
_httpClient
protected IEurekaHttpClient _httpClient
Field Value
- IEurekaHttpClient
_localRegionApps
protected volatile Applications _localRegionApps
Field Value
- Applications
_logger
protected ILogger _logger
Field Value
- ILogger
_random
Field Value
- Random
_registryFetchCounter
protected long _registryFetchCounter
Field Value
- long
_regularLogger
protected ILogger _regularLogger
Field Value
- ILogger
_shutdown
Field Value
- int
_startupLogger
protected ILogger _startupLogger
Field Value
- ILogger
Properties
Applications
public Applications Applications { get; }
Property Value
- Applications
ClientConfig
public virtual IEurekaClientConfig ClientConfig { get; }
Property Value
- IEurekaClientConfig
HealthCheckHandler
public IHealthCheckHandler HealthCheckHandler { get; set; }
Property Value
- IHealthCheckHandler
HttpClient
public IEurekaHttpClient HttpClient { get; }
Property Value
- IEurekaHttpClient
LastGoodDeltaRegistryFetchTimestamp
public long LastGoodDeltaRegistryFetchTimestamp { get; }
Property Value
- long
LastGoodFullRegistryFetchTimestamp
public long LastGoodFullRegistryFetchTimestamp { get; }
Property Value
- long
LastGoodHeartbeatTimestamp
public long LastGoodHeartbeatTimestamp { get; }
Property Value
- long
LastGoodRegisterTimestamp
public long LastGoodRegisterTimestamp { get; }
Property Value
- long
LastGoodRegistryFetchTimestamp
public long LastGoodRegistryFetchTimestamp { get; }
Property Value
- long
LastRemoteInstanceStatus
public InstanceStatus LastRemoteInstanceStatus { get; }
Property Value
- InstanceStatus
Methods
FetchFullRegistryAsync()
protected Task<Applications> FetchFullRegistryAsync()
Returns
- Task<Applications>
FetchRegistryAsync(bool)
protected Task<bool> FetchRegistryAsync(bool fullUpdate)
Parameters
fullUpdate
bool
Returns
- Task<bool>
FetchRegistryDeltaAsync()
protected Task<Applications> FetchRegistryDeltaAsync()
Returns
- Task<Applications>
GetApplication(string)
public Application GetApplication(string appName)
Parameters
appName
string
Returns
- Application
GetInstanceById(string)
public IList<InstanceInfo> GetInstanceById(string id)
Parameters
id
string
Returns
- IList<InstanceInfo>
GetInstanceRemoteStatus()
public InstanceStatus GetInstanceRemoteStatus()
Returns
- InstanceStatus
GetInstancesByVipAddress(string, bool)
public IList<InstanceInfo> GetInstancesByVipAddress(string vipAddress, bool secure)
Parameters
vipAddress
string
secure
bool
Returns
- IList<InstanceInfo>
GetInstancesByVipAddressAndAppName(string, string, bool)
public IList<InstanceInfo> GetInstancesByVipAddressAndAppName(string vipAddress, string appName, bool secure)
Parameters
vipAddress
string
appName
string
secure
bool
Returns
- IList<InstanceInfo>
GetNextServerFromEureka(string, bool)
public InstanceInfo GetNextServerFromEureka(string vipAddress, bool secure)
Parameters
vipAddress
string
secure
bool
Returns
- InstanceInfo
Initialize()
protected void Initialize()
InitializeAsync()
protected Task InitializeAsync()
Returns
- Task
RefreshInstanceInfo()
protected void RefreshInstanceInfo()
RegisterAsync()
protected Task<bool> RegisterAsync()
Returns
- Task<bool>
RegisterDirtyInstanceInfo(InstanceInfo)
protected Task<bool> RegisterDirtyInstanceInfo(InstanceInfo inst)
Parameters
inst
InstanceInfo
Returns
- Task<bool>
RenewAsync()
protected Task<bool> RenewAsync()
Returns
- Task<bool>
ShutdownAsync()
public virtual Task ShutdownAsync()
Returns
- Task
StartTimer(string, int, Action)
protected Timer StartTimer(string name, int interval, Action task)
Parameters
name
string
interval
int
task
Action
Returns
- Timer
UnregisterAsync()
protected Task<bool> UnregisterAsync()
Returns
- Task<bool>
Events
OnApplicationsChange
public event EventHandler<Applications> OnApplicationsChange
Event Type
- EventHandler<Applications>