Search in sources :

Example 6 with Request

use of org.jboss.pnc.api.dto.Request in project pnc by project-ncl.

the class DeliverableAnalyzerManagerImpl method startAnalysis.

private void startAnalysis(String milestoneId, List<String> sourcesLink, Base32LongID operationId) {
    Request callback = operationsManager.getOperationCallback(operationId);
    String id = operationId.getId();
    try (RestConnector restConnector = new RestConnector(bpmConfig)) {
        AnalyzeDeliverablesBpmRequest bpmRequest = new AnalyzeDeliverablesBpmRequest(id, milestoneId, sourcesLink);
        AnalyzeDeliverablesTask analyzeTask = new AnalyzeDeliverablesTask(bpmRequest, callback);
        restConnector.startProcess(bpmConfig.getAnalyzeDeliverablesBpmProcessId(), analyzeTask, id, userService.currentUserToken());
        DeliverableAnalysisStatusChangedEvent analysisStatusChanged = DefaultDeliverableAnalysisStatusChangedEvent.started(id, milestoneId, sourcesLink);
        analysisStatusChangedEventNotifier.fire(analysisStatusChanged);
    } catch (ProcessManagerException e) {
        log.error("Error trying to start analysis of deliverables task for milestone: {}", milestoneId, e);
        throw new RuntimeException(e);
    }
}
Also used : RestConnector(org.jboss.pnc.bpm.RestConnector) ProcessManagerException(org.jboss.pnc.spi.exception.ProcessManagerException) AnalyzeDeliverablesTask(org.jboss.pnc.bpm.task.AnalyzeDeliverablesTask) AnalyzeDeliverablesBpmRequest(org.jboss.pnc.bpm.model.AnalyzeDeliverablesBpmRequest) Request(org.jboss.pnc.api.dto.Request) AnalyzeDeliverablesBpmRequest(org.jboss.pnc.bpm.model.AnalyzeDeliverablesBpmRequest)

Aggregations

Request (org.jboss.pnc.api.dto.Request)6 ArrayList (java.util.ArrayList)3 IOException (java.io.IOException)2 URI (java.net.URI)2 URISyntaxException (java.net.URISyntaxException)2 List (java.util.List)2 TimeoutException (java.util.concurrent.TimeoutException)2 Consumer (java.util.function.Consumer)2 Inject (javax.inject.Inject)2 AnalyzeDeliverablesBpmRequest (org.jboss.pnc.bpm.model.AnalyzeDeliverablesBpmRequest)2 AnalyzeDeliverablesTask (org.jboss.pnc.bpm.task.AnalyzeDeliverablesTask)2 TaskStatusUpdateEvent (org.jboss.pnc.buildagent.api.TaskStatusUpdateEvent)2 HttpClient (org.jboss.pnc.buildagent.common.http.HttpClient)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 LoggedRequest (com.github.tomakehurst.wiremock.verification.LoggedRequest)1 Headers (io.undertow.util.Headers)1 MalformedURLException (java.net.MalformedURLException)1 URL (java.net.URL)1 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)1 Map (java.util.Map)1