2 * Copyright © 2019 Orange, Inc. 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.pce.gnpy;
11 import java.math.BigDecimal;
12 import java.util.ArrayList;
13 import java.util.HashMap;
14 import java.util.List;
16 import java.util.concurrent.ExecutionException;
17 import java.util.regex.Pattern;
18 import java.util.stream.IntStream;
20 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
21 import org.opendaylight.transportpce.common.NetworkUtils;
22 import org.opendaylight.transportpce.common.network.NetworkTransactionService;
23 import org.opendaylight.yang.gen.v1.gnpy.gnpy.network.topology.rev181214.Coordinate;
24 import org.opendaylight.yang.gen.v1.gnpy.gnpy.network.topology.rev181214.Km;
25 import org.opendaylight.yang.gen.v1.gnpy.gnpy.network.topology.rev181214.edfa.params.Operational;
26 import org.opendaylight.yang.gen.v1.gnpy.gnpy.network.topology.rev181214.edfa.params.OperationalBuilder;
27 import org.opendaylight.yang.gen.v1.gnpy.gnpy.network.topology.rev181214.element.type.choice.element.type.Edfa;
28 import org.opendaylight.yang.gen.v1.gnpy.gnpy.network.topology.rev181214.element.type.choice.element.type.EdfaBuilder;
29 import org.opendaylight.yang.gen.v1.gnpy.gnpy.network.topology.rev181214.element.type.choice.element.type.FiberRoadmBuilder;
30 import org.opendaylight.yang.gen.v1.gnpy.gnpy.network.topology.rev181214.element.type.choice.element.type.Transceiver;
31 import org.opendaylight.yang.gen.v1.gnpy.gnpy.network.topology.rev181214.element.type.choice.element.type.TransceiverBuilder;
32 import org.opendaylight.yang.gen.v1.gnpy.gnpy.network.topology.rev181214.element.type.choice.element.type.fiberroadm.Params;
33 import org.opendaylight.yang.gen.v1.gnpy.gnpy.network.topology.rev181214.element.type.choice.element.type.fiberroadm.ParamsBuilder;
34 import org.opendaylight.yang.gen.v1.gnpy.gnpy.network.topology.rev181214.element.type.choice.element.type.fiberroadm.params.fiberroadm.Fiber;
35 import org.opendaylight.yang.gen.v1.gnpy.gnpy.network.topology.rev181214.element.type.choice.element.type.fiberroadm.params.fiberroadm.FiberBuilder;
36 import org.opendaylight.yang.gen.v1.gnpy.gnpy.network.topology.rev181214.element.type.choice.element.type.fiberroadm.params.fiberroadm.Roadm;
37 import org.opendaylight.yang.gen.v1.gnpy.gnpy.network.topology.rev181214.element.type.choice.element.type.fiberroadm.params.fiberroadm.RoadmBuilder;
38 import org.opendaylight.yang.gen.v1.gnpy.gnpy.network.topology.rev181214.location.attributes.Location;
39 import org.opendaylight.yang.gen.v1.gnpy.gnpy.network.topology.rev181214.location.attributes.LocationBuilder;
40 import org.opendaylight.yang.gen.v1.gnpy.gnpy.network.topology.rev181214.topo.Connections;
41 import org.opendaylight.yang.gen.v1.gnpy.gnpy.network.topology.rev181214.topo.ConnectionsBuilder;
42 import org.opendaylight.yang.gen.v1.gnpy.gnpy.network.topology.rev181214.topo.Elements;
43 import org.opendaylight.yang.gen.v1.gnpy.gnpy.network.topology.rev181214.topo.ElementsBuilder;
44 import org.opendaylight.yang.gen.v1.gnpy.gnpy.network.topology.rev181214.topo.elements.Metadata;
45 import org.opendaylight.yang.gen.v1.gnpy.gnpy.network.topology.rev181214.topo.elements.MetadataBuilder;
46 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev181130.Link1;
47 import org.opendaylight.yang.gen.v1.http.org.openroadm.link.rev181130.SpanAttributes;
48 import org.opendaylight.yang.gen.v1.http.org.openroadm.link.rev181130.amplified.link.attributes.AmplifiedLink;
49 import org.opendaylight.yang.gen.v1.http.org.openroadm.link.rev181130.amplified.link.attributes.amplified.link.section.element.section.element.Span;
50 import org.opendaylight.yang.gen.v1.http.org.openroadm.link.rev181130.amplified.link.attributes.amplified.link.section.element.section.element.ila.Ila;
51 import org.opendaylight.yang.gen.v1.http.org.openroadm.link.rev181130.span.attributes.LinkConcatenation;
52 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.rev181130.Node1;
53 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev181130.networks.network.link.OMSAttributes;
54 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev181130.OpenroadmLinkType;
55 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
56 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address;
57 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.NetworkId;
58 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.Networks;
59 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.networks.Network;
60 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.networks.NetworkKey;
61 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.networks.network.Node;
62 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.networks.network.node.SupportingNode;
63 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.Network1;
64 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.networks.network.Link;
65 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
66 import org.slf4j.Logger;
67 import org.slf4j.LoggerFactory;
70 * Class to create the topology corresponding to GNPy requirements.
72 * @author Ahmed Triki ( ahmed.triki@orange.com )
76 public class GnpyTopoImpl {
77 private static final Logger LOG = LoggerFactory.getLogger(GnpyTopoImpl.class);
78 private final NetworkTransactionService networkTransactionService;
80 private List<Elements> elements = new ArrayList<>();
81 private List<Connections> connections = new ArrayList<>();
83 //Mapping between the ord-topo and ord-ntw node
84 private Map<String, String> mapDisgNodeRefNode = new HashMap<String, String>();
85 //Mapping between the ord-ntw and node ip
86 private Map<String, IpAddress> mapNodeRefIp = new HashMap<String, IpAddress>();
87 //Mapping between the ROADM-ROADM linkId/secElement and the linkId
88 private Map<String, List<String>> mapLinkFiber = new HashMap<String, List<String>>();
89 //Mapping between the ROADM-ROADM linkId/secElement and ipAddress
90 private Map<String, IpAddress> mapFiberIp = new HashMap<String, IpAddress>();
92 private List<String> trxList = new ArrayList<>();
93 //Initialize the 32 bit identifiers for the edfa and the fiber.
94 //These 32-bit identifiers are not ipv4 addresses (despite having ipv4Adresses format, dotted-decimal notation).
95 //They are imposed by the GNPy yang model to identify network elements and not used for any routing purposes.
96 private Ipv4Address edfaId;
97 private Ipv4Address fiberId;
98 private static final double LATITUDE = 0;
99 private static final double LONGITUTE = 0;
100 private static final String REGION = "N/A";
101 private static final String CITY = "N/A";
102 private static final int CONVERT_KM_M = 1000;
103 private static final double TARGET_PCH_OUT_DB = -20;
106 * Construct the ExtractTopoDataStoreImpl.
108 public GnpyTopoImpl(final NetworkTransactionService networkTransactionService) throws GnpyException {
109 this.networkTransactionService = networkTransactionService;
110 //32-bit identifier for the fiber. The dotted decimal notation has the format 243.x.x.x (0<=x<=255)
111 fiberId = new Ipv4Address("243.0.0.1");
112 //32-bit identifier for the edfa. The dotted decimal notation has the format 244.x.x.x (0<=x<=255)
113 edfaId = new Ipv4Address("244.0.0.1");
116 } catch (NullPointerException e) {
117 throw new GnpyException("In GnpyTopoImpl: one of the elements is null",e);
122 * extract the topology: all the elements have ipAddress as uid and maintain
123 * a mapping structure to map between the nodeId and the ipAddress (uid)
126 private void extractTopo() throws GnpyException {
127 // Define the instance identifier of the OpenRoadm topology
128 InstanceIdentifier<Network> insIdOpenRoadmTopo = InstanceIdentifier
129 .builder(Networks.class)
130 .child(Network.class, new NetworkKey(new NetworkId(NetworkUtils.OVERLAY_NETWORK_ID))).build();
131 // Define the instance identifier of the OpenRoadm network
132 InstanceIdentifier<Network> insIdrOpenRoadmNet = InstanceIdentifier
133 .builder(Networks.class)
134 .child(Network.class, new NetworkKey(new NetworkId(NetworkUtils.UNDERLAY_NETWORK_ID))).build();
136 // Initialize the reading of the networkTransactionService
137 // read the configuration part of the data broker that concerns the openRoadm topology and get all the nodes
138 java.util.Optional<Network> openRoadmTopo = this.networkTransactionService
139 .read(LogicalDatastoreType.CONFIGURATION, insIdOpenRoadmTopo).get();
140 java.util.Optional<Network> openRoadmNet = this.networkTransactionService
141 .read(LogicalDatastoreType.CONFIGURATION, insIdrOpenRoadmNet).get();
142 if (openRoadmNet.isPresent() && openRoadmTopo.isPresent()) {
143 extractElements(openRoadmTopo,openRoadmNet);
144 extractConnections(openRoadmTopo,openRoadmNet);
145 LOG.debug("In GnpyTopoImpl : elements and connections are well extracted");
148 throw new GnpyException(
149 "In GnpyTopoImpl : openroadm topology network or openroadm network are not well mounted ...");
151 } catch (InterruptedException | ExecutionException e) {
152 this.networkTransactionService.close();
153 throw new GnpyException("In gnpyTopoImpl: error in reading the topology", e);
155 this.networkTransactionService.close();
158 private void extractElements(java.util.Optional<Network> openRoadmTopo,
159 java.util.Optional<Network> openRoadmNet) throws GnpyException {
160 // Create the list of nodes
161 List<Node> openRoadmNetNodeList = openRoadmNet.get().getNode();
162 List<Node> openRoadmTopoNodeList = openRoadmTopo.get().getNode();
163 List<String> nodesList = new ArrayList<>();
165 if (openRoadmTopoNodeList.isEmpty() || openRoadmNetNodeList.isEmpty()) {
166 throw new GnpyException("In gnpyTopoImpl: no nodes in the openradm topology or openroadm network");
169 for (Node openRoadmTopoNode : openRoadmTopoNodeList) {
170 // Retrieve the supporting node and the type of the node in openRoadm network
171 List<SupportingNode> supportingNodeList = openRoadmTopoNode.getSupportingNode();
173 for (SupportingNode supportingNode : supportingNodeList) {
174 if (!supportingNode.getNetworkRef().getValue().equals("openroadm-network")) {
177 IpAddress ipAddress = null;
178 String nodeRef = supportingNode.getNodeRef().getValue();
179 // Retrieve the mapping between the openRoadm topology and openRoadm network
180 mapDisgNodeRefNode.put(openRoadmTopoNode.getNodeId().getValue(), nodeRef);
181 Node1 openRoadmNetNode1 = null;
182 org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev181130
183 .Node1 commonNetworkNode1 = null;
184 for (Node openRoadmNetNode : openRoadmNetNodeList) {
185 if (openRoadmNetNode.getNodeId().getValue().equals(nodeRef)) {
186 openRoadmNetNode1 = openRoadmNetNode.augmentation(Node1.class);
187 commonNetworkNode1 = openRoadmNetNode.augmentation(org.opendaylight.yang.gen.v1
188 .http.org.openroadm.common.network.rev181130.Node1.class);
189 ipAddress = openRoadmNetNode1.getIp();
190 mapNodeRefIp.put(nodeRef, ipAddress);
194 if (commonNetworkNode1.getNodeType().getName().equals("ROADM")) {
195 if (!nodesList.contains(nodeRef)) {
196 Elements element = createElementsRoadm(LATITUDE, LONGITUTE, nodeRef,
197 openRoadmNetNode1.getShelf(),TARGET_PCH_OUT_DB, ipAddress.getIpv4Address().getValue());
198 this.elements.add(element);
199 nodesList.add(nodeRef);
201 } else if (commonNetworkNode1.getNodeType().getName().equals("XPONDER")) {
202 if (!nodesList.contains(nodeRef)) {
203 Elements element = createElementsTransceiver(LATITUDE, LONGITUTE, nodeRef,
204 openRoadmNetNode1.getShelf(),ipAddress.getIpv4Address().getValue());
205 this.elements.add(element);
206 nodesList.add(nodeRef);
207 trxList.add(nodeRef);
210 throw new GnpyException("In gnpyTopoImpl: the type is not implemented");
216 private void extractConnections(java.util.Optional<Network> openRoadmTopo,
217 java.util.Optional<Network> openRoadmNet) throws GnpyException {
218 // Create the list of connections
219 Network1 nw1 = openRoadmTopo.get().augmentation(Network1.class);
220 List<Link> linksList = nw1.getLink();
221 // 1:EXPRESS-LINK 2:ADD-LINK 3:DROP-LINK
222 // 4:ROADM-To-ROADM 5:XPONDER-INPUT 6:XPONDER-OUTPUT
223 int[] externalLink = {OpenroadmLinkType.ROADMTOROADM.getIntValue(),OpenroadmLinkType.XPONDERINPUT.getIntValue(),
224 OpenroadmLinkType.XPONDEROUTPUT.getIntValue()};
226 if (linksList.isEmpty()) {
227 throw new GnpyException("In gnpyTopoImpl: no links in the network");
230 for (Link link : linksList) {
231 Link1 link1 = link.augmentation(Link1.class);
232 org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev181130
233 .Link1 openroadmNetworkLink1 = link.augmentation(org.opendaylight.yang.gen.v1.http.org
234 .openroadm.network.topology.rev181130.Link1.class);
235 int linkType = link1.getLinkType().getIntValue();
236 if (! IntStream.of(externalLink).anyMatch(x -> x == linkType)) {
240 String srcId = mapDisgNodeRefNode.get(link.getSource().getSourceNode().getValue());
241 IpAddress srcIp = mapNodeRefIp.get(srcId);
242 String linkId = link.getLinkId().getValue();
243 String destId = null;
244 IpAddress destIp = null;
245 if (linkType == OpenroadmLinkType.ROADMTOROADM.getIntValue()) {
246 OMSAttributes omsAttributes = openroadmNetworkLink1.getOMSAttributes();
247 if (omsAttributes == null) {
248 throw new GnpyException(String.format(
249 "In gnpyTopoImpl: OMS attributes do not exit for ROADM to ROADM link: %s",linkId));
251 //Case of amplified link
252 if (omsAttributes.getAmplifiedLink() != null) {
253 srcIp = extractAmplifiedLink(omsAttributes, linkId, srcIp);
255 //Case of one span link
256 if (omsAttributes.getSpan() != null) {
257 srcIp = extractSpanLink(omsAttributes, linkId, srcIp);
261 destId = mapDisgNodeRefNode.get(link.getDestination().getDestNode().getValue());
262 destIp = mapNodeRefIp.get(destId);
263 createNewConnection(srcIp,destIp);
267 private IpAddress extractAmplifiedLink(OMSAttributes omsAttributes, String linkId, IpAddress srcIp)
268 throws GnpyException {
270 List<AmplifiedLink> amplifiedLinkList = omsAttributes.getAmplifiedLink()
272 IpAddress destIp = null;
273 if (!amplifiedLinkList.isEmpty()) {
274 for (AmplifiedLink amplifiedLink : amplifiedLinkList) {
275 String secElt = amplifiedLink.getSectionEltNumber().toString();
277 if (amplifiedLink.getSectionElement().getSectionElement() instanceof Ila) {
278 Ila ila = (Ila) amplifiedLink.getSectionElement().getSectionElement();
279 destIp = extractILAFromAmpLink(ila);
282 if (amplifiedLink.getSectionElement().getSectionElement() instanceof Span) {
283 Span span = (Span) amplifiedLink.getSectionElement().getSectionElement();
284 destIp = extractSpan((SpanAttributes) span.getSpan(), linkId, secElt);
287 if (createNewConnection(srcIp,destIp)) {
295 private IpAddress extractSpanLink(OMSAttributes omsAttributes, String linkId, IpAddress srcIp)
296 throws GnpyException {
298 SpanAttributes span = omsAttributes.getSpan();
299 IpAddress destIp = extractSpan((SpanAttributes) span, linkId, linkId);
300 if (createNewConnection(srcIp, destIp)) {
306 private IpAddress extractILAFromAmpLink(Ila ila) throws GnpyException {
307 String nodeId = ila.getNodeId().getValue();
308 IpAddress ipEdfa = new IpAddress(edfaId);
309 edfaId = incrementIdentifier(edfaId);
310 mapDisgNodeRefNode.put(nodeId, nodeId);
311 mapNodeRefIp.put(nodeId, ipEdfa);
312 Elements element = createElementsEdfa(LATITUDE, LONGITUTE, REGION, CITY,
313 ila.getGain().getValue(), ila.getTilt().getValue(),
314 ila.getOutVoaAtt().getValue(), "std_medium_gain",
315 ipEdfa.getIpv4Address().getValue());
316 this.elements.add(element);
320 private IpAddress extractSpan(SpanAttributes span, String linkId, String subLinkId) throws GnpyException {
321 IpAddress ipFiber = new IpAddress(fiberId);
323 if (!mapLinkFiber.containsKey(linkId)) {
324 mapLinkFiber.put(linkId, new ArrayList<String>());
326 mapLinkFiber.get(linkId).add(subLinkId);
327 mapFiberIp.put(subLinkId, ipFiber);
328 fiberId = incrementIdentifier(fiberId);
332 String typeVariety = "SSMF";
334 // Compute the length of the link
335 List<LinkConcatenation> linkConcatenationList = span.getLinkConcatenation();
336 for (LinkConcatenation linkConcatenation : linkConcatenationList) {
337 double srlgLength = linkConcatenation.getSRLGLength();
338 //convert to kilometer
339 length += srlgLength / CONVERT_KM_M;
341 double lossCoef = span.getSpanlossCurrent().getValue().doubleValue() / length;
342 Elements element = createElementsFiber(LATITUDE, LONGITUTE, REGION, CITY,
343 ipFiber.getIpv4Address().getValue(), length, attIn, lossCoef, connIn, connOut, typeVariety);
344 this.elements.add(element);
350 * Method to create Fiber
352 private Elements createElementsFiber(double latitude, double longitude, String region, String city, String uidFiber,
353 double length, double attIn, double lossCoef, double connIn, double connOut, String typeVariety) {
354 // Create an amplifier after the ROADM
355 Coordinate c1 = new Coordinate(new BigDecimal(latitude));
356 Coordinate c2 = new Coordinate(new BigDecimal(longitude));
357 Location location1 = new LocationBuilder().setRegion(region).setCity(city).setLatitude(c1).setLongitude(c2)
359 Metadata metadata1 = new MetadataBuilder().setLocation(location1).build();
360 Fiber fiber = new FiberBuilder().setLength(new BigDecimal(length)).setLengthUnits(Km.class)
361 .setAttIn(new BigDecimal(attIn)).setLossCoef(new BigDecimal(lossCoef)).setConIn(new BigDecimal(connIn))
362 .setConOut(new BigDecimal(connOut)).build();
363 Params params1 = new ParamsBuilder().setFiberroadm(fiber).build();
364 Elements element1 = new ElementsBuilder().setUid(uidFiber)
365 .setType(org.opendaylight.yang.gen.v1.gnpy.gnpy.network.topology.rev181214.Fiber.class)
366 .setTypeVariety(typeVariety).setMetadata(metadata1)
367 .setElementType(new FiberRoadmBuilder().setParams(params1).build()).build();
372 * Method to create EDFA
374 private Elements createElementsEdfa(double latitude, double longitude, String region, String city,
375 BigDecimal gainTarget, BigDecimal tiltTarget, BigDecimal outVoa, String typeVariety, String uidEdfa) {
376 // Create an amplifier after the ROADM
377 Coordinate c1 = new Coordinate(new BigDecimal(latitude));
378 Coordinate c2 = new Coordinate(new BigDecimal(longitude));
379 Location location1 = new LocationBuilder().setRegion(region).setCity(city).setLatitude(c1).setLongitude(c2)
381 Metadata metadata1 = new MetadataBuilder().setLocation(location1).build();
382 Operational operational = new OperationalBuilder().setGainTarget(gainTarget).setTiltTarget(tiltTarget)
383 .setOutVoa(outVoa).build();
384 Edfa edfa = new EdfaBuilder()
385 .setOperational(operational).build();
386 Elements element1 = new ElementsBuilder().setUid(uidEdfa)
387 .setType(org.opendaylight.yang.gen.v1.gnpy.gnpy.network.topology.rev181214.Edfa.class)
388 .setMetadata(metadata1).setElementType(edfa).setTypeVariety(typeVariety).build();
393 * Method to create ROADM
395 private Elements createElementsRoadm(double latitude, double longitude, String region, String city,
396 double targetPchOutDb, String uidRoadm) {
398 Coordinate c1 = new Coordinate(new BigDecimal(latitude));
399 Coordinate c2 = new Coordinate(new BigDecimal(longitude));
400 Location location1 = new LocationBuilder().setRegion(region).setCity(city).setLatitude(c1).setLongitude(c2)
402 Metadata metadata1 = new MetadataBuilder().setLocation(location1).build();
403 Roadm roadm = new RoadmBuilder().setTargetPchOutDb(new BigDecimal(targetPchOutDb)).build();
404 Params params1 = new ParamsBuilder().setFiberroadm(roadm).build();
405 Elements element1 = new ElementsBuilder().setUid(uidRoadm)
406 .setType(org.opendaylight.yang.gen.v1.gnpy.gnpy.network.topology.rev181214.Roadm.class)
407 .setMetadata(metadata1).setElementType(new FiberRoadmBuilder().setParams(params1).build()).build();
412 * Method to create Transceiver
414 private Elements createElementsTransceiver(double latitude, double longitude, String region, String city,
416 Coordinate c1 = new Coordinate(new BigDecimal(latitude));
417 Coordinate c2 = new Coordinate(new BigDecimal(longitude));
418 Location location1 = new LocationBuilder().setRegion(region).setCity(city).setLatitude(c1).setLongitude(c2)
420 Metadata metadata1 = new MetadataBuilder().setLocation(location1).build();
421 Transceiver transceiver = new TransceiverBuilder().build();
422 Elements element1 = new ElementsBuilder().setUid(uidTrans)
423 .setType(org.opendaylight.yang.gen.v1.gnpy.gnpy.network.topology.rev181214.Transceiver.class)
424 .setMetadata(metadata1).setElementType(transceiver).build();
429 * Method to create Connection
431 private boolean createNewConnection(IpAddress srcIp, IpAddress destIp) throws GnpyException {
432 if (srcIp == null || destIp == null) {
433 throw new GnpyException("create new connection : null node IpAddress");
435 String fromNode = srcIp.getIpv4Address().getValue();
436 String toNode = destIp.getIpv4Address().getValue();
437 if (fromNode == toNode) {
440 Connections connection = new ConnectionsBuilder().setFromNode(fromNode).setToNode(toNode).build();
441 this.connections.add(connection);
446 * Increment 32-bit identifier
448 private Ipv4Address incrementIdentifier(Ipv4Address id) throws GnpyException {
449 String ips = id.getValue();
450 String [] fields = ips.split(Pattern.quote("."));
451 int intF1 = Integer.parseInt(fields[1]);
452 int intF2 = Integer.parseInt(fields[2]);
453 int intF3 = Integer.parseInt(fields[3]);
466 throw new GnpyException("GnpyTopoImpl : the topology is not supported by gnpy");
468 fields[1] = Integer.toString(intF1);
470 fields[2] = Integer.toString(intF2);
472 fields[3] = Integer.toString(intF3);
473 String nidString = fields[0] + "." + fields[1] + "." + fields[2] + "." + fields[3];
474 Ipv4Address nid = new Ipv4Address(nidString);
478 public List<Elements> getElements() {
482 public void setElements(List<Elements> elements) {
483 this.elements = elements;
486 public List<Connections> getConnections() {
490 public void setConnections(List<Connections> connections) {
491 this.connections = connections;
494 public Map<String, String> getMapDisgNodeRefNode() {
495 return mapDisgNodeRefNode;
498 public void setMapDisgNodeRefNode(Map<String, String> mapDisgNodeRefNode) {
499 this.mapDisgNodeRefNode = mapDisgNodeRefNode;
502 public Map<String, IpAddress> getMapNodeRefIp() {
506 public void setMapNodeRefIp(Map<String, IpAddress> mapNodeRefIp) {
507 this.mapNodeRefIp = mapNodeRefIp;
510 public Map<String, List<String>> getMapLinkFiber() {
514 public void setMapLinkFiber(Map<String, List<String>> mapLinkFiber) {
515 this.mapLinkFiber = mapLinkFiber;
518 public Map<String, IpAddress> getMapFiberIp() {
522 public void setMapFiberIp(Map<String, IpAddress> mapFiberIp) {
523 this.mapFiberIp = mapFiberIp;
526 public List<String> getTrxList() {
530 public void setTrxList(List<String> trxList) {
531 this.trxList = trxList;