/// <summary> /// Construct a <see cref="UserController"/> /// </summary> /// <param name="databaseContext">The <see cref="IDatabaseContext"/> for the <see cref="ApiController"/></param> /// <param name="authenticationContextFactory">The <see cref="IAuthenticationContextFactory"/> for the <see cref="ApiController"/></param> /// <param name="systemIdentityFactory">The value of <see cref="systemIdentityFactory"/></param> /// <param name="cryptographySuite">The value of <see cref="cryptographySuite"/></param> /// <param name="logger">The value of <see cref="logger"/></param> /// <param name="generalConfigurationOptions">The <see cref="IOptions{TOptions}"/> containing the value of <see cref="generalConfiguration"/></param> public UserController(IDatabaseContext databaseContext, IAuthenticationContextFactory authenticationContextFactory, ISystemIdentityFactory systemIdentityFactory, ICryptographySuite cryptographySuite, ILogger <UserController> logger, IOptions <GeneralConfiguration> generalConfigurationOptions) : base(databaseContext, authenticationContextFactory, logger, false, true) { this.logger = logger ?? throw new ArgumentNullException(nameof(logger)); this.systemIdentityFactory = systemIdentityFactory ?? throw new ArgumentNullException(nameof(systemIdentityFactory)); this.cryptographySuite = cryptographySuite ?? throw new ArgumentNullException(nameof(cryptographySuite)); generalConfiguration = generalConfigurationOptions?.Value ?? throw new ArgumentNullException(nameof(generalConfigurationOptions)); }
/// <summary> /// Initializes a new instance of the <see cref="InstanceManager"/> class. /// </summary> /// <param name="instanceFactory">The value of <see cref="instanceFactory"/>.</param> /// <param name="ioManager">The value of <paramref name="ioManager"/>.</param> /// <param name="databaseContextFactory">The value of <paramref name="databaseContextFactory"/>.</param> /// <param name="assemblyInformationProvider">The value of <see cref="assemblyInformationProvider"/>.</param> /// <param name="jobManager">The value of <see cref="jobManager"/>.</param> /// <param name="serverControl">The value of <see cref="serverControl"/>.</param> /// <param name="systemIdentityFactory">The value of <see cref="systemIdentityFactory"/>.</param> /// <param name="asyncDelayer">The value of <see cref="asyncDelayer"/>.</param> /// <param name="serverPortProvider">The value of <see cref="serverPortProvider"/>.</param> /// <param name="swarmService">The value of <see cref="swarmService"/>.</param> /// <param name="generalConfigurationOptions">The <see cref="IOptions{TOptions}"/> containing the value of <see cref="generalConfiguration"/>.</param> /// <param name="swarmConfigurationOptions">The <see cref="IOptions{TOptions}"/> containing the value of <see cref="swarmConfiguration"/>.</param> /// <param name="logger">The value of <see cref="logger"/>.</param> public InstanceManager( IInstanceFactory instanceFactory, IIOManager ioManager, IDatabaseContextFactory databaseContextFactory, IAssemblyInformationProvider assemblyInformationProvider, IJobManager jobManager, IServerControl serverControl, ISystemIdentityFactory systemIdentityFactory, IAsyncDelayer asyncDelayer, IServerPortProvider serverPortProvider, ISwarmService swarmService, IOptions <GeneralConfiguration> generalConfigurationOptions, IOptions <SwarmConfiguration> swarmConfigurationOptions, ILogger <InstanceManager> logger) { this.instanceFactory = instanceFactory ?? throw new ArgumentNullException(nameof(instanceFactory)); this.ioManager = ioManager ?? throw new ArgumentNullException(nameof(ioManager)); this.databaseContextFactory = databaseContextFactory ?? throw new ArgumentNullException(nameof(databaseContextFactory)); this.assemblyInformationProvider = assemblyInformationProvider ?? throw new ArgumentNullException(nameof(assemblyInformationProvider)); this.jobManager = jobManager ?? throw new ArgumentNullException(nameof(jobManager)); this.serverControl = serverControl ?? throw new ArgumentNullException(nameof(serverControl)); this.systemIdentityFactory = systemIdentityFactory ?? throw new ArgumentNullException(nameof(systemIdentityFactory)); this.asyncDelayer = asyncDelayer ?? throw new ArgumentNullException(nameof(asyncDelayer)); this.serverPortProvider = serverPortProvider ?? throw new ArgumentNullException(nameof(serverPortProvider)); this.swarmService = swarmService ?? throw new ArgumentNullException(nameof(swarmService)); generalConfiguration = generalConfigurationOptions?.Value ?? throw new ArgumentNullException(nameof(generalConfigurationOptions)); swarmConfiguration = swarmConfigurationOptions?.Value ?? throw new ArgumentNullException(nameof(swarmConfigurationOptions)); this.logger = logger ?? throw new ArgumentNullException(nameof(logger)); instances = new Dictionary <long, InstanceContainer>(); bridgeHandlers = new Dictionary <string, IBridgeHandler>(); readyTcs = new TaskCompletionSource <object>(); instanceStateChangeSemaphore = new SemaphoreSlim(1); }
/// <summary> /// Construct a <see cref="HomeController"/> /// </summary> /// <param name="databaseContext">The <see cref="IDatabaseContext"/> for the <see cref="ApiController"/></param> /// <param name="authenticationContextFactory">The <see cref="IAuthenticationContextFactory"/> for the <see cref="ApiController"/></param> /// <param name="tokenFactory">The value of <see cref="tokenFactory"/></param> /// <param name="systemIdentityFactory">The value of <see cref="systemIdentityFactory"/></param> /// <param name="cryptographySuite">The value of <see cref="cryptographySuite"/></param> /// <param name="assemblyInformationProvider">The value of <see cref="assemblyInformationProvider"/></param> /// <param name="identityCache">The value of <see cref="identityCache"/></param> /// <param name="oAuthProviders">The value of <see cref="oAuthProviders"/>.</param> /// <param name="platformIdentifier">The value of <see cref="platformIdentifier"/>.</param> /// <param name="browserResolver">The value of <see cref="browserResolver"/></param> /// <param name="swarmService">The value of <see cref="swarmService"/>.</param> /// <param name="serverControl">The value of <see cref="serverControl"/>.</param> /// <param name="generalConfigurationOptions">The <see cref="IOptions{TOptions}"/> containing the value of <see cref="generalConfiguration"/>.</param> /// <param name="controlPanelConfigurationOptions">The <see cref="IOptions{TOptions}"/> containing the value of <see cref="controlPanelConfiguration"/></param> /// <param name="logger">The <see cref="ILogger"/> for the <see cref="ApiController"/></param> public HomeController( IDatabaseContext databaseContext, IAuthenticationContextFactory authenticationContextFactory, ITokenFactory tokenFactory, ISystemIdentityFactory systemIdentityFactory, ICryptographySuite cryptographySuite, IAssemblyInformationProvider assemblyInformationProvider, IIdentityCache identityCache, IOAuthProviders oAuthProviders, IPlatformIdentifier platformIdentifier, IBrowserResolver browserResolver, ISwarmService swarmService, IServerControl serverControl, IOptions <GeneralConfiguration> generalConfigurationOptions, IOptions <ControlPanelConfiguration> controlPanelConfigurationOptions, ILogger <HomeController> logger) : base( databaseContext, authenticationContextFactory, logger, false) { this.tokenFactory = tokenFactory ?? throw new ArgumentNullException(nameof(tokenFactory)); this.systemIdentityFactory = systemIdentityFactory ?? throw new ArgumentNullException(nameof(systemIdentityFactory)); this.cryptographySuite = cryptographySuite ?? throw new ArgumentNullException(nameof(cryptographySuite)); this.assemblyInformationProvider = assemblyInformationProvider ?? throw new ArgumentNullException(nameof(assemblyInformationProvider)); this.identityCache = identityCache ?? throw new ArgumentNullException(nameof(identityCache)); this.platformIdentifier = platformIdentifier ?? throw new ArgumentNullException(nameof(platformIdentifier)); this.oAuthProviders = oAuthProviders ?? throw new ArgumentNullException(nameof(oAuthProviders)); this.browserResolver = browserResolver ?? throw new ArgumentNullException(nameof(browserResolver)); this.swarmService = swarmService ?? throw new ArgumentNullException(nameof(swarmService)); this.serverControl = serverControl ?? throw new ArgumentNullException(nameof(serverControl)); generalConfiguration = generalConfigurationOptions?.Value ?? throw new ArgumentNullException(nameof(generalConfigurationOptions)); controlPanelConfiguration = controlPanelConfigurationOptions?.Value ?? throw new ArgumentNullException(nameof(controlPanelConfigurationOptions)); }
/// <summary> /// Construct an <see cref="InstanceManager"/> /// </summary> /// <param name="instanceFactory">The value of <see cref="instanceFactory"/></param> /// <param name="ioManager">The value of <paramref name="ioManager"/></param> /// <param name="databaseContextFactory">The value of <paramref name="databaseContextFactory"/></param> /// <param name="assemblyInformationProvider">The value of <see cref="assemblyInformationProvider"/></param> /// <param name="jobManager">The value of <see cref="jobManager"/></param> /// <param name="serverControl">The value of <see cref="serverControl"/></param> /// <param name="systemIdentityFactory">The value of <see cref="systemIdentityFactory"/>.</param> /// <param name="asyncDelayer">The value of <see cref="asyncDelayer"/>.</param> /// <param name="generalConfigurationOptions">The <see cref="IOptions{TOptions}"/> containing the value of <see cref="generalConfiguration"/>.</param> /// <param name="logger">The value of <see cref="logger"/></param> public InstanceManager( IInstanceFactory instanceFactory, IIOManager ioManager, IDatabaseContextFactory databaseContextFactory, IAssemblyInformationProvider assemblyInformationProvider, IJobManager jobManager, IServerControl serverControl, ISystemIdentityFactory systemIdentityFactory, IAsyncDelayer asyncDelayer, IOptions <GeneralConfiguration> generalConfigurationOptions, ILogger <InstanceManager> logger) { this.instanceFactory = instanceFactory ?? throw new ArgumentNullException(nameof(instanceFactory)); this.ioManager = ioManager ?? throw new ArgumentNullException(nameof(ioManager)); this.databaseContextFactory = databaseContextFactory ?? throw new ArgumentNullException(nameof(databaseContextFactory)); this.assemblyInformationProvider = assemblyInformationProvider ?? throw new ArgumentNullException(nameof(assemblyInformationProvider)); this.jobManager = jobManager ?? throw new ArgumentNullException(nameof(jobManager)); this.serverControl = serverControl ?? throw new ArgumentNullException(nameof(serverControl)); this.systemIdentityFactory = systemIdentityFactory ?? throw new ArgumentNullException(nameof(systemIdentityFactory)); this.asyncDelayer = asyncDelayer ?? throw new ArgumentNullException(nameof(asyncDelayer)); generalConfiguration = generalConfigurationOptions?.Value ?? throw new ArgumentNullException(nameof(generalConfigurationOptions)); this.logger = logger ?? throw new ArgumentNullException(nameof(logger)); serverControl.RegisterForRestart(this); instances = new Dictionary <long, IInstance>(); bridgeHandlers = new Dictionary <string, IBridgeHandler>(); readyTcs = new TaskCompletionSource <object>(); }
/// <summary> /// Construct a <see cref="HomeController"/> /// </summary> /// <param name="databaseContext">The <see cref="IDatabaseContext"/> for the <see cref="ApiController"/></param> /// <param name="authenticationContextFactory">The <see cref="IAuthenticationContextFactory"/> for the <see cref="ApiController"/></param> /// <param name="tokenFactory">The value of <see cref="tokenFactory"/></param> /// <param name="systemIdentityFactory">The value of <see cref="systemIdentityFactory"/></param> /// <param name="cryptographySuite">The value of <see cref="cryptographySuite"/></param> /// <param name="application">The value of <see cref="application"/></param> /// <param name="identityCache">The value of <see cref="identityCache"/></param> /// <param name="logger">The <see cref="ILogger"/> for the <see cref="ApiController"/></param> public HomeController(IDatabaseContext databaseContext, IAuthenticationContextFactory authenticationContextFactory, ITokenFactory tokenFactory, ISystemIdentityFactory systemIdentityFactory, ICryptographySuite cryptographySuite, IApplication application, IIdentityCache identityCache, ILogger <HomeController> logger) : base(databaseContext, authenticationContextFactory, logger, false) { this.tokenFactory = tokenFactory ?? throw new ArgumentNullException(nameof(tokenFactory)); this.systemIdentityFactory = systemIdentityFactory ?? throw new ArgumentNullException(nameof(systemIdentityFactory)); this.cryptographySuite = cryptographySuite ?? throw new ArgumentNullException(nameof(cryptographySuite)); this.application = application ?? throw new ArgumentNullException(nameof(application)); this.identityCache = identityCache ?? throw new ArgumentNullException(nameof(identityCache)); }
/// <summary> /// Construct a <see cref="HomeController"/> /// </summary> /// <param name="databaseContext">The <see cref="IDatabaseContext"/> for the <see cref="ApiController"/></param> /// <param name="authenticationContextFactory">The <see cref="IAuthenticationContextFactory"/> for the <see cref="ApiController"/></param> /// <param name="tokenFactory">The value of <see cref="tokenFactory"/></param> /// <param name="systemIdentityFactory">The value of <see cref="systemIdentityFactory"/></param> /// <param name="cryptographySuite">The value of <see cref="cryptographySuite"/></param> /// <param name="application">The value of <see cref="application"/></param> /// <param name="identityCache">The value of <see cref="identityCache"/></param> /// <param name="browserResolver">The value of <see cref="browserResolver"/></param> /// <param name="controlPanelConfigurationOptions">The <see cref="IOptions{TOptions}"/> containing the value of <see cref="controlPanelConfiguration"/></param> /// <param name="logger">The <see cref="ILogger"/> for the <see cref="ApiController"/></param> public HomeController(IDatabaseContext databaseContext, IAuthenticationContextFactory authenticationContextFactory, ITokenFactory tokenFactory, ISystemIdentityFactory systemIdentityFactory, ICryptographySuite cryptographySuite, IApplication application, IIdentityCache identityCache, IBrowserResolver browserResolver, IOptions <ControlPanelConfiguration> controlPanelConfigurationOptions, ILogger <HomeController> logger) : base(databaseContext, authenticationContextFactory, logger, false, false) { this.tokenFactory = tokenFactory ?? throw new ArgumentNullException(nameof(tokenFactory)); this.systemIdentityFactory = systemIdentityFactory ?? throw new ArgumentNullException(nameof(systemIdentityFactory)); this.cryptographySuite = cryptographySuite ?? throw new ArgumentNullException(nameof(cryptographySuite)); this.application = application ?? throw new ArgumentNullException(nameof(application)); this.identityCache = identityCache ?? throw new ArgumentNullException(nameof(identityCache)); this.browserResolver = browserResolver ?? throw new ArgumentNullException(nameof(browserResolver)); controlPanelConfiguration = controlPanelConfigurationOptions?.Value ?? throw new ArgumentNullException(nameof(controlPanelConfigurationOptions)); }
/// <summary> /// Construct a <see cref="HomeController"/> /// </summary> /// <param name="databaseContext">The <see cref="IDatabaseContext"/> for the <see cref="ApiController"/></param> /// <param name="authenticationContextFactory">The <see cref="IAuthenticationContextFactory"/> for the <see cref="ApiController"/></param> /// <param name="tokenFactory">The value of <see cref="tokenFactory"/></param> /// <param name="systemIdentityFactory">The value of <see cref="systemIdentityFactory"/></param> /// <param name="cryptographySuite">The value of <see cref="cryptographySuite"/></param> /// <param name="assemblyInformationProvider">The value of <see cref="assemblyInformationProvider"/></param> /// <param name="identityCache">The value of <see cref="identityCache"/></param> /// <param name="browserResolver">The value of <see cref="browserResolver"/></param> /// <param name="generalConfigurationOptions">The <see cref="IOptions{TOptions}"/> containing the value of <see cref="generalConfiguration"/>.</param> /// <param name="controlPanelConfigurationOptions">The <see cref="IOptions{TOptions}"/> containing the value of <see cref="controlPanelConfiguration"/></param> /// <param name="logger">The <see cref="ILogger"/> for the <see cref="ApiController"/></param> public HomeController( IDatabaseContext databaseContext, IAuthenticationContextFactory authenticationContextFactory, ITokenFactory tokenFactory, ISystemIdentityFactory systemIdentityFactory, ICryptographySuite cryptographySuite, IAssemblyInformationProvider assemblyInformationProvider, IIdentityCache identityCache, IBrowserResolver browserResolver, IOptions <GeneralConfiguration> generalConfigurationOptions, IOptions <ControlPanelConfiguration> controlPanelConfigurationOptions, ILogger <HomeController> logger) : base( databaseContext, authenticationContextFactory, logger, (browserResolver ?? throw new ArgumentNullException(nameof(browserResolver))).Browser.Type != BrowserType.Generic &&
/// <summary> /// Construct an <see cref="AuthenticationContextFactory"/> /// </summary> /// <param name="systemIdentityFactory">The value of <see cref="systemIdentityFactory"/></param> /// <param name="databaseContext">The value of <see cref="databaseContext"/></param> /// <param name="identityCache">The value of <see cref="identityCache"/></param> public AuthenticationContextFactory(ISystemIdentityFactory systemIdentityFactory, IDatabaseContext databaseContext, IIdentityCache identityCache) { this.systemIdentityFactory = systemIdentityFactory ?? throw new ArgumentNullException(nameof(systemIdentityFactory)); this.databaseContext = databaseContext ?? throw new ArgumentNullException(nameof(databaseContext)); this.identityCache = identityCache ?? throw new ArgumentNullException(nameof(identityCache)); }