Esempio n. 1
0
        public TaskExecutionContext(ITasklingConfiguration configuration,
                                    ITaskExecutionRepository taskExecutionRepository,
                                    ICriticalSectionRepository criticalSectionRepository,
                                    IBlockFactory blockFactory,
                                    IRangeBlockRepository rangeBlockRepository,
                                    IListBlockRepository listBlockRepository,
                                    IObjectBlockRepository objectBlockRepository,
                                    ICleanUpService cleanUpService,
                                    string applicationName,
                                    string taskName,
                                    TaskExecutionOptions taskExecutionOptions)
        {
            _configuration             = configuration;
            _taskExecutionRepository   = taskExecutionRepository;
            _criticalSectionRepository = criticalSectionRepository;
            _blockFactory          = blockFactory;
            _rangeBlockRepository  = rangeBlockRepository;
            _listBlockRepository   = listBlockRepository;
            _objectBlockRepository = objectBlockRepository;
            _cleanUpService        = cleanUpService;

            _taskExecutionInstance = new TaskExecutionInstance();
            _taskExecutionInstance.ApplicationName = applicationName;
            _taskExecutionInstance.TaskName        = taskName;

            _taskExecutionOptions = taskExecutionOptions;

            _executionHasFailed = false;

            _taskConfiguration = _configuration.GetTaskConfiguration(applicationName, taskName);
        }
        public MainWindowViewModel(IWindowCloseService closeDialogService,
                                   IConnectionDialogService connectionDialogService,
                                   IErrorDialogService errorDialogService,
                                   IVirtualMachineNamesLoader virtualMachineNamesLoader,
                                   IVirtualMachineDisksLoader virtualMachineDisksLoader,
                                   ICleanUpService cleanUpService)
        {
            _closeDialogService        = closeDialogService;
            _connectionDialogService   = connectionDialogService;
            _errorDialogService        = errorDialogService;
            _virtualMachineNamesLoader = virtualMachineNamesLoader;
            _virtualMachineDisksLoader = virtualMachineDisksLoader;
            _cleanUpService            = cleanUpService;

            _virtualMachineNames = _virtualMachineNamesStub;
            _disks = _disksStub;

            _closeCommand = new DelegateCommand(Close);
            _loadVirtualMachinesCommand     = new DelegateCommand(LoadVirtualMachines);
            _loadVirtualMachineDisksCommand = new DelegateCommand(LoadVirtualMachineDisks, CanLoadVirtualMachineDisks);

            CancelClose = true;
        }
Esempio n. 3
0
 public static async Task Run(
     [TimerTrigger("0 5 */6 * * *")] TimerInfo myTimer,
     [Inject] ICleanUpService cleanUpService)
 {
     await cleanUpService.ExecuteAsync();
 }
Esempio n. 4
0
        public TasklingClient(IConfigurationReader configurationReader,
                              ITaskRepository taskRepository                       = null,
                              ITasklingConfiguration configuration                 = null,
                              ITaskExecutionRepository taskExecutionRepository     = null,
                              IExecutionTokenRepository executionTokenRepository   = null,
                              ICommonTokenRepository commonTokenRepository         = null,
                              IEventsRepository eventsRepository                   = null,
                              ICriticalSectionRepository criticalSectionRepository = null,
                              IBlockFactory blockFactory                   = null,
                              IBlockRepository blockRepository             = null,
                              IRangeBlockRepository rangeBlockRepository   = null,
                              IListBlockRepository listBlockRepository     = null,
                              IObjectBlockRepository objectBlockRepository = null,
                              ICleanUpService cleanUpService               = null,
                              ICleanUpRepository cleanUpRepository         = null)
        {
            if (taskRepository == null)
            {
                taskRepository = new TaskRepository();
            }

            if (configuration == null)
            {
                _configuration = new TasklingConfiguration(configurationReader);
            }

            if (commonTokenRepository == null)
            {
                commonTokenRepository = new CommonTokenRepository();
            }

            if (executionTokenRepository == null)
            {
                executionTokenRepository = new ExecutionTokenRepository(commonTokenRepository);
            }

            if (eventsRepository == null)
            {
                eventsRepository = new EventsRepository();
            }

            if (taskExecutionRepository != null)
            {
                _taskExecutionRepository = taskExecutionRepository;
            }
            else
            {
                _taskExecutionRepository = new TaskExecutionRepository(taskRepository, executionTokenRepository, eventsRepository);
            }

            if (criticalSectionRepository != null)
            {
                _criticalSectionRepository = criticalSectionRepository;
            }
            else
            {
                _criticalSectionRepository = new CriticalSectionRepository(taskRepository, commonTokenRepository);
            }

            if (blockRepository == null)
            {
                blockRepository = new BlockRepository(taskRepository);
            }

            if (rangeBlockRepository != null)
            {
                _rangeBlockRepository = rangeBlockRepository;
            }
            else
            {
                _rangeBlockRepository = new RangeBlockRepository(taskRepository);
            }

            if (listBlockRepository != null)
            {
                _listBlockRepository = listBlockRepository;
            }
            else
            {
                _listBlockRepository = new ListBlockRepository(taskRepository);
            }

            if (objectBlockRepository != null)
            {
                _objectBlockRepository = objectBlockRepository;
            }
            else
            {
                _objectBlockRepository = new ObjectBlockRepository(taskRepository);
            }

            if (blockFactory != null)
            {
                _blockFactory = blockFactory;
            }
            else
            {
                _blockFactory = new BlockFactory(blockRepository, _rangeBlockRepository, _listBlockRepository, _objectBlockRepository, _taskExecutionRepository);
            }

            if (cleanUpRepository == null)
            {
                cleanUpRepository = new CleanUpRepository(taskRepository);
            }

            if (cleanUpService != null)
            {
                _cleanUpService = cleanUpService;
            }
            else
            {
                _cleanUpService = new CleanUpService(_configuration, cleanUpRepository);
            }
        }
Esempio n. 5
0
        public TasklingClient(IConfigurationReader configurationReader,
                              CustomDependencies customDependencies)
        {
            if (customDependencies.TaskRepository == null)
            {
                customDependencies.TaskRepository = new TaskRepository();
            }

            if (customDependencies.Configuration == null)
            {
                _configuration = new TasklingConfiguration(configurationReader);
            }

            if (customDependencies.CommonTokenRepository == null)
            {
                customDependencies.CommonTokenRepository = new CommonTokenRepository();
            }

            if (customDependencies.ExecutionTokenRepository == null)
            {
                customDependencies.ExecutionTokenRepository = new ExecutionTokenRepository(customDependencies.CommonTokenRepository);
            }

            if (customDependencies.EventsRepository == null)
            {
                customDependencies.EventsRepository = new EventsRepository();
            }

            if (customDependencies.TaskExecutionRepository != null)
            {
                _taskExecutionRepository = customDependencies.TaskExecutionRepository;
            }
            else
            {
                _taskExecutionRepository = new TaskExecutionRepository(customDependencies.TaskRepository, customDependencies.ExecutionTokenRepository, customDependencies.EventsRepository);
            }

            if (customDependencies.CriticalSectionRepository != null)
            {
                _criticalSectionRepository = customDependencies.CriticalSectionRepository;
            }
            else
            {
                _criticalSectionRepository = new CriticalSectionRepository(customDependencies.TaskRepository, customDependencies.CommonTokenRepository);
            }

            if (customDependencies.BlockRepository == null)
            {
                customDependencies.BlockRepository = new BlockRepository(customDependencies.TaskRepository);
            }

            if (customDependencies.RangeBlockRepository != null)
            {
                _rangeBlockRepository = customDependencies.RangeBlockRepository;
            }
            else
            {
                _rangeBlockRepository = new RangeBlockRepository(customDependencies.TaskRepository);
            }

            if (customDependencies.ListBlockRepository != null)
            {
                _listBlockRepository = customDependencies.ListBlockRepository;
            }
            else
            {
                _listBlockRepository = new ListBlockRepository(customDependencies.TaskRepository);
            }

            if (customDependencies.ObjectBlockRepository != null)
            {
                _objectBlockRepository = customDependencies.ObjectBlockRepository;
            }
            else
            {
                _objectBlockRepository = new ObjectBlockRepository(customDependencies.TaskRepository);
            }

            if (customDependencies.BlockFactory != null)
            {
                _blockFactory = customDependencies.BlockFactory;
            }
            else
            {
                _blockFactory = new BlockFactory(customDependencies.BlockRepository, _rangeBlockRepository, _listBlockRepository, _objectBlockRepository, _taskExecutionRepository);
            }

            if (customDependencies.CleanUpRepository == null)
            {
                customDependencies.CleanUpRepository = new CleanUpRepository(customDependencies.TaskRepository);
            }

            if (customDependencies.CleanUpService != null)
            {
                _cleanUpService = customDependencies.CleanUpService;
            }
            else
            {
                _cleanUpService = new CleanUpService(_configuration, customDependencies.CleanUpRepository);
            }
        }
Esempio n. 6
0
        public TasklingClient(IConfigurationReader configurationReader,
            ITaskRepository taskRepository = null,
            ITasklingConfiguration configuration = null,
            ITaskExecutionRepository taskExecutionRepository = null,
            IExecutionTokenRepository executionTokenRepository = null,
            ICommonTokenRepository commonTokenRepository = null,
            IEventsRepository eventsRepository = null,
            ICriticalSectionRepository criticalSectionRepository = null,
            IBlockFactory blockFactory = null,
            IBlockRepository blockRepository = null,
            IRangeBlockRepository rangeBlockRepository = null,
            IListBlockRepository listBlockRepository = null,
            IObjectBlockRepository objectBlockRepository = null,
            ICleanUpService cleanUpService = null,
            ICleanUpRepository cleanUpRepository = null)
        {
            if (taskRepository == null)
                taskRepository = new TaskRepository();

            if (configuration == null)
                _configuration = new TasklingConfiguration(configurationReader);

            if (commonTokenRepository == null)
                commonTokenRepository = new CommonTokenRepository();

            if (executionTokenRepository == null)
                executionTokenRepository = new ExecutionTokenRepository(commonTokenRepository);

            if (eventsRepository == null)
                eventsRepository = new EventsRepository();

            if (taskExecutionRepository != null)
                _taskExecutionRepository = taskExecutionRepository;
            else
                _taskExecutionRepository = new TaskExecutionRepository(taskRepository, executionTokenRepository, eventsRepository);

            if (criticalSectionRepository != null)
                _criticalSectionRepository = criticalSectionRepository;
            else
                _criticalSectionRepository = new CriticalSectionRepository(taskRepository, commonTokenRepository);

            if (blockRepository == null)
                blockRepository = new BlockRepository(taskRepository);

            if (rangeBlockRepository != null)
                _rangeBlockRepository = rangeBlockRepository;
            else
                _rangeBlockRepository = new RangeBlockRepository(taskRepository);

            if (listBlockRepository != null)
                _listBlockRepository = listBlockRepository;
            else
                _listBlockRepository = new ListBlockRepository(taskRepository);

            if (objectBlockRepository != null)
                _objectBlockRepository = objectBlockRepository;
            else
                _objectBlockRepository = new ObjectBlockRepository(taskRepository);

            if (blockFactory != null)
                _blockFactory = blockFactory;
            else
                _blockFactory = new BlockFactory(blockRepository, _rangeBlockRepository, _listBlockRepository, _objectBlockRepository, _taskExecutionRepository);

            if (cleanUpRepository == null)
                cleanUpRepository = new CleanUpRepository(taskRepository);

            if (cleanUpService != null)
                _cleanUpService = cleanUpService;
            else
                _cleanUpService = new CleanUpService(_configuration, cleanUpRepository);
        }
Esempio n. 7
0
        public TasklingClient(IConfigurationReader configurationReader,
            CustomDependencies customDependencies)
        {
            if (customDependencies.TaskRepository == null)
                customDependencies.TaskRepository = new TaskRepository();

            if (customDependencies.Configuration == null)
                _configuration = new TasklingConfiguration(configurationReader);

            if (customDependencies.CommonTokenRepository == null)
                customDependencies.CommonTokenRepository = new CommonTokenRepository();

            if (customDependencies.ExecutionTokenRepository == null)
                customDependencies.ExecutionTokenRepository = new ExecutionTokenRepository(customDependencies.CommonTokenRepository);

            if (customDependencies.EventsRepository == null)
                customDependencies.EventsRepository = new EventsRepository();

            if (customDependencies.TaskExecutionRepository != null)
                _taskExecutionRepository = customDependencies.TaskExecutionRepository;
            else
                _taskExecutionRepository = new TaskExecutionRepository(customDependencies.TaskRepository, customDependencies.ExecutionTokenRepository, customDependencies.EventsRepository);

            if (customDependencies.CriticalSectionRepository != null)
                _criticalSectionRepository = customDependencies.CriticalSectionRepository;
            else
                _criticalSectionRepository = new CriticalSectionRepository(customDependencies.TaskRepository, customDependencies.CommonTokenRepository);

            if (customDependencies.BlockRepository == null)
                customDependencies.BlockRepository = new BlockRepository(customDependencies.TaskRepository);

            if (customDependencies.RangeBlockRepository != null)
                _rangeBlockRepository = customDependencies.RangeBlockRepository;
            else
                _rangeBlockRepository = new RangeBlockRepository(customDependencies.TaskRepository);

            if (customDependencies.ListBlockRepository != null)
                _listBlockRepository = customDependencies.ListBlockRepository;
            else
                _listBlockRepository = new ListBlockRepository(customDependencies.TaskRepository);

            if (customDependencies.ObjectBlockRepository != null)
                _objectBlockRepository = customDependencies.ObjectBlockRepository;
            else
                _objectBlockRepository = new ObjectBlockRepository(customDependencies.TaskRepository);

            if (customDependencies.BlockFactory != null)
                _blockFactory = customDependencies.BlockFactory;
            else
                _blockFactory = new BlockFactory(customDependencies.BlockRepository, _rangeBlockRepository, _listBlockRepository, _objectBlockRepository, _taskExecutionRepository);

            if (customDependencies.CleanUpRepository == null)
                customDependencies.CleanUpRepository = new CleanUpRepository(customDependencies.TaskRepository);

            if (customDependencies.CleanUpService != null)
                _cleanUpService = customDependencies.CleanUpService;
            else
                _cleanUpService = new CleanUpService(_configuration, customDependencies.CleanUpRepository);
        }