2 * Copyright © 2020 AT&T 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;
11 import java.util.Collections;
12 import java.util.List;
13 import org.opendaylight.transportpce.common.OperationResult;
14 import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev220926.link.tp.LinkTp;
15 import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev220926.node.interfaces.NodeInterface;
17 public final class OtnDeviceRenderingResult extends OperationResult {
18 private final List<NodeInterface> renderedNodeInterfaces;
19 private final List<LinkTp> otnLinkTps;
22 private OtnDeviceRenderingResult(boolean success, String message, List<NodeInterface> renderedNodeInterfaces,
23 List<LinkTp> otnLinkTps) {
24 super(success, message);
25 this.renderedNodeInterfaces =
26 renderedNodeInterfaces == null
27 ? Collections.emptyList()
28 : Collections.unmodifiableList(renderedNodeInterfaces);
31 ? Collections.emptyList()
32 : Collections.unmodifiableList(otnLinkTps);
35 public List<NodeInterface> getRenderedNodeInterfaces() {
36 return this.renderedNodeInterfaces;
39 public List<LinkTp> getOtnLinkTps() {
40 return this.otnLinkTps;
43 public static OtnDeviceRenderingResult failed(String message) {
44 return new OtnDeviceRenderingResult(false, message, null, null);
47 public static OtnDeviceRenderingResult ok(List<NodeInterface> renderedNodeInterfaces,
48 List<LinkTp> otnLinkTps) {
49 return new OtnDeviceRenderingResult(true, "", renderedNodeInterfaces, otnLinkTps);