Search in sources :

Example 1 with ApplicationControllerOrchestratorException

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

the class ApplicationControllerClient method vnfCommand.

public Status vnfCommand(Action action, String requestId, String vnfId, Optional<String> vserverId, Optional<String> request, String controllerType, ApplicationControllerCallback listener, String requestorId) throws ApplicationControllerOrchestratorException {
    this.setControllerType(controllerType);
    Status status;
    ActionIdentifiers actionIdentifiers = new ActionIdentifiers();
    actionIdentifiers.setVnfId(vnfId);
    if (vserverId.isPresent()) {
        actionIdentifiers.setVserverId(vserverId.get());
    }
    Payload payload = null;
    if (request.isPresent()) {
        payload = new Payload(request.get());
    }
    status = runCommand(action, actionIdentifiers, payload, requestId, listener, requestorId);
    if (appCSupport.getCategoryOf(status).equals(StatusCategory.ERROR)) {
        throw new ApplicationControllerOrchestratorException(status.getMessage(), status.getCode());
    } else {
        return status;
    }
}
Also used : Status(org.onap.appc.client.lcm.model.Status) Payload(org.onap.appc.client.lcm.model.Payload) ActionIdentifiers(org.onap.appc.client.lcm.model.ActionIdentifiers) ApplicationControllerOrchestratorException(org.onap.so.adapters.appc.orchestrator.client.ApplicationControllerOrchestratorException)

Aggregations

ActionIdentifiers (org.onap.appc.client.lcm.model.ActionIdentifiers)1 Payload (org.onap.appc.client.lcm.model.Payload)1 Status (org.onap.appc.client.lcm.model.Status)1 ApplicationControllerOrchestratorException (org.onap.so.adapters.appc.orchestrator.client.ApplicationControllerOrchestratorException)1