Fix a bug in the Json serialization of class ApplicationIntent:

Rename all foo() getter methods to getFoo() so the default Json
serialization will include those values.

Also, add extra "case REROUTE_REQ" inside DeleteIntentsTracker.intentsChange()
for consistency with the rest of the code.

Change-Id: I208a3885e3058814b49f885931fee0e8cc5ff9ab
diff --git a/src/main/java/net/onrc/onos/api/intent/ApplicationIntent.java b/src/main/java/net/onrc/onos/api/intent/ApplicationIntent.java
index 113e6cd..c5bcda8 100644
--- a/src/main/java/net/onrc/onos/api/intent/ApplicationIntent.java
+++ b/src/main/java/net/onrc/onos/api/intent/ApplicationIntent.java
@@ -25,7 +25,7 @@
      *
      * @return the Intent ID.
      */
-    public String intentId() {
+    public String getIntentId() {
         return this.intentId;
     }
 
@@ -47,7 +47,7 @@
      *
      * @return the Intent type.
      */
-    public String intentType() {
+    public String getIntentType() {
         return this.intentType;
     }
 
@@ -93,7 +93,7 @@
      *
      * @return the Source Switch DPID.
      */
-    public String srcSwitchDpid() {
+    public String getSrcSwitchDpid() {
         return this.srcSwitchDpid;
     }
 
@@ -111,7 +111,7 @@
      *
      * @return the Source Switch Port.
      */
-    public int srcSwitchPort() {
+    public int getSrcSwitchPort() {
         return this.srcSwitchPort;
     }
 
@@ -129,7 +129,7 @@
      *
      * @return the Destination Switch DPID.
      */
-    public String dstSwitchDpid() {
+    public String getDstSwitchDpid() {
         return this.dstSwitchDpid;
     }
 
@@ -147,7 +147,7 @@
      *
      * @return the Destination Switch Port.
      */
-    public int dstSwitchPort() {
+    public int getDstSwitchPort() {
         return this.dstSwitchPort;
     }
 
@@ -165,7 +165,7 @@
      *
      * @return the bandwidth for Constrained Shortest Path.
      */
-    public double bandwidth() {
+    public double getBandwidth() {
         return this.bandwidth;
     }
 
@@ -183,7 +183,7 @@
      *
      * @return the matching source MAC address.
      */
-    public String matchSrcMac() {
+    public String getMatchSrcMac() {
         return this.matchSrcMac;
     }
 
@@ -201,7 +201,7 @@
      *
      * @return the matching destination MAC address.
      */
-    public String matchDstMac() {
+    public String getMatchDstMac() {
         return this.matchDstMac;
     }
 
diff --git a/src/main/java/net/onrc/onos/core/intent/runtime/PathCalcRuntimeModule.java b/src/main/java/net/onrc/onos/core/intent/runtime/PathCalcRuntimeModule.java
index bfbaa30..f850c58 100644
--- a/src/main/java/net/onrc/onos/core/intent/runtime/PathCalcRuntimeModule.java
+++ b/src/main/java/net/onrc/onos/core/intent/runtime/PathCalcRuntimeModule.java
@@ -151,6 +151,8 @@
                             break;
                         case DEL_PENDING:
                             break;
+                        case REROUTE_REQ:
+                            break;
                         default:
                             break;
                     }
@@ -404,44 +406,44 @@
         //
         IntentOperationList intentOperations = new IntentOperationList();
         for (ApplicationIntent appIntent : appIntents) {
-            String appIntentId = appId + ":" + appIntent.intentId();
+            String appIntentId = appId + ":" + appIntent.getIntentId();
 
             IntentOperation.Operator operator = IntentOperation.Operator.ADD;
-            Dpid srcSwitchDpid = new Dpid(appIntent.srcSwitchDpid());
-            Dpid dstSwitchDpid = new Dpid(appIntent.dstSwitchDpid());
+            Dpid srcSwitchDpid = new Dpid(appIntent.getSrcSwitchDpid());
+            Dpid dstSwitchDpid = new Dpid(appIntent.getDstSwitchDpid());
 
-            if (appIntent.intentType().equals("SHORTEST_PATH")) {
+            if (appIntent.getIntentType().equals("SHORTEST_PATH")) {
                 //
                 // Process Shortest-Path Intent
                 //
                 ShortestPathIntent spi =
                     new ShortestPathIntent(appIntentId,
                                            srcSwitchDpid.value(),
-                                           appIntent.srcSwitchPort(),
-                                           MACAddress.valueOf(appIntent.matchSrcMac()).toLong(),
+                                           appIntent.getSrcSwitchPort(),
+                                           MACAddress.valueOf(appIntent.getMatchSrcMac()).toLong(),
                                            dstSwitchDpid.value(),
-                                           appIntent.dstSwitchPort(),
-                                           MACAddress.valueOf(appIntent.matchDstMac()).toLong());
+                                           appIntent.getDstSwitchPort(),
+                                           MACAddress.valueOf(appIntent.getMatchDstMac()).toLong());
                 spi.setPathFrozen(appIntent.isStaticPath());
                 intentOperations.add(operator, spi);
-            } else if (appIntent.intentType().equals("CONSTRAINED_SHORTEST_PATH")) {
+            } else if (appIntent.getIntentType().equals("CONSTRAINED_SHORTEST_PATH")) {
                 //
                 // Process Constrained Shortest-Path Intent
                 //
                 ConstrainedShortestPathIntent cspi =
                     new ConstrainedShortestPathIntent(appIntentId,
                                                       srcSwitchDpid.value(),
-                                                      appIntent.srcSwitchPort(),
-                                                      MACAddress.valueOf(appIntent.matchSrcMac()).toLong(),
+                                                      appIntent.getSrcSwitchPort(),
+                                                      MACAddress.valueOf(appIntent.getMatchSrcMac()).toLong(),
                                                       dstSwitchDpid.value(),
-                                                      appIntent.dstSwitchPort(),
-                                                      MACAddress.valueOf(appIntent.matchDstMac()).toLong(),
-                                                      appIntent.bandwidth());
+                                                      appIntent.getDstSwitchPort(),
+                                                      MACAddress.valueOf(appIntent.getMatchDstMac()).toLong(),
+                                                      appIntent.getBandwidth());
                 cspi.setPathFrozen(appIntent.isStaticPath());
                 intentOperations.add(operator, cspi);
             } else {
                 log.error("Unknown Application Intent Type: {}",
-                          appIntent.intentType());
+                          appIntent.getIntentType());
                 return false;
             }
             removedApplicationIntentIds.remove(appIntentId);