Ejemplo n.º 1
0
        public LoadTaskActor(IEventAggregator eventAggregator, IFeatureRepository repository,
                             string title, Guid id, Location startLocation)
            : base(eventAggregator, title, id)
        {
            locationActors         = new Dictionary <Guid, IActorRef>();
            this.repository        = repository;
            featureDefinitionActor =
                Context.ActorOf(Context.DI().Props <FeatureDefinitionActor>());


            FarmFeatureDefinitions = new ProgressModule(
                5d / 100,
                0d,
                1);

            Farm = new ProgressModule(
                5d / 100,
                FarmFeatureDefinitions.MaxCumulatedQuota,
                1);
            WebApps = new ProgressModule(
                10d / 100,
                Farm.MaxCumulatedQuota);

            SitesAndWebs = new ProgressModule(
                1d - WebApps.MaxCumulatedQuota,
                WebApps.MaxCumulatedQuota);

            Receive <LocationsLoaded>(message => HandleLocationsLoaded(message));
            Receive <FarmFeatureDefinitionsLoaded>(message => FarmFeatureDefinitionsLoaded(message));

            InitiateLoadTask(startLocation);
        }
Ejemplo n.º 2
0
        public LoadTaskActor(IEventAggregator eventAggregator, string title, Guid id, Location startLocation)
            : base(eventAggregator, title, id)
        {
            locationActors = new Dictionary <Guid, IActorRef>();

            featureDefinitionActor =
                Context.ActorOf(Context.DI().Props <FeatureDefinitionActor>());

            Preparations = new ProgressModule(
                5d / 100,
                0d,
                FeatureAdmin.Common.Constants.Tasks.PreparationStepsForLoad);

            FarmFeatureDefinitions = new ProgressModule(
                5d / 100,
                Preparations.MaxCumulatedQuota,
                1);

            Farm = new ProgressModule(
                5d / 100,
                FarmFeatureDefinitions.MaxCumulatedQuota,
                1);
            WebApps = new ProgressModule(
                10d / 100,
                Farm.MaxCumulatedQuota);

            SitesAndWebs = new ProgressModule(
                1d - WebApps.MaxCumulatedQuota,
                WebApps.MaxCumulatedQuota);

            Receive <ClearItemsReady>(message => HandleClearItemsReady(message));
            Receive <LocationsLoaded>(message => HandleLocationsLoaded(message));
            Receive <FarmFeatureDefinitionsLoaded>(message => FarmFeatureDefinitionsLoaded(message));

            InitiateLoadTask(startLocation);
        }
Ejemplo n.º 3
0
        public LoadTaskActor(
            IEventAggregator eventAggregator,
            IFeatureRepository repository,
            IDataService dataService,
            Guid id)
            : base(eventAggregator, id)
        {
            locationActors   = new Dictionary <string, IActorRef>();
            this.repository  = repository;
            this.dataService = dataService;

            featureDefinitionActor = Context.ActorOf(
                FeatureDefinitionActor.Props(dataService), "FeatureDefinitionActor");

            farmLoadActor = Context.ActorOf(
                LocationActor.Props(dataService), "FarmLoadActor");

            ActivatedFeaturesLoaded = 0;

            FarmFeatureDefinitions =
                new ProgressModule(5d / 100, 0d, 1);

            Farm = new ProgressModule(5d / 100,
                                      FarmFeatureDefinitions.MaxCumulatedQuota, 1);

            WebApps = new ProgressModule(10d / 100,
                                         Farm.MaxCumulatedQuota);

            SitesAndWebs = new ProgressModule(
                1d - WebApps.MaxCumulatedQuota,
                WebApps.MaxCumulatedQuota);

            Receive <LoadTask>(message => InitiateLoadTask(message));
            Receive <LoadedDto>(message => ReceiveLocationsLoaded(message));
            Receive <FarmFeatureDefinitionsLoaded>(message => FarmFeatureDefinitionsLoaded(message));
        }