Make lighty build voting in the CI
[transportpce.git] / pce / src / test / java / org / opendaylight / transportpce / pce / utils / NodeUtils.java
1 /*
2  * Copyright © 2020 Orange, Inc. and others.  All rights reserved.
3  *
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
7  */
8
9 package org.opendaylight.transportpce.pce.utils;
10
11 import java.math.RoundingMode;
12 import java.util.ArrayList;
13 import java.util.HashMap;
14 import java.util.List;
15 import java.util.Map;
16 import org.opendaylight.transportpce.common.NetworkUtils;
17 import org.opendaylight.transportpce.common.fixedflex.GridUtils;
18 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.link.types.rev191129.RatioDB;
19 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev230526.Link1Builder;
20 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev230526.TerminationPoint1Builder;
21 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.state.types.rev191129.State;
22 import org.opendaylight.yang.gen.v1.http.org.openroadm.equipment.states.types.rev191129.AdminStates;
23 import org.opendaylight.yang.gen.v1.http.org.openroadm.link.rev230526.span.attributes.LinkConcatenation1.FiberType;
24 import org.opendaylight.yang.gen.v1.http.org.openroadm.link.rev230526.span.attributes.LinkConcatenation1Builder;
25 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev230526.networks.network.link.OMSAttributesBuilder;
26 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev230526.networks.network.link.oms.attributes.SpanBuilder;
27 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev230526.networks.network.node.DegreeAttributes;
28 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev230526.networks.network.node.DegreeAttributesBuilder;
29 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev230526.networks.network.node.SrgAttributes;
30 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev230526.networks.network.node.SrgAttributesBuilder;
31 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev230526.networks.network.node.termination.point.CpAttributesBuilder;
32 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev230526.networks.network.node.termination.point.CtpAttributesBuilder;
33 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev230526.networks.network.node.termination.point.PpAttributesBuilder;
34 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev230526.networks.network.node.termination.point.RxTtpAttributesBuilder;
35 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev230526.networks.network.node.termination.point.TxTtpAttributesBuilder;
36 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev230526.networks.network.node.termination.point.XpdrClientAttributesBuilder;
37 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev230526.networks.network.node.termination.point.XpdrNetworkAttributesBuilder;
38 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev230526.networks.network.node.termination.point.XpdrPortAttributesBuilder;
39 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev230526.OpenroadmLinkType;
40 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev230526.OpenroadmTpType;
41 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev230526.link.concatenation.LinkConcatenation;
42 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev230526.link.concatenation.LinkConcatenationBuilder;
43 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev230526.link.concatenation.LinkConcatenationKey;
44 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev230526.xpdr.tp.supported.interfaces.SupportedInterfaceCapability;
45 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev230526.xpdr.tp.supported.interfaces.SupportedInterfaceCapabilityBuilder;
46 import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev230526.networks.network.node.termination.point.TpSupportedInterfacesBuilder;
47 import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev230526.networks.network.node.termination.point.XpdrTpPortConnectionAttributesBuilder;
48 import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.If100GEODU4;
49 import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.If10GEODU2e;
50 import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.If1GEODU0;
51 import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.IfOCHOTU4ODU4;
52 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.NetworkId;
53 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.NodeId;
54 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.networks.network.NodeBuilder;
55 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.networks.network.NodeKey;
56 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.networks.network.node.SupportingNode;
57 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.networks.network.node.SupportingNodeBuilder;
58 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.networks.network.node.SupportingNodeKey;
59 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.LinkId;
60 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.Node1Builder;
61 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.TpId;
62 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.networks.network.LinkBuilder;
63 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.networks.network.LinkKey;
64 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.networks.network.link.DestinationBuilder;
65 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.networks.network.link.SourceBuilder;
66 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.networks.network.node.TerminationPoint;
67 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.networks.network.node.TerminationPointBuilder;
68 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.networks.network.node.TerminationPointKey;
69 import org.opendaylight.yangtools.yang.common.Decimal64;
70 import org.opendaylight.yangtools.yang.common.Uint32;
71
72 public final class NodeUtils {
73
74     private static final String LINK_ID_FORMAT = "%1$s-%2$sto%3$s-%4$s";
75
76     public static LinkBuilder createLinkBuilder(boolean omsPresent,
77             String srcNode, String destNode, String srcTp, String destTp, Link1Builder link1Builder) {
78         LinkId linkId = new LinkId(String.format(LINK_ID_FORMAT, srcNode, srcTp, destNode, destTp));
79         var oppLink1 = link1Builder
80             .setOppositeLink(new LinkId(String.format(LINK_ID_FORMAT, destNode, destTp, srcNode, srcTp)))
81             .build();
82         LinkBuilder linkBldr =
83             new LinkBuilder()
84                 .setSource(
85                     new SourceBuilder().setSourceNode(new NodeId(srcNode)).setSourceTp(new TpId(srcTp)).build())
86                 .setDestination(
87                     new DestinationBuilder().setDestNode(new NodeId(destNode)).setDestTp(new TpId(destTp)).build())
88                 .setLinkId(linkId);
89         if (!omsPresent) {
90             return linkBldr
91                 .withKey(new LinkKey(linkId))
92                 .addAugmentation(oppLink1);
93         }
94         LinkConcatenation linkConcatenation = new LinkConcatenationBuilder()
95             .withKey(new LinkConcatenationKey(Uint32.valueOf(1)))
96             .setSRLGLength(Decimal64.valueOf(50000, RoundingMode.FLOOR))
97             .addAugmentation(new LinkConcatenation1Builder().setFiberType(FiberType.Smf).build())
98             .build();
99         return linkBldr
100                 .addAugmentation(
101                     new org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev230526.Link1Builder()
102                         .setAmplified(false)
103                         .setOMSAttributes(
104                             new OMSAttributesBuilder()
105                                 .setSpan(
106                                     new SpanBuilder()
107                                         .setSpanlossCurrent(new RatioDB(Decimal64.valueOf("20")))
108                                         .setLinkConcatenation(Map.of(linkConcatenation.key(), linkConcatenation))
109                                         .build())
110                                 .build())
111                         .build())
112                 .withKey(new LinkKey(linkId))
113                 .addAugmentation(oppLink1);
114     }
115
116     public static LinkBuilder createRoadmToRoadm(String srcNode, String destNode, String srcTp, String destTp) {
117         return createLinkBuilder(true, srcNode, destNode, srcTp, destTp,
118             new Link1Builder()
119                 .setLinkLatency(Uint32.valueOf(2))
120                 .setLinkLength(Decimal64.valueOf("50.0"))
121                 .setLinkType(OpenroadmLinkType.ROADMTOROADM)
122                 .setAdministrativeState(AdminStates.InService)
123                 .setOperationalState(State.InService));
124     }
125
126     public static LinkBuilder createAdd(String srcNode, String destNode, String srcTp, String destTp) {
127         return createLinkBuilder(false, srcNode, destNode, srcTp, destTp,
128             new Link1Builder()
129                .setLinkLatency(Uint32.valueOf(0))
130                .setLinkLength(Decimal64.valueOf("0.01"))
131                .setLinkType(OpenroadmLinkType.ADDLINK)
132                .setAdministrativeState(AdminStates.InService)
133                .setOperationalState(State.InService));
134     }
135
136     public static LinkBuilder createDrop(String srcNode, String destNode, String srcTp, String destTp) {
137         return createLinkBuilder(false, srcNode, destNode, srcTp, destTp,
138             new Link1Builder()
139                 .setLinkLatency(Uint32.valueOf(0))
140                 .setLinkLength(Decimal64.valueOf("0.01"))
141                 .setLinkType(OpenroadmLinkType.DROPLINK)
142                 .setAdministrativeState(AdminStates.InService)
143                 .setOperationalState(State.InService));
144     }
145
146     public static LinkBuilder createXpdrToSrg(String srcNode, String destNode, String srcTp, String destTp) {
147         return createLinkBuilder(false, srcNode, destNode, srcTp, destTp,
148             new Link1Builder()
149                 .setLinkLatency(Uint32.valueOf(0))
150                 .setLinkLength(Decimal64.valueOf("0.01"))
151                 .setLinkType(OpenroadmLinkType.XPONDEROUTPUT)
152                 .setAdministrativeState(AdminStates.InService)
153                 .setOperationalState(State.InService));
154     }
155
156     public static LinkBuilder createSrgToXpdr(String srcNode, String destNode, String srcTp, String destTp) {
157         return createLinkBuilder(false, srcNode, destNode, srcTp, destTp,
158             new Link1Builder()
159                 .setLinkLatency(Uint32.valueOf(0))
160                 .setLinkLength(Decimal64.valueOf("0.01"))
161                 .setLinkType(OpenroadmLinkType.XPONDERINPUT)
162                 .setAdministrativeState(AdminStates.InService)
163                 .setOperationalState(State.InService));
164     }
165
166     public static Map<SupportingNodeKey, SupportingNode> geSupportingNodes() {
167         SupportingNode supportingNode1 = new SupportingNodeBuilder()
168                 .setNodeRef(new NodeId("node 1"))
169                 .setNetworkRef(new NetworkId(NetworkUtils.CLLI_NETWORK_ID))
170                 .build();
171         SupportingNode supportingNode2 = new SupportingNodeBuilder()
172                 .setNodeRef(new NodeId("node 2"))
173                 .setNetworkRef(new NetworkId(NetworkUtils.UNDERLAY_NETWORK_ID))
174                 .build();
175         return new HashMap<>(
176             Map.of(
177                 supportingNode1.key(),supportingNode1,
178                 supportingNode2.key(),supportingNode2
179             ));
180     }
181
182     public static NodeBuilder getNodeBuilder(Map<SupportingNodeKey,SupportingNode> supportingNodes1) {
183         //update tp of nodes
184         TerminationPoint xpdrNw =
185             new TerminationPointBuilder()
186                 .withKey(new TerminationPointKey(new TpId("xpdrNWTXRX")))
187                 .addAugmentation(
188                     new TerminationPoint1Builder()
189                         .setTpType(OpenroadmTpType.XPONDERNETWORK)
190                         .build())
191                 .addAugmentation(
192                     new org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev230526
193                             .TerminationPoint1Builder()
194                         .setAdministrativeState(AdminStates.InService)
195                         .setOperationalState(State.InService)
196                         .build())
197                 .addAugmentation(
198                     new org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev230526
199                             .TerminationPoint1Builder()
200                         .setXpdrNetworkAttributes(
201                             new XpdrNetworkAttributesBuilder()
202                                 .setState(State.InService)
203                                 .build())
204                         .build())
205                 .build();
206         TerminationPoint xpdrClient =
207             new TerminationPointBuilder()
208                 .withKey(new TerminationPointKey(new TpId("xpdrClientTXRX")))
209                 .addAugmentation(
210                     new TerminationPoint1Builder()
211                         .setTpType(OpenroadmTpType.XPONDERCLIENT)
212                         .build())
213                 .addAugmentation(
214                     new org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev230526
215                             .TerminationPoint1Builder()
216                         .setAdministrativeState(AdminStates.InService)
217                         .setOperationalState(State.InService)
218                         .build())
219                 .build();
220         return new NodeBuilder()
221                 .setNodeId(new NodeId("XPDR1"))
222                 .withKey(new NodeKey(new NodeId("XPDR1")))
223                 .addAugmentation(
224                     new Node1Builder()
225                         .setTerminationPoint(Map.of(xpdrNw.key(),xpdrNw, xpdrClient.key(), xpdrClient))
226                         .build())
227                 .addAugmentation(
228                     new org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev230526.Node1Builder()
229                         .setAdministrativeState(AdminStates.InService)
230                         .setOperationalState(State.InService)
231                         .build())
232                 .setSupportingNode(supportingNodes1);
233     }
234
235     public static NodeBuilder getDegNodeBuilder(Map<SupportingNodeKey, SupportingNode> supportingNodes, String nodeId) {
236         // update tp of nodes
237         TerminationPoint degTTP = new TerminationPointBuilder()
238             .withKey(new TerminationPointKey(new TpId("DEG1-TTP-TXRX")))
239             .addAugmentation(
240                 new TerminationPoint1Builder()
241                     .setTpType(OpenroadmTpType.DEGREETXRXTTP)
242                     .setAdministrativeState(AdminStates.InService)
243                     .setOperationalState(State.InService)
244                     .build())
245             .build();
246         TerminationPoint degCTP = new TerminationPointBuilder()
247             .withKey(new TerminationPointKey(new TpId("DEG1-CTP-TXRX")))
248             .addAugmentation(
249                 new TerminationPoint1Builder()
250                     .setTpType(OpenroadmTpType.DEGREETXRXCTP)
251                     .setAdministrativeState(AdminStates.InService)
252                     .setOperationalState(State.InService)
253                     .build())
254             .build();
255         return new NodeBuilder()
256             .setNodeId(new NodeId(nodeId))
257             .withKey(new NodeKey(new NodeId(nodeId)))
258             .addAugmentation(
259                 new Node1Builder()
260                     .setTerminationPoint(Map.of(degTTP.key(), degTTP, degCTP.key(), degCTP))
261                 .build())
262             .addAugmentation(
263                 new org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev230526.Node1Builder()
264                     .setOperationalState(State.InService).setAdministrativeState(AdminStates.InService).build())
265             .setSupportingNode(supportingNodes);
266     }
267
268     public static NodeBuilder getSrgNodeBuilder(Map<SupportingNodeKey, SupportingNode> supportingNodes, String nodeId) {
269         // update tp of nodes
270         TerminationPoint srgPP = new TerminationPointBuilder()
271             .withKey(new TerminationPointKey(new TpId("SRG1-PP-TXRX")))
272             .addAugmentation(
273                 new TerminationPoint1Builder()
274                     .setTpType(OpenroadmTpType.SRGTXRXPP)
275                     .setAdministrativeState(AdminStates.InService)
276                     .setOperationalState(State.InService)
277                     .build())
278             .build();
279         TerminationPoint srgCP = new TerminationPointBuilder()
280             .withKey(new TerminationPointKey(new TpId("SRG1-CP-TXRX")))
281             .addAugmentation(
282                 new TerminationPoint1Builder()
283                     .setTpType(OpenroadmTpType.SRGTXRXCP)
284                     .setAdministrativeState(AdminStates.InService)
285                     .setOperationalState(State.InService)
286                     .build())
287             .build();
288         return new NodeBuilder()
289             .setNodeId(new NodeId(nodeId))
290             .withKey(new NodeKey(new NodeId(nodeId)))
291             .addAugmentation(
292                 new Node1Builder()
293                     .setTerminationPoint(Map.of(srgPP.key(), srgPP, srgCP.key(), srgCP)).build())
294             .addAugmentation(
295                 new org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev230526.Node1Builder()
296                     .setOperationalState(State.InService).setAdministrativeState(AdminStates.InService).build())
297             .setSupportingNode(supportingNodes);
298     }
299
300     // OTN network node
301     public static List<SupportingNode> getOTNSupportingNodes() {
302         return new ArrayList<>(
303             List.of(
304                 new SupportingNodeBuilder()
305                     .setNodeRef(new NodeId("node 1"))
306                     .setNetworkRef(new NetworkId(NetworkUtils.CLLI_NETWORK_ID))
307                     .build(),
308                 new SupportingNodeBuilder()
309                         .setNodeRef(new NodeId("node 2"))
310                         .setNetworkRef(new NetworkId(NetworkUtils.UNDERLAY_NETWORK_ID))
311                         .build()));
312     }
313
314     public static NodeBuilder getOTNNodeBuilder(Map<SupportingNodeKey,SupportingNode> supportingNodes1,
315             OpenroadmTpType openroadmTpType) {
316         TerminationPoint xpdr = getTerminationPointBuilder(openroadmTpType)
317                 .addAugmentation(getTerminationPoint1Builder(openroadmTpType).build())
318                 .addAugmentation(createAnother2TerminationPoint(openroadmTpType).build())
319                 .addAugmentation(createAnotherTerminationPoint(openroadmTpType).build())
320                 .build();
321         return new NodeBuilder()
322                 .setNodeId(new NodeId("node_test"))
323                 .withKey(new NodeKey(new NodeId("node 1")))
324                 .addAugmentation(new Node1Builder().setTerminationPoint(Map.of(xpdr.key(),xpdr)).build())
325                 .addAugmentation(getNode1())
326                 .addAugmentation(
327                     new org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226
328                         .Node1Builder()
329                         .setTerminationPoint(Map.of(xpdr.key(),xpdr))
330                         .build())
331                 .setSupportingNode(supportingNodes1);
332     }
333
334     public static NodeBuilder getOTNNodeBuilderEmpty(Map<SupportingNodeKey,SupportingNode> supportingNodes1,
335             OpenroadmTpType openroadmTpType) {
336         TerminationPoint xpdr = getTerminationPointBuilder(openroadmTpType)
337             .addAugmentation(getTerminationPoint1Builder(openroadmTpType).build())
338             .addAugmentation(createAnotherTerminationPoint(openroadmTpType).build())
339             .build();
340         return new NodeBuilder()
341                 .setNodeId(new NodeId("node_test"))
342                 .withKey(new NodeKey(new NodeId("node 1")))
343                 .addAugmentation(
344                     new Node1Builder()
345                         .setTerminationPoint(Map.of(xpdr.key(),xpdr))
346                         .build())
347                 .addAugmentation(getNode1Empty())
348                 .setSupportingNode(supportingNodes1);
349     }
350
351     private static org.opendaylight.yang.gen.v1.http
352             .org.openroadm.network.topology.rev230526.Node1 getNode1() {
353         return new org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev230526.Node1Builder()
354                 .setSrgAttributes(getSrgAttributes())
355                 .setDegreeAttributes(getDegAttributes())
356                 .build();
357     }
358
359     private static org.opendaylight.yang.gen.v1.http
360             .org.openroadm.network.topology.rev230526.Node1 getNode1Empty() {
361         return new org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev230526.Node1Builder()
362                 .setSrgAttributes(getEmptySrgAttributes())
363                 .setDegreeAttributes(getEmptyDegAttributes())
364                 .build();
365     }
366
367     private static DegreeAttributes getDegAttributes() {
368         return (new DegreeAttributesBuilder())
369                 .setAvailFreqMaps(GridUtils.initFreqMaps4FixedGrid2Available())
370                 .build();
371     }
372
373     private static SrgAttributes getSrgAttributes() {
374         return new SrgAttributesBuilder().setAvailFreqMaps(GridUtils.initFreqMaps4FixedGrid2Available()).build();
375     }
376
377     private static DegreeAttributes getEmptyDegAttributes() {
378         return (new DegreeAttributesBuilder())
379                 .setAvailFreqMaps(Map.of())
380                 .build();
381     }
382
383     private static SrgAttributes getEmptySrgAttributes() {
384         return new SrgAttributesBuilder().setAvailFreqMaps(Map.of()).build();
385     }
386
387     private static TerminationPointBuilder getTerminationPointBuilder(OpenroadmTpType openroadmTpType) {
388         return new TerminationPointBuilder()
389                 .setTpId(new TpId("2"))
390                 .addAugmentation(createOTNTerminationPoint(openroadmTpType).build());
391     }
392
393     private static org.opendaylight.yang.gen.v1.http
394             .org.openroadm.common.network.rev230526.TerminationPoint1Builder getTerminationPoint1Builder(
395                 OpenroadmTpType openroadmTpType) {
396         return new org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev230526.TerminationPoint1Builder()
397                 .setTpType(openroadmTpType);
398
399     }
400
401     private static org.opendaylight.yang.gen.v1.http
402             .org.openroadm.network.topology.rev230526.TerminationPoint1Builder createAnotherTerminationPoint(
403                 OpenroadmTpType openroadmTpType) {
404         return new org.opendaylight
405                 .yang.gen.v1.http.org.openroadm.network.topology.rev230526.TerminationPoint1Builder()
406                 .setCtpAttributes((new CtpAttributesBuilder()).build())
407                 .setCpAttributes((new CpAttributesBuilder()).build())
408                 .setTxTtpAttributes((new TxTtpAttributesBuilder()).setUsedWavelengths(Map.of()).build())
409                 .setRxTtpAttributes((new RxTtpAttributesBuilder()).setUsedWavelengths(Map.of()).build())
410                 .setPpAttributes((new PpAttributesBuilder()).setUsedWavelength(Map.of()).build())
411                 .setXpdrClientAttributes((new XpdrClientAttributesBuilder()).build())
412                 .setXpdrPortAttributes((new XpdrPortAttributesBuilder()).build())
413                 .setXpdrNetworkAttributes(new XpdrNetworkAttributesBuilder()
414                         .setTailEquipmentId("destNode" + "--" + "destTp").build());
415     }
416
417     private static org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev230526
418             .TerminationPoint1Builder createOTNTerminationPoint(OpenroadmTpType openroadmTpType) {
419         SupportedInterfaceCapability supIfCapa = new SupportedInterfaceCapabilityBuilder()
420                 .setIfCapType(IfOCHOTU4ODU4.VALUE)
421                 .build();
422         SupportedInterfaceCapability supIfCapa1 = new SupportedInterfaceCapabilityBuilder()
423                 .setIfCapType(If100GEODU4.VALUE)
424                 .build();
425         SupportedInterfaceCapability supIfCapa2 = new SupportedInterfaceCapabilityBuilder()
426                 .setIfCapType(If10GEODU2e.VALUE)
427                 .build();
428         SupportedInterfaceCapability supIfCapa3 = new SupportedInterfaceCapabilityBuilder()
429                 .setIfCapType(If1GEODU0.VALUE)
430                 .build();
431         return new org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev230526
432                 .TerminationPoint1Builder()
433                 .setTpSupportedInterfaces(
434                     new TpSupportedInterfacesBuilder()
435                         .setSupportedInterfaceCapability(
436                             new HashMap<>(
437                                 Map.of(
438                                     supIfCapa.key(),supIfCapa,
439                                     supIfCapa1.key(),supIfCapa1,
440                                     supIfCapa2.key(),supIfCapa2,
441                                     supIfCapa3.key(),supIfCapa3))
442                          )
443                         .build()
444                 )
445                 .setXpdrTpPortConnectionAttributes(new XpdrTpPortConnectionAttributesBuilder().build());
446     }
447
448     private static org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev230526
449             .TerminationPoint1Builder createAnother2TerminationPoint(OpenroadmTpType openroadmTpType) {
450         return new org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev230526
451                 .TerminationPoint1Builder()
452                 .setOperationalState(State.InService)
453                 .setAdministrativeState(AdminStates.InService)
454                 .setTpType(openroadmTpType);
455     }
456
457     private NodeUtils() {
458         throw new IllegalStateException("Utility class");
459     }
460 }