Example #1
0
 public AgentBuilder(IJobHandlerProvider jobHandlerProvider,
                     IAgentIdManager agentIdManager,
                     IKrakerApi krakerApi,
                     ILogger logger)
 {
     _jobHandlerProvider = jobHandlerProvider;
     _agentIdManager     = agentIdManager;
     _krakerApi          = krakerApi;
     _logger             = logger;
 }
 public AgentRegistrationManager(
     IKrakerApi krakerApi,
     IAgentInfoManager agentInfoManager,
     IAgentInfoProvider agentInfoProvider,
     IAgentIdManager agentIdManager)
 {
     _krakerApi         = krakerApi;
     _agentInfoManager  = agentInfoManager;
     _agentInfoProvider = agentInfoProvider;
     _agentIdManager    = agentIdManager;
 }
Example #3
0
 public JobHandlerBuilder(IKrakerApi krakerApi,
                          IWorkedFoldersProvider workedFoldersProvider,
                          ITempFileManager tempFileManager,
                          IAgentIdManager agentIdManager,
                          ISpeedCalculator speedCalculator,
                          ILogger logger,
                          IHashCatCommandExecutorBuilder executorBuilder)
 {
     _krakerApi       = krakerApi;
     _workedFolders   = workedFoldersProvider.Get();
     _tempFileManager = tempFileManager;
     _agentIdManager  = agentIdManager;
     _speedCalculator = speedCalculator;
     _logger          = logger;
     _executorBuilder = executorBuilder;
 }
Example #4
0
        public Agent(IJobHandlerProvider jobHandlerProvider,
                     IAgentIdManager agentIdManager,
                     IKrakerApi krakerApi,
                     ILogger logger)
        {
            _switch             = new FiniteStateMachine(WaitJob);
            _jobHandlerProvider = jobHandlerProvider;
            _krakerApi          = krakerApi;
            _logger             = logger;
            _agentId            = agentIdManager.GetCurrent().Id
                                  ?? throw new InvalidOperationException("The agent needs to have id");

            var incorrectJobHandler = new IncorrectJobHandler(new IncorrectJob("Haven't got any jobs"));

            _jobHandler          = incorrectJobHandler;
            _incorrectJobHandler = incorrectJobHandler;
        }
Example #5
0
        public InventoryManager(
            AppFolder appFolder,
            ILogger logger,
            IWorkedFoldersProvider workedFoldersProvider,
            IFileDescriptionBuilder descriptionBuilder,
            IKrakerApi krakerApi,
            IAgentIdManager agentIdManager)
        {
            _logger             = logger;
            _descriptionBuilder = descriptionBuilder;
            _krakerApi          = krakerApi;
            _agentIdManager     = agentIdManager;
            _workedFolders      = workedFoldersProvider.Get();
            _inventoryFilePath  = Path.Combine(appFolder.Value, ArtefactsFolder, InventoryFile);

            _fileDescriptions = new Dictionary <string, FileDescription>();
            _currentInventory = new Inventory(_fileDescriptions.Values);
        }