2 * Copyright © 2017 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
8 package org.opendaylight.transportpce.renderer.provisiondevice;
10 import java.util.Collections;
11 import java.util.List;
12 import org.opendaylight.transportpce.common.OperationResult;
13 import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev210618.link.tp.LinkTp;
14 import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev210618.node.interfaces.NodeInterface;
15 import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev210618.optical.renderer.nodes.Nodes;
17 public final class DeviceRenderingResult extends OperationResult {
19 private final List<Nodes> olmList;
20 private final List<NodeInterface> renderedNodeInterfaces;
21 private final List<LinkTp> otnLinkTps;
23 private DeviceRenderingResult(boolean success, String message, List<Nodes> olmList,
24 List<NodeInterface> renderedNodeInterfaces, List<LinkTp> otnLinkTps) {
25 super(success, message);
28 ? Collections.emptyList()
29 : Collections.unmodifiableList(olmList);
30 this.renderedNodeInterfaces =
31 renderedNodeInterfaces == null
32 ? Collections.emptyList()
33 : Collections.unmodifiableList(renderedNodeInterfaces);
36 ? Collections.emptyList()
37 : Collections.unmodifiableList(otnLinkTps);
40 public List<Nodes> getOlmList() {
44 public List<NodeInterface> getRenderedNodeInterfaces() {
45 return this.renderedNodeInterfaces;
48 public List<LinkTp> getOtnLinkTps() {
49 return this.otnLinkTps;
52 public static DeviceRenderingResult failed(String message) {
53 return new DeviceRenderingResult(false, message, null, null, null);
56 public static DeviceRenderingResult ok(List<Nodes> olmNodeList, List<NodeInterface> renderedNodeInterfaces,
57 List<LinkTp> otnLinkTps) {
58 return new DeviceRenderingResult(true, "", olmNodeList, renderedNodeInterfaces, otnLinkTps);