1. fix javadoc mistakes
2. add path state proverty to tunnel
3. fix bugs in tunnel creation and query commands.
Change-Id: I69b992e47630effe45764c887864d59d3a1eb870
diff --git a/providers/pcep/tunnel/src/main/java/org/onosproject/provider/pcep/tunnel/impl/PcepTunnelProvider.java b/providers/pcep/tunnel/src/main/java/org/onosproject/provider/pcep/tunnel/impl/PcepTunnelProvider.java
index 766715f..4a7cbca 100644
--- a/providers/pcep/tunnel/src/main/java/org/onosproject/provider/pcep/tunnel/impl/PcepTunnelProvider.java
+++ b/providers/pcep/tunnel/src/main/java/org/onosproject/provider/pcep/tunnel/impl/PcepTunnelProvider.java
@@ -60,6 +60,7 @@
import org.onosproject.pcep.api.PcepHopNodeDescription;
import org.onosproject.pcep.api.PcepOperator.OperationType;
import org.onosproject.pcep.api.PcepTunnel;
+import org.onosproject.pcep.api.PcepTunnel.PathState;
import org.onosproject.pcep.api.PcepTunnel.PATHTYPE;
import org.onosproject.pcep.api.PcepTunnelListener;
import org.slf4j.Logger;
@@ -199,7 +200,7 @@
Tunnel tunnelOld = tunnelQueryById(tunnel.id());
checkNotNull(tunnelOld, "The tunnel id is not exsited.");
if (tunnelOld.type() != Tunnel.Type.VLAN) {
- error("Llegal tunnel type. Only support VLAN tunnel deletion.");
+ error("Illegal tunnel type. Only support VLAN tunnel deletion.");
return;
}
String pcepTunnelId = getPCEPTunnelKey(tunnel.id());
@@ -217,7 +218,7 @@
Tunnel tunnelOld = tunnelQueryById(tunnel.id());
if (tunnelOld.type() != Tunnel.Type.VLAN) {
- error("Llegal tunnel type. Only support VLAN tunnel update.");
+ error("Illegal tunnel type. Only support VLAN tunnel update.");
return;
}
long bandwidth = Long
@@ -256,7 +257,7 @@
// Creates a path that leads through the given devices.
private Path createPath(List<PcepHopNodeDescription> hopList,
- PATHTYPE pathtype) {
+ PATHTYPE pathtype, PathState pathState) {
if (hopList == null || hopList.size() == 0) {
return null;
}
@@ -270,6 +271,7 @@
int hopNum = hopList.size() - 2;
DefaultAnnotations extendAnnotations = DefaultAnnotations.builder()
.set("pathNum", String.valueOf(hopNum))
+ .set("pathState", String.valueOf(pathState))
.set("pathType", String.valueOf(pathtype)).build();
return new DefaultPath(id(), links, hopNum, extendAnnotations);
}
@@ -299,7 +301,8 @@
// add path after codes of tunnel's path merged
Path path = createPath(pcepTunnel.getHopList(),
- pcepTunnel.getPathType());
+ pcepTunnel.getPathType(),
+ pcepTunnel.getPathState());
OpticalTunnelEndPoint.Type endPointType = null;
switch (pcepTunnel.type()) {
@@ -347,11 +350,11 @@
// a VLAN tunnel always carry OCH tunnel, this annotation is the index
// of a OCH tunnel.
- if (pcepTunnel.underLayTunnelId() != 0) {
+ if (pcepTunnel.underlayTunnelId() != 0) {
DefaultAnnotations extendAnnotations = DefaultAnnotations
.builder()
.set("underLayTunnelIndex",
- String.valueOf(pcepTunnel.underLayTunnelId())).build();
+ String.valueOf(pcepTunnel.underlayTunnelId())).build();
annotations = DefaultAnnotations.merge(annotations,
extendAnnotations);