Failover: code refactoring changes done.

This commit is contained in:
Shreyas Zare
2024-02-04 17:03:43 +05:30
parent 817da2ce96
commit 174bca03f3
5 changed files with 14 additions and 15 deletions

View File

@@ -1,6 +1,6 @@
/*
Technitium DNS Server
Copyright (C) 2023 Shreyas Zare (shreyas@technitium.com)
Copyright (C) 2024 Shreyas Zare (shreyas@technitium.com)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -37,7 +37,7 @@ namespace Failover
Secondary = 2
}
public class Address : IDnsApplication, IDnsAppRecordRequestHandler
public sealed class Address : IDnsApplication, IDnsAppRecordRequestHandler
{
#region variables

View File

@@ -1,6 +1,6 @@
/*
Technitium DNS Server
Copyright (C) 2023 Shreyas Zare (shreyas@technitium.com)
Copyright (C) 2024 Shreyas Zare (shreyas@technitium.com)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -29,7 +29,7 @@ using TechnitiumLibrary.Net.Dns.ResourceRecords;
namespace Failover
{
public class CNAME : IDnsApplication, IDnsAppRecordRequestHandler
public sealed class CNAME : IDnsApplication, IDnsAppRecordRequestHandler
{
#region variables
@@ -56,7 +56,7 @@ namespace Failover
#region private
private IReadOnlyList<DnsResourceRecord> GetAnswers(string domain, DnsQuestionRecord question, string zoneName, uint appRecordTtl, string healthCheck, Uri healthCheckUrl)
private DnsResourceRecord[] GetAnswers(string domain, DnsQuestionRecord question, string zoneName, uint appRecordTtl, string healthCheck, Uri healthCheckUrl)
{
HealthCheckResponse response = _healthService.QueryStatus(domain, question.Type, healthCheck, healthCheckUrl, true);
switch (response.Status)

View File

@@ -1,6 +1,6 @@
/*
Technitium DNS Server
Copyright (C) 2022 Shreyas Zare (shreyas@technitium.com)
Copyright (C) 2024 Shreyas Zare (shreyas@technitium.com)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -19,7 +19,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
using DnsServerCore.ApplicationCommon;
using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Mail;
using System.Text;
@@ -348,7 +347,7 @@ DNS Failover App
public bool Enabled
{ get { return _enabled; } }
public IReadOnlyList<MailAddress> AlertTo
public MailAddress[] AlertTo
{ get { return _alertTo; } }
public string SmtpServer

View File

@@ -1,6 +1,6 @@
/*
Technitium DNS Server
Copyright (C) 2023 Shreyas Zare (shreyas@technitium.com)
Copyright (C) 2024 Shreyas Zare (shreyas@technitium.com)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -420,16 +420,16 @@ namespace Failover
#region properties
public IReadOnlyDictionary<string, HealthCheck> HealthChecks
public ConcurrentDictionary<string, HealthCheck> HealthChecks
{ get { return _healthChecks; } }
public IReadOnlyDictionary<string, EmailAlert> EmailAlerts
public ConcurrentDictionary<string, EmailAlert> EmailAlerts
{ get { return _emailAlerts; } }
public IReadOnlyDictionary<string, WebHook> WebHooks
public ConcurrentDictionary<string, WebHook> WebHooks
{ get { return _webHooks; } }
public IReadOnlyDictionary<NetworkAddress, bool> UnderMaintenance
public ConcurrentDictionary<NetworkAddress, bool> UnderMaintenance
{ get { return _underMaintenance; } }
public IDnsServer DnsServer

View File

@@ -1,6 +1,6 @@
/*
Technitium DNS Server
Copyright (C) 2023 Shreyas Zare (shreyas@technitium.com)
Copyright (C) 2024 Shreyas Zare (shreyas@technitium.com)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -330,7 +330,7 @@ namespace Failover
public bool Enabled
{ get { return _enabled; } }
public IReadOnlyList<Uri> Urls
public Uri[] Urls
{ get { return _urls; } }
#endregion