/// <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));
 }
Beispiel #2
0
        /// <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);
        }
Beispiel #3
0
 public SwarmController(ISwarmService swarmService)
 {
     _swarmService = swarmService;
 }
Beispiel #4
0
 public SwarmApi(SwarmService swarmService, IConfigApi configApi)
 {
     _swarmService = swarmService;
     _configApi    = configApi;
 }