Example #1
0
 public IJobHandler BuildBruteforce(AbstractJob job)
 => new BruteforceJobHandler(_krakerApi,
                             _workedFolders.TempFolderPath,
                             _tempFileManager,
                             _agentIdManager.GetCurrent().Id,
                             _speedCalculator,
                             _logger,
                             job as BruteforceJob,
                             _executorBuilder);
Example #2
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 #3
0
 private string GetAgentId()
 => _agentIdManager.GetCurrent().Id ?? throw new InvalidOperationException("The agent needs to have id");