blob: 2923ec06774882148c47e74a8a9c47de1022f3e2 [file] [log] [blame]
Andrea Campanellae1e3e442019-10-21 13:45:32 +02001/*
2 * Copyright 2018-present Open Networking Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package org.onosproject.odtn.impl;
17
18import com.google.common.annotations.Beta;
19import org.onosproject.net.ConnectPoint;
20import org.onosproject.net.DeviceId;
21import org.onosproject.net.Link;
22import org.onosproject.net.OchSignal;
23
24import java.util.List;
25import java.util.Map;
26
27/**
28 * This class contains information given by gNPY for a given path.
29 */
30@Beta
31public final class GnpyPowerInfo {
32
33 private Map<DeviceId, Double> deviceAtoBPowerMap;
34 private Map<DeviceId, Double> deviceBtoAPowerMap;
35 private double launchPower;
36 private List<Link> path;
37 private ConnectPoint ingress;
38 private ConnectPoint egress;
39 private OchSignal ochSignal;
40
41 /**
42 * Creates the class with information.
43 *
44 * @param deviceAtoBPowerMap the power in a to b direction
45 * @param deviceBtoAPowerMap the power in b to a direction
46 * @param launchPower the power at the TXs
47 * @param path the pat
48 * @param ingress the ingress device (A)
49 * @param egress the egress device (B)
50 * @param ochSignal the signal
51 */
52 public GnpyPowerInfo(Map<DeviceId, Double> deviceAtoBPowerMap,
53 Map<DeviceId, Double> deviceBtoAPowerMap, double launchPower,
54 List<Link> path, ConnectPoint ingress, ConnectPoint egress,
55 OchSignal ochSignal) {
56 this.deviceAtoBPowerMap = deviceAtoBPowerMap;
57 this.deviceBtoAPowerMap = deviceBtoAPowerMap;
58 this.launchPower = launchPower;
59 this.path = path;
60 this.ingress = ingress;
61 this.egress = egress;
62 this.ochSignal = ochSignal;
63 }
64
65 /**
66 * Retrieve the ingress connect point of the path (A).
67 *
68 * @return ingress connect point
69 */
70 public ConnectPoint ingress() {
71 return ingress;
72 }
73
74 /**
75 * Retrieve the egress connect point of the path (B).
76 *
77 * @return egress connect point
78 */
79 public ConnectPoint egress() {
80 return egress;
81 }
82
83 /**
84 * Retrieve the ochSignal.
85 *
86 * @return signal
87 */
88 public OchSignal ochSignal() {
89 return ochSignal;
90 }
91
92 /**
93 * Retrieve the the power in a to b direction.
94 *
95 * @return power map a to b
96 */
97 public Map<DeviceId, Double> deviceAtoBPowerMap() {
98 return deviceAtoBPowerMap;
99 }
100
101 /**
102 * Retrieve the power in b to a direction.
103 *
104 * @return power map b to a
105 */
106 public Map<DeviceId, Double> deviceBtoAPowerMap() {
107 return deviceBtoAPowerMap;
108 }
109
110 /**
111 * Retrieve the launch power at the TX, both A and B.
112 *
113 * @return ingress connect point
114 */
115 public double launchPower() {
116 return launchPower;
117 }
118
119 /**
120 * Retrieve the set of links for the path in the network.
121 *
122 * @return links fo the path
123 */
124 public List<Link> path() {
125 return path;
126 }
127}