예제 #1
0
        // ReSharper disable once UnusedMember.Global
        public void ConfigureContainer(ContainerBuilder builder)
        {
            var appSettings = this.AppSettings;
            var systemName  = appSettings.Server.ActorSystemName;
            var host        = appSettings.Server.Host;
            var port        = appSettings.Server.Port;

            var config = ConfigurationFactory.ParseString(appSettings.Akka);

            var actorSystem = ActorSystem.Create(systemName, config);

            var pathsBuilder = new ActorPathsBuilder(systemName, host, port);

            builder.RegisterInstance(appSettings).As <ITimeoutSettings>();
            builder.RegisterInstance(appSettings.Security).As <ISecuritySettings>();
            builder.RegisterInstance(appSettings.ServiceEndpointsAuthentication).As <IServiceEndpointsAuthenticationSettings>();
            builder.RegisterInstance(actorSystem).As <IActorRefFactory>();
            builder.RegisterInstance(pathsBuilder).AsSelf();

            builder.RegisterType <EmployeesRegistry>().As <IEmployeesRegistry>();
            builder.RegisterType <UserEmployeeSearch>().As <IUserEmployeeSearch>();
            builder.RegisterType <HealthService>().As <IHealthService>();
            builder.RegisterType <UserPreferences.UserPreferencesService>().As <IUserPreferencesService>();

            builder.RegisterType <UserIsEmployeeHandler>().As <IAuthorizationHandler>().InstancePerLifetimeScope();
            builder.RegisterType <EmployeePermissionsHandler>().As <IAuthorizationHandler>().InstancePerLifetimeScope();
            builder.RegisterType <EditCalendarEventsPermissionHandler>().As <IAuthorizationHandler>().InstancePerLifetimeScope();

            builder.RegisterType <PermissionsLoader>().As <IPermissionsLoader>().InstancePerLifetimeScope();
        }
        public DownloadActor(
            IDownloadApplicationSettings downloadApplicationSettings,
            IHttpClientFactory httpClientFactory,
            IHostingEnvironment hostingEnvironment,
            ActorPathsBuilder actorPathsBuilder)
        {
            this.androidDownloadBuildActor = Context.ActorOf(
                Props.Create(() => new DownloadApplicationActor(
                                 downloadApplicationSettings,
                                 httpClientFactory,
                                 hostingEnvironment,
                                 downloadApplicationSettings.AndroidGetBuildsUrl,
                                 downloadApplicationSettings.AndroidGetBuildDownloadLinkTemplateUrl,
                                 ApplicationTypeEnum.Android,
                                 actorPathsBuilder)),
                "download-android-build");

            this.iosDownloadBuildActor = Context.ActorOf(
                Props.Create(() => new DownloadApplicationActor(
                                 downloadApplicationSettings,
                                 httpClientFactory,
                                 hostingEnvironment,
                                 downloadApplicationSettings.IosGetBuildsUrl,
                                 downloadApplicationSettings.IosGetBuildDownloadLinkTemplateUrl,
                                 ApplicationTypeEnum.Ios,
                                 actorPathsBuilder)),
                "download-ios-build");

            Context.System.Scheduler.ScheduleTellRepeatedly(
                TimeSpan.Zero,
                TimeSpan.FromMinutes(downloadApplicationSettings.DownloadBuildIntervalMinutes),
                this.Self,
                RefreshApplicationBuilds.Instance,
                this.Self);
        }
 public PushNotificationsService(
     IActorRefFactory actorsFactory,
     ActorPathsBuilder actorPathsBuilder)
 {
     this.pushNotificationsDevicesActor = actorsFactory.ActorSelection(
         actorPathsBuilder.Get(WellKnownActorPaths.PushNotificationsDevices));
 }
예제 #4
0
 public PermissionsLoader(
     IActorRefFactory actorSystem,
     ActorPathsBuilder pathsBuilder,
     ITimeoutSettings timeoutSettings)
 {
     this.actorSystem     = actorSystem;
     this.pathsBuilder    = pathsBuilder;
     this.timeoutSettings = timeoutSettings;
 }
 public UserPreferencesService(
     IActorRefFactory actorsFactory,
     ActorPathsBuilder actorPathsBuilder,
     ITimeoutSettings timeoutSettings)
 {
     this.userPreferencesActor = actorsFactory.ActorSelection(
         actorPathsBuilder.Get(WellKnownActorPaths.UserPreferences));
     this.timeoutSettings = timeoutSettings;
 }
 public DepartmentFeaturesService(
     IActorRefFactory actorsFactory,
     ActorPathsBuilder actorPathsBuilder,
     ITimeoutSettings timeoutSettings)
 {
     this.organizationActor = actorsFactory.ActorSelection(
         actorPathsBuilder.Get(WellKnownActorPaths.Organization));
     this.timeoutSettings = timeoutSettings;
 }
예제 #7
0
        public UpdateAvailableNotificationActor(
            ActorPathsBuilder actorPathsBuilder,
            IUpdateNotificationSettings updateNotificationSettings)
        {
            this.updateNotificationSettings    = updateNotificationSettings;
            this.notificationsActor            = Context.ActorSelection(actorPathsBuilder.Get(WellKnownActorPaths.Notifications));
            this.pushNotificationsDevicesActor = Context.ActorSelection(actorPathsBuilder.Get(WellKnownActorPaths.PushNotificationsDevices));

            Context.System.EventStream.Subscribe <UpdateAvailable>(this.Self);
        }
예제 #8
0
 public FeedsController(
     ActorPathsBuilder pathsBuilder,
     IActorRefFactory actorFactory,
     ITimeoutSettings timeoutSettings,
     IUserEmployeeSearch userEmployeeSearch)
 {
     this.pathsBuilder       = pathsBuilder;
     this.actorFactory       = actorFactory;
     this.timeoutSettings    = timeoutSettings;
     this.userEmployeeSearch = userEmployeeSearch;
 }
 public PendingRequestsController(
     IUserEmployeeSearch userEmployeeSearch,
     ActorPathsBuilder pathBuilder,
     ITimeoutSettings timeoutSettings,
     IActorRefFactory actorsFactory,
     IUserPreferencesService userPreferencesService)
 {
     this.userEmployeeSearch     = userEmployeeSearch;
     this.pathBuilder            = pathBuilder;
     this.timeoutSettings        = timeoutSettings;
     this.actorsFactory          = actorsFactory;
     this.userPreferencesService = userPreferencesService;
 }
예제 #10
0
        public DownloadApplicationActor(
            IDownloadApplicationSettings downloadApplicationSettings,
            IHttpClientFactory httpClientFactory,
            IHostingEnvironment hostingEnvironment,
            string getBuildsUrl,
            string getBuildDownloadLinkTemplateUrl,
            ApplicationTypeEnum applicationType,
            ActorPathsBuilder actorPathsBuilder)
        {
            this.getBuildsUrl = getBuildsUrl;
            this.getBuildDownloadLinkTemplateUrl = getBuildDownloadLinkTemplateUrl;
            this.hostingEnvironment          = hostingEnvironment;
            this.downloadApplicationSettings = downloadApplicationSettings;
            this.httpClientFactory           = httpClientFactory;
            this.applicationType             = applicationType;

            this.applicationBuildsActor = Context.ActorSelection(actorPathsBuilder.Get(WellKnownActorPaths.ApplicationBuilds));
        }
예제 #11
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddMvc();

            var serverConfig = this.Configuration.GetSection("Server");

            var systemName = serverConfig["ActorSystemName"];
            var host       = serverConfig["Host"];
            var port       = serverConfig.GetValue <int>("Port");

            var config = ConfigurationFactory.ParseString(this.Configuration["akka"]);

            var actorSystem = ActorSystem.Create(systemName, config);

            var pathsBuilder = new ActorPathsBuilder(systemName, host, port);

            services.AddSingleton <IActorRefFactory>(actorSystem);
            services.AddSingleton(pathsBuilder);

            services.AddSwaggerGen(c => { c.SwaggerDoc("v1", new Info()
                {
                    Title = "Arcadian-Assistant API", Version = "v1"
                }); });
        }
 public EmployeesController(IActorRefFactory actorSystem, ActorPathsBuilder pathsBuilder)
 {
     this.actorSystem  = actorSystem;
     this.pathsBuilder = pathsBuilder;
 }
예제 #13
0
 public HealthService(IActorRefFactory actorSystem, ActorPathsBuilder pathsBuilder, ITimeoutSettings timeoutSettings)
 {
     this.actorSystem     = actorSystem;
     this.pathsBuilder    = pathsBuilder;
     this.timeoutSettings = timeoutSettings;
 }
예제 #14
0
 public DepartmentsController(IActorRefFactory actorSystem, ActorPathsBuilder pathsBuilder, ITimeoutSettings timeoutSettings)
 {
     this.actorSystem     = actorSystem;
     this.pathsBuilder    = pathsBuilder;
     this.timeoutSettings = timeoutSettings;
 }
예제 #15
0
 public EmployeesRegistry(IActorRefFactory actorSystem, ActorPathsBuilder pathsBuilder, ITimeoutSettings timeoutSettings)
 {
     this.actorSystem     = actorSystem;
     this.pathsBuilder    = pathsBuilder;
     this.timeoutSettings = timeoutSettings;
 }
 public static Props CreateProps(ActorPathsBuilder actorsPathsBuilder)
 => Props.Create(() => new PendingActionsRequest(actorsPathsBuilder));
 public PendingActionsRequest(ActorPathsBuilder actorsPathsBuilder)
 {
     this.organization = Context.ActorSelection(actorsPathsBuilder.Get(WellKnownActorPaths.Organization));
     // this.SetReceiveTimeout(timeoutSettings.Timeout);
 }
예제 #18
0
 public DepartmentsController(IActorRefFactory actorSystem, ActorPathsBuilder pathsBuilder)
 {
     this.actorSystem  = actorSystem;
     this.pathsBuilder = pathsBuilder;
 }