}
grouping PCE-resource {
- description
- "This resource identifier is intended to provide a generic identifer
- for any resource that can be used without specific knowledge of
- the resource.";
- container resource {
- choice resource {
- case termination-point {
- leaf tp-id {
- type string; //to be clarified with topology model
- }
- leaf tp-node-id {
- type string; //to be clarified with topology model
+ description
+ "This resource identifier is intended to provide a generic identifer
+ for any resource that can be used without specific knowledge of
+ the resource.";
+ container resource {
+ choice resource {
+ case termination-point {
+ container termination-point-identifier {
+ leaf tp-id {
+ type string; //to be clarified with topology model
+ }
+ leaf node-id {
+ type string; //to be clarified with topology model
+ }
+ }
}
- }
- case link {
- leaf link-id {
- type string; //to be clarified with topology model
+ case link {
+ container link-identifier {
+ leaf link-id {
+ type string; //to be clarified with topology model
+ }
+ }
}
- }
- case node {
- leaf node-id {
- type string; // to be clarified with topology model
+ case node {
+ container node-identifier {
+ leaf node-id {
+ type string; // to be clarified with topology model
+ }
+ }
}
}
}
}
- }
grouping path-description {
if (pathAend instanceof Node && pathZend instanceof Node) {
Node aend = (Node) pathAend;
Node zend = (Node) pathZend;
- if (aend.getNodeId().compareToIgnoreCase(inputAend) == 0) {
- if (zend.getNodeId().compareToIgnoreCase(inputZend) == 0) {
+ if (aend.getNodeIdentifier().getNodeId().compareToIgnoreCase(inputAend) == 0) {
+ if (zend.getNodeIdentifier().getNodeId().compareToIgnoreCase(inputZend) == 0) {
result = true;
}
}
if (res1 instanceof Node && res2 instanceof Node) {
Node node1 = (Node)res1;
Node node2 = (Node)res2;
- if (node1.getNodeId().compareTo(node2.getNodeId()) == 0) {
+ if (node1.getNodeIdentifier().getNodeId()
+ .compareTo(node2.getNodeIdentifier().getNodeId()) == 0) {
result = true;
}
}
if (res1 instanceof TerminationPoint && res2 instanceof TerminationPoint) {
TerminationPoint tp1 = (TerminationPoint)res1;
TerminationPoint tp2 = (TerminationPoint)res2;
- if (tp1.getTpNodeId().compareTo(tp2.getTpNodeId()) == 0) {
- if (tp1.getTpId().compareTo(tp2.getTpId()) == 0) {
+ if (tp1.getTerminationPointIdentifier().getNodeId()
+ .compareTo(tp2.getTerminationPointIdentifier().getNodeId()) == 0) {
+ if (tp1.getTerminationPointIdentifier().getTpId()
+ .compareTo(tp2.getTerminationPointIdentifier().getTpId()) == 0) {
result = true;
}
}
if (res1 instanceof Link && res2 instanceof Link) {
Link link1 = (Link)res1;
Link link2 = (Link)res2;
- if (link1.getLinkId().compareTo(link2.getLinkId()) == 0) {
+ if (link1.getLinkIdentifier().getLinkId().compareTo(link2.getLinkIdentifier().getLinkId()) == 0) {
result = true;
}
if (res != null && res instanceof Node) {
Node node = (Node) res;
for (String exclude : nodes) {
- if (exclude.compareToIgnoreCase(node.getNodeId()) == 0) {
+ if (exclude.compareToIgnoreCase(node.getNodeIdentifier().getNodeId()) == 0) {
LOG.info("Node not excluded !");
found = true;
break;
ztoa.clear();
resources.add(new ResourceBuilder().setResource(tpIn).build());
- ids.add(tpIn.getTpNodeId().concat("-").concat(tpIn.getTpId()));
+ ids.add(tpIn.getTerminationPointIdentifier().getNodeId().concat("-")
+ .concat(tpIn.getTerminationPointIdentifier().getTpId()));
resources.add(new ResourceBuilder().setResource(node).build());
- ids.add(node.getNodeId());
+ ids.add(node.getNodeIdentifier().getNodeId());
resources.add(new ResourceBuilder().setResource(tpOut).build());
- ids.add(tpOut.getTpNodeId().concat("-").concat(tpOut.getTpId()));
+ ids.add(tpOut.getTerminationPointIdentifier().getNodeId().concat("-")
+ .concat(tpOut.getTerminationPointIdentifier().getTpId()));
}
/**
@Override
public String toString() {
StringBuilder result = new StringBuilder("[ ");
- result.append("tpIn : " + tpIn.getTpId());
- result.append(" - Node : " + node.getNodeId());
- result.append(" - tpOut : " + tpOut.getTpId());
+ result.append("tpIn : " + tpIn.getTerminationPointIdentifier().getTpId());
+ result.append(" - Node : " + node.getNodeIdentifier().getNodeId());
+ result.append(" - tpOut : " + tpOut.getTerminationPointIdentifier().getTpId());
result.append(" ]");
return result.toString();
import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.resource.resource.Link;
import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.resource.resource.LinkBuilder;
import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.resource.resource.TerminationPoint;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.resource.resource.link.LinkIdentifierBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
}
for (Path deg1Path : deb.getPath()) {
TpNodeTp tmpdeg = deg1Path.getTpNodeTp();
- if (tmpdeg.getTpIn().getTpId().contains("TTP")) {
+ if (tmpdeg.getTpIn().getTerminationPointIdentifier().getTpId().contains("TTP")) {
result.clear();
result.addAll(Lists.newArrayList(deg1Path));
if (!twotoOne) {
}
for (Path deg2Path : end.getPath()) {
TpNodeTp tmpdeg = deg2Path.getTpNodeTp();
- if (tmpdeg.getTpIn().getTpId().contains("CTP")) {
+ if (tmpdeg.getTpIn().getTerminationPointIdentifier().getTpId().contains("CTP")) {
result.clear();
result.addAll(Lists.newArrayList(deg2Path));
if (!twotoOne) {
List<Path> result = new ArrayList<Path>();
for (Path degPath : deg.getPath()) {
TpNodeTp tmpdeg = degPath.getTpNodeTp();
- if (tmpdeg.getTpIn().getTpId().contains("TTP")) {
+ if (tmpdeg.getTpIn().getTerminationPointIdentifier().getTpId().contains("TTP")) {
for (Path srgPath : srg.getPath()) {
TpNodeTp tmpsrg = srgPath.getTpNodeTp();
- if (tmpsrg.getTpIn().getTpId().contains("CP")) {
+ if (tmpsrg.getTpIn().getTerminationPointIdentifier().getTpId().contains("CP")) {
for (Path xpdrPath : xpdr.getPath()) {
TpNodeTp tmpxpdr = xpdrPath.getTpNodeTp();
- if (tmpxpdr.getTpIn().getTpId().contains("NETWORK")) {
+ if (tmpxpdr.getTpIn().getTerminationPointIdentifier().getTpId().contains("NETWORK")) {
result.clear();
result.addAll(Lists.newArrayList(degPath,srgPath,xpdrPath));
if (reverse) {
List<Path> result = new ArrayList<Path>();
for (Path xpdrPath : xpdr.getPath()) {
TpNodeTp tmpxpdr = xpdrPath.getTpNodeTp();
- if (tmpxpdr.getTpIn().getTpId().contains("CLIENT")) {
+ if (tmpxpdr.getTpIn().getTerminationPointIdentifier().getTpId().contains("CLIENT")) {
for (Path srgPath : srg.getPath()) {
TpNodeTp tmp = srgPath.getTpNodeTp();
Link srglink = srgPath.getLink();
- if (tmp.getTpIn().getTpId().contains("PP")) {
+ if (tmp.getTpIn().getTerminationPointIdentifier().getTpId().contains("PP")) {
for (Path deg1Path : deg1.getPath()) {
TpNodeTp tmpdeg = deg1Path.getTpNodeTp();
- if (tmpdeg.getTpIn().getTpId().contains("CTP")
- && srglink.getLinkId().contains("DEG1")) {
+ if (tmpdeg.getTpIn().getTerminationPointIdentifier().getTpId().contains("CTP")
+ && srglink.getLinkIdentifier().getLinkId().contains("DEG1")) {
result.clear();
result.addAll(Lists.newArrayList(xpdrPath,srgPath,deg1Path));
if (reverse) {
}
for (Path deg2Path : deg2.getPath()) {
TpNodeTp tmpdeg = deg2Path.getTpNodeTp();
- if (tmpdeg.getTpIn().getTpId().contains("CTP")
- && srglink.getLinkId().contains("DEG2")) {
+ if (tmpdeg.getTpIn().getTerminationPointIdentifier().getTpId().contains("CTP")
+ && srglink.getLinkIdentifier().getLinkId().contains("DEG2")) {
result.clear();
result.addAll(Lists.newArrayList(xpdrPath,srgPath,deg2Path));
if (reverse) {
case 1: //last link
if (res instanceof Link) {
Link tp = (Link) res;
- if (tp != null && tp.getLinkId().contains(endBy)) {
+ if (tp != null && tp.getLinkIdentifier().getLinkId().contains(endBy)) {
result.add(tmp);
}
}
case 2: //last tp
if (res instanceof TerminationPoint) {
TerminationPoint tp = (TerminationPoint) res;
- if (tp != null && tp.getTpId().contains(endBy)) {
+ if (tp != null && tp.getTerminationPointIdentifier().getTpId()
+ .contains(endBy)) {
result.add(tmp);
}
}
.rev170426.pce.resource.resource.Resource res = atoz.getResource().getResource();
if (res != null && res instanceof Link) {
Link link = new LinkBuilder()
- .setLinkId(atozLink)
+ .setLinkIdentifier(new LinkIdentifierBuilder()
+ .setLinkId(atozLink)
+ .build())
.build();
AToZKey atozKey = new AToZKey(atoz.getKey());
org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface
.rev170426.pce.resource.resource.Resource res = atoz.getResource().getResource();
if (res != null && res instanceof TerminationPoint) {
TerminationPoint tp = (TerminationPoint) res;
- if (tp != null && tp.getTpId().contains(beginBy)) {
+ if (tp != null && tp.getTerminationPointIdentifier().getTpId().contains(beginBy)) {
LOG.info("tmp : {}", tmp.toString());
result.add(tmp);
}
import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.resource.resource.NodeBuilder;
import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.resource.resource.TerminationPoint;
import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.resource.resource.TerminationPointBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.resource.resource.link.LinkIdentifierBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.resource.resource.node.NodeIdentifierBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.resource.resource.termination.point.TerminationPointIdentifierBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
List<LogicalConnectionPoint> resLcps = resource.getLcps();
for (String tmp : resLinks) {
Link link = new LinkBuilder()
- .setLinkId(tmp)
+ .setLinkIdentifier(new LinkIdentifierBuilder()
+ .setLinkId(tmp)
+ .build())
.build();
links.add(link);
}
xpdr = true;
buildXpdrTopo(nodeid,resLinks,resLcps,xpdr);
links.add(new LinkBuilder()
- .setLinkId("TAIL-LINKS")
+ .setLinkIdentifier(new LinkIdentifierBuilder()
+ .setLinkId("TAIL-LINKS")
+ .build())
.build());
}
if (nodeid.contains("SRG")) {
xpdr = false;
buildXpdrTopo(nodeid,resLinks,resLcps,xpdr);
links.add(new LinkBuilder()
- .setLinkId("EXTERNAL-LINKS")
+ .setLinkIdentifier(new LinkIdentifierBuilder()
+ .setLinkId("EXTERNAL-LINKS")
+ .build())
.build());
}
}
Path resourcePath = null;
List<TpNodeTp> direction = new ArrayList<TpNodeTp>();
for (Link link : links) {
- String linkId = link.getLinkId();
+ String linkId = link.getLinkIdentifier().getLinkId();
LOG.info("LinkId : {}", linkId);
if (!isXpdrSrgAbsent) {
- if (StringUtils.countMatches(link.getLinkId(), "ROADM") < 2) {
+ if (StringUtils.countMatches(link.getLinkIdentifier().getLinkId(), "ROADM") < 2) {
if ((linkId.contains("XPDR") && linkId.startsWith("ROADM"))
|| ((linkId.startsWith("DEG") && linkId.contains("SRG")))
|| (nodeId.contains("XPDR") && linkId.contains("TAIL-LINKS"))) {
LOG.info("link is deg to deg link !");
}
} else {
- if (StringUtils.countMatches(link.getLinkId(), "ROADM") == 2) {
+ if (StringUtils.countMatches(link.getLinkIdentifier().getLinkId(), "ROADM") == 2) {
direction = reverseTpNodetpList();
} else {
direction = tpNodeTps;
List<String> lcps = getOrderedTps(xpdr,resLcps);
if (lcps.size() == 2) {
in = new TerminationPointBuilder()
- .setTpNodeId(nodeid)
- .setTpId(lcps.get(0));
+ .setTerminationPointIdentifier(new TerminationPointIdentifierBuilder()
+ .setNodeId(nodeid)
+ .setTpId(lcps.get(0))
+ .build());
out = new TerminationPointBuilder()
- .setTpNodeId(nodeid)
- .setTpId(lcps.get(1));
+ .setTerminationPointIdentifier(new TerminationPointIdentifierBuilder()
+ .setNodeId(nodeid)
+ .setTpId(lcps.get(1))
+ .build());
} else {
LOG.info("lcps size not equal to 2");
}
Node node = new NodeBuilder()
- .setNodeId(nodeid)
+ .setNodeIdentifier(new NodeIdentifierBuilder()
+ .setNodeId(nodeid)
+ .build())
.build();
TpNodeTp tmp = new TpNodeTp(in.build(), out.build(), node);
tpNodeTps.add(tmp);
private void buildSRGTopo(String nodeid, List<String> resLinks,List<LogicalConnectionPoint> resLcps) {
/** build TpNodetp .*/
Node node = new NodeBuilder()
- .setNodeId(nodeid)
+ .setNodeIdentifier(new NodeIdentifierBuilder()
+ .setNodeId(nodeid)
+ .build())
.build();
TerminationPoint out = new TerminationPointBuilder()
- .setTpNodeId(nodeid)
- .setTpId("SRG1-CP-TXRX")
+ .setTerminationPointIdentifier(new TerminationPointIdentifierBuilder()
+ .setNodeId(nodeid)
+ .setTpId("SRG1-CP-TXRX")
+ .build())
.build();
-
for (LogicalConnectionPoint lcp : resLcps) {
if (lcp.getTpId().compareTo("SRG1-CP-TXRX") != 0) {
TerminationPoint in = new TerminationPointBuilder()
- .setTpNodeId(nodeid)
- .setTpId(lcp.getTpId())
+ .setTerminationPointIdentifier(new TerminationPointIdentifierBuilder()
+ .setNodeId(nodeid)
+ .setTpId(lcp.getTpId())
+ .build())
.build();
tpNodeTps.add(new TpNodeTp(in, out, node));
}
import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.ResourceBuilder;
import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.resource.resource.Link;
import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.resource.resource.LinkBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.resource.resource.link.LinkIdentifierBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
if (resLink != null) {
if (resLink instanceof Link) {
Link link = (Link) resLink;
- String newLinkId = reverseLinkId(link.getLinkId());
+ String newLinkId = reverseLinkId(link.getLinkIdentifier().getLinkId());
if (newLinkId != null) {
- resource = new ResourceBuilder().setResource(
- new LinkBuilder()
- .setLinkId(newLinkId)
- .build()
- ).build();
+ resource = new ResourceBuilder().setResource(new LinkBuilder()
+ .setLinkIdentifier(new LinkIdentifierBuilder()
+ .setLinkId(newLinkId)
+ .build())
+ .build())
+ .build();
}
} else {