- OtnServicePathOutput output = this.otnDeviceRenderer.setupOtnServicePath(this.otnServicePathInput);
- if (Boolean.TRUE.equals(output.isSuccess())) {
- LOG.info("Device rendering finished successfully.");
- return OtnDeviceRenderingResult.ok(new ArrayList<>(output.nonnullNodeInterface().values()));
-
- } else {
- //false or null case
- LOG.warn("Device rendering not successfully finished.");
+ OtnServicePathOutput output;
+ String operation;
+ switch (this.otnServicePathInput.getOperation()) {
+ case Create:
+ operation = "setup";
+ output = this.otnDeviceRenderer.setupOtnServicePath(this.otnServicePathInput, this.serviceType);
+ break;
+ case Delete:
+ operation = "delete";
+ output = this.otnDeviceRenderer.deleteOtnServicePath(this.otnServicePathInput, this.serviceType);
+ break;
+ default:
+ return OtnDeviceRenderingResult.failed("Device rendering failed - unknown operation");
+ }
+ if (!output.getSuccess()) {
+ LOG.error("Device rendering {} otn service path failed.", operation);