private static PondMine GetMine(ICache cache, IAuthTokenReader tokenReader, ITraceExporter traceExporter) { if (tokenReader == null) { throw new ArgumentNullException(nameof(tokenReader)); } return(new PondMine(tokenReader.GetToken(), cache, DbUtils.ConnectionString, traceExporter)); }
/// <summary> /// Construct a new Shaft /// </summary> /// <param name="traceExporter">Used to export a baskets trace information</param> /// <param name="terminal">The terminal waypoint</param> /// <param name="stations">The stations</param> public Shaft(ITraceExporter traceExporter, ITerminal <TBasket> terminal, params IStation <TBasket>[] stations) { Terminal = terminal ?? throw new ArgumentNullException(nameof(terminal)); TraceExporter = traceExporter; if (stations != null) { _stations = stations.ToList(); } }
public PairSelectionsController(ICache cache, IAuthTokenReader tokenReader, ITraceExporter traceExporter) { if (tokenReader == null) { throw new ArgumentNullException(nameof(tokenReader)); } var userToken = tokenReader.GetToken(); var frogMine = new FrogMine(userToken, cache, DbUtils.ConnectionString, traceExporter); _mine = new PairSelectionMine(userToken, frogMine, traceExporter); }
public Genesis(string user, string connectionString, ITraceExporter traceExporter) { _day = DateTime.MinValue; var cache = new InProcessCache(); var tadpoleMine = new TadpoleMine(user, cache, connectionString, traceExporter); _pondMine = new PondMine(user, cache, connectionString, traceExporter); _frogMine = new FrogMine(user, cache, connectionString, traceExporter); _pairSelectionMine = new PairSelectionMine(user, _frogMine, traceExporter); _maturationEventMine = new MaturationEventMine(user, _frogMine, tadpoleMine, traceExporter); _matingEventMine = new MatingEventMine(user, _frogMine, tadpoleMine, traceExporter); _frogCountMine = new FrogCountMine(user, connectionString, traceExporter); _tadpoleCountMine = new TadpoleCountMine(user, connectionString, traceExporter); }
public FrogMine(string user, ICache cache, string connectionString, ITraceExporter traceExporter) : base(user, cache, GetTerminalLayer(connectionString), traceExporter) { }
public PairSelectionMine(string user, FrogMine frogMine, ITraceExporter traceExporter) : base(user, new PairSelectionTerminalLayer(frogMine), traceExporter) { }
public FrogCountsController(IAuthTokenReader tokenReader, ITraceExporter traceExporter) { _mine = new FrogCountMine(tokenReader.GetToken(), DbUtils.ConnectionString, traceExporter); }
public MaturationEventMine(string user, FrogMine frogMine, TadpoleMine tadpoleMine, ITraceExporter traceExporter) : base(user, new MaturationEventTerminalLayer(frogMine, tadpoleMine), traceExporter) { }
public PondsController(ICache cache, IAuthTokenReader tokenReader, ITraceExporter traceExporter) : base(GetMine(cache, tokenReader, traceExporter)) { }
public TadpoleCountMine(string user, string connectionString, ITraceExporter traceExporter) : base(user, new TadpoleCountTerminalLayer(connectionString), traceExporter) { }
/// <summary> /// A caching layer is introduced here and it will sit below the security layer which the base AppMine class /// added. /// /// N.B. Since this application is targetting SQLite and the database is going to be very small there is absolutely /// no need for this cache, in fact it will probably actually degrade performance a litte. This is added just to /// demonstrate what you can do though. /// </summary> public AppDataMine(string user, ICache cache, IDbLayer <TId, T> terminalLayer, ITraceExporter traceExporter) : base(user, terminalLayer, traceExporter) { Add(new CacheLayer <TId, T>(new ObjectCache <TId, T>(cache))); }
/// <summary> /// Construct a new Mine /// </summary> /// <param name="terminalLayer">The mines terminal layer</param> /// <param name="traceExporter">An object that can export the trace data held within baskets</param> protected Mine(ITerminalLayer <T> terminalLayer, ITraceExporter traceExporter) { TerminalLayer = terminalLayer ?? throw new ArgumentNullException(nameof(terminalLayer)); TraceExporter = traceExporter; }
/// <summary> /// Since we're introducing the AppSecurityLayer all mines must capture a "user" so it can be passed to the /// security layer. /// </summary> public AppMine(string user, TTerminalLayer terminalLayer, ITraceExporter traceExporter) : base(terminalLayer, traceExporter) { // Mines are added from top down, so this will always be the top layer Add(new AppSecurityLayer <T>(user)); }