Example #1
0
        private void InitiateLoadTask(Location startLocation)
        {
            repository.Clear();

            // initiate read of all feature definitions
            var fdQuery = new LoadFeatureDefinitionQuery(Id);

            featureDefinitionActor.Tell(fdQuery);

            // initiate read of locations
            var loadQuery = new LoadLocationQuery(Id, startLocation);

            LoadTask(loadQuery);
        }
Example #2
0
        private void InitiateLoadTask(LoadTask loadTask)
        {
            if (!TaskCanceled)
            {
                this.elevatedPrivileges = loadTask.ElevatedPrivileges.Value;

                Start = DateTime.Now;

                Title = loadTask.Title;

                // cleanup repository
                if (loadTask.StartLocation.Scope == Enums.Scope.Farm)
                {
                    // clear repository synchronous before loading
                    repository.Clear();

                    // it could take some time to clear the repository, and errors could happen,
                    // so the task could be canceled meanwhile ...
                    if (!TaskCanceled)
                    {
                        // initiate read of all feature definitions
                        var fdQuery = new Messages.Request.LoadFeatureDefinitionQuery(Id);


                        featureDefinitionActor.Tell(fdQuery);


                        // initiate read of farm location, start location is null
                        var loadFarm = new LoadChildLocationQuery(Id, null, elevatedPrivileges);

                        farmLoadActor.Tell(loadFarm);
                    }
                }
                else
                {
                    //TODO: clear only start location and belonging activatedfeatures and definitions ...
                    throw new NotImplementedException("As start location for load task, currently only farm level is supported.");
                }

                var loadChildren = new LoadChildLocationQuery(
                    Id,
                    loadTask.StartLocation,
                    elevatedPrivileges);

                // load web applications as farm children
                ReceiveLoadChildrenTask(loadChildren);
            }
        }