2 * Copyright © 2024 Smartoptics and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.transportpce.renderer.provisiondevice.tasks;
11 import java.util.ArrayList;
12 import java.util.Collection;
13 import java.util.List;
14 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev211004.renderer.rollback.output.FailedToRollback;
16 public class RollbackResultMessage implements ResultMessage {
19 public String createErrorMessage(Collection<FailedToRollback> failedRollbacks) {
20 List<String> failedRollbackNodes = new ArrayList<>();
22 failedRollbacks.forEach(failedRollback -> {
23 var intf = failedRollback.getInterface();
25 failedRollbackNodes.add(
26 failedRollback.getNodeId()
28 + intf == null ? "" : String.join(", ", intf)
32 return String.join(System.lineSeparator(), failedRollbackNodes);