49 lines
1.3 KiB
C#
49 lines
1.3 KiB
C#
// /**
|
|
// * 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;
|
|
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);
|
|
public abstract void Check(SkyChecker skyChecker,ref SkyCheckState checkState,Node node);
|
|
public virtual SkyCheckState PrepareCheckState(SkyChecker skyChecker,Node node)
|
|
{
|
|
return new SkyCheckState(this, node);
|
|
}
|
|
|
|
static SkyCheck()
|
|
{
|
|
AddSkyCheck(new Hostalive());
|
|
AddSkyCheck(new Ubiquity());
|
|
AddSkyCheck(new APC());
|
|
}
|
|
}
|
|
}
|