ln.skyscanner/checks/SkyCheck.cs

52 lines
1.4 KiB
C#
Raw Normal View History

2019-04-04 00:50:53 +02:00
// /**
// * File: SkyCheck.cs
// * Author: haraldwolff
// *
// * This file and it's content is copyrighted by the Author and / or copyright holder.
// * Any use wihtout proper permission is illegal and may lead to legal actions.
// *
// *
// **/
using System;
using ln.skyscanner.entities;
using System.IO;
using System.Collections.Generic;
2019-08-19 14:15:10 +02:00
using ln.skyscanner.services;
2019-04-04 00:50:53 +02:00
namespace ln.skyscanner.checks
{
public abstract class SkyCheck
{
/* Static */
static List<SkyCheck> skyChecks = new List<SkyCheck>();
public static SkyCheck[] SkyChecks => skyChecks.ToArray();
public static void AddSkyCheck(SkyCheck skyCheck) => skyChecks.Add(skyCheck);
/* Instance */
public SkyCheck(String checkName)
{
Name = checkName;
}
public string Name { get; }
public virtual bool IsCritical => false;
public abstract bool IsValid(Node node);
2019-08-29 13:14:52 +02:00
public abstract void Check(CheckService checkService,ref SkyCheckState checkState,Node node);
2019-08-19 14:15:10 +02:00
public virtual SkyCheckState PrepareCheckState(CheckService skyChecker,Node node)
2019-04-16 18:23:05 +02:00
{
return new SkyCheckState(this, node);
}
2019-04-04 00:50:53 +02:00
static SkyCheck()
{
AddSkyCheck(new Hostalive());
2019-06-28 10:01:30 +02:00
AddSkyCheck(new Ubiquiti());
2019-07-09 12:49:47 +02:00
AddSkyCheck(new Mimosa());
2019-08-03 12:57:32 +02:00
//AddSkyCheck(new SikluCheck());
2019-04-12 00:52:55 +02:00
AddSkyCheck(new APC());
2019-04-04 00:50:53 +02:00
}
}
}