// /** // * File: SkyEntities.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.types.odb; using ln.skyscanner.entities; using System.IO; using LiteDB; namespace ln.skyscanner { public class SkyEntities { public SkyScanner SkyScanner { get; } public string BasePath => Path.Combine(SkyScanner.BasePath, "entities"); public GlobalNetwork GlobalNetwork { get; private set; } public ODB odDatabase { get; private set; } public ODBCollection nodeCollection { get; private set; } public ODBCollection interfaceCollection { get; private set; } public ODBCollection intfIPCollection { get; private set; } public ODBCollection subnetCollection { get; private set; } public SkyEntities(SkyScanner skyScanner) { SkyScanner = skyScanner; odDatabase = new ODB(BasePath); nodeCollection = odDatabase.GetCollection(); interfaceCollection = odDatabase.GetCollection(); intfIPCollection = odDatabase.GetCollection(); subnetCollection = odDatabase.GetCollection(); interfaceCollection.EnsureIndex("NodeID"); intfIPCollection.EnsureIndex("interfaceID"); GlobalNetwork = new GlobalNetwork(this); } } }