Search in sources :

Example 1 with ApplicationControllerCallback

use of org.onap.so.adapters.appc.orchestrator.client.ApplicationControllerCallback in project so by onap.

the class ApplicationControllerTaskImplITTest method setup.

@Before
public void setup() {
    request = new ApplicationControllerTaskRequest();
    request.setRequestorId("testRequestorId");
    request.setBookName("testBookName");
    request.setControllerType("testControllerType");
    request.setFileParameters("testFileParams");
    request.setIdentityUrl("testIdentityUrl");
    request.setNewSoftwareVersion("2.0");
    request.setExistingSoftwareVersion("1.0");
    request.setOperationsTimeout("30");
    ApplicationControllerVnf applicationControllerVnf = new ApplicationControllerVnf();
    applicationControllerVnf.setVnfHostIpAddress("100.100");
    applicationControllerVnf.setVnfId("testVnfId");
    applicationControllerVnf.setVnfName("testVnfName");
    request.setApplicationControllerVnf(applicationControllerVnf);
    listener = new ApplicationControllerCallback(null, externalTaskService, appCSupport);
}
Also used : ApplicationControllerVnf(org.onap.so.appc.orchestrator.service.beans.ApplicationControllerVnf) ApplicationControllerTaskRequest(org.onap.so.appc.orchestrator.service.beans.ApplicationControllerTaskRequest) ApplicationControllerCallback(org.onap.so.adapters.appc.orchestrator.client.ApplicationControllerCallback) Before(org.junit.Before)

Example 2 with ApplicationControllerCallback

use of org.onap.so.adapters.appc.orchestrator.client.ApplicationControllerCallback in project so by onap.

the class ApplicationControllerTask method executeExternalTask.

protected void executeExternalTask(ExternalTask externalTask, ExternalTaskService externalTaskService) {
    mdcSetup.setupMDC(externalTask);
    ApplicationControllerTaskRequest request = externalTask.getVariable("appcOrchestratorRequest");
    String msoRequestId = externalTask.getVariable("mso-request-id");
    logger.debug("Starting External Task for RequestId: {} ", msoRequestId);
    Status status = null;
    ApplicationControllerCallback listener = new ApplicationControllerCallback(externalTask, externalTaskService, applicationControllerSupport);
    try {
        status = applicationControllerTaskImpl.execute(msoRequestId, request, listener);
        if (status != null && status.getCode() != 0 && !applicationControllerSupport.getCategoryOf(status).equals(StatusCategory.NORMAL)) {
            logger.error("The External Task Id: {} Failed locally with status {}", externalTask.getId(), status.getMessage());
            externalTaskService.handleBpmnError(externalTask, "MSOWorkflowException", status.getMessage());
        }
    } catch (Exception e) {
        logger.error("The External Task Id: {} Failed while calling appc with exception", externalTask.getId(), e.getMessage());
        externalTaskService.handleBpmnError(externalTask, "MSOWorkflowException", e.getMessage());
    }
}
Also used : Status(org.onap.appc.client.lcm.model.Status) ApplicationControllerTaskRequest(org.onap.so.appc.orchestrator.service.beans.ApplicationControllerTaskRequest) ApplicationControllerCallback(org.onap.so.adapters.appc.orchestrator.client.ApplicationControllerCallback)

Example 3 with ApplicationControllerCallback

use of org.onap.so.adapters.appc.orchestrator.client.ApplicationControllerCallback in project so by onap.

the class ApplicationControllerCallbackTest method setup.

@Before
public void setup() {
    MockitoAnnotations.initMocks(this);
    appcTaskCallback = new ApplicationControllerCallback(mockExternalTask, mockExternalTaskService, applicationControllerSupport);
}
Also used : ApplicationControllerCallback(org.onap.so.adapters.appc.orchestrator.client.ApplicationControllerCallback) Before(org.junit.Before)

Example 4 with ApplicationControllerCallback

use of org.onap.so.adapters.appc.orchestrator.client.ApplicationControllerCallback in project so by onap.

the class ApplicationControllerTaskImplTest method setup.

@Before
public void setup() {
    request = new ApplicationControllerTaskRequest();
    request.setBookName("testBookName");
    request.setControllerType("testControllerType");
    request.setFileParameters("testFileParams");
    request.setIdentityUrl("testIdentityUrl");
    request.setNewSoftwareVersion("2.0");
    request.setExistingSoftwareVersion("1.0");
    request.setOperationsTimeout("30");
    request.setRequestorId("testRequestorId");
    Map<String, String> reqConfigParams = new HashMap<>();
    reqConfigParams.put("name1", "value1");
    reqConfigParams.put("name2", "value2");
    request.setConfigParams(reqConfigParams);
    ApplicationControllerVnf applicationControllerVnf = new ApplicationControllerVnf();
    applicationControllerVnf.setVnfHostIpAddress("100.100");
    applicationControllerVnf.setVnfId("testVnfId");
    applicationControllerVnf.setVnfName("testVnfName");
    request.setApplicationControllerVnf(applicationControllerVnf);
    listener = new ApplicationControllerCallback(null, null, null);
}
Also used : ApplicationControllerVnf(org.onap.so.appc.orchestrator.service.beans.ApplicationControllerVnf) ApplicationControllerTaskRequest(org.onap.so.appc.orchestrator.service.beans.ApplicationControllerTaskRequest) HashMap(java.util.HashMap) ApplicationControllerCallback(org.onap.so.adapters.appc.orchestrator.client.ApplicationControllerCallback) Before(org.junit.Before)

Aggregations

ApplicationControllerCallback (org.onap.so.adapters.appc.orchestrator.client.ApplicationControllerCallback)4 Before (org.junit.Before)3 ApplicationControllerTaskRequest (org.onap.so.appc.orchestrator.service.beans.ApplicationControllerTaskRequest)3 ApplicationControllerVnf (org.onap.so.appc.orchestrator.service.beans.ApplicationControllerVnf)2 HashMap (java.util.HashMap)1 Status (org.onap.appc.client.lcm.model.Status)1