Bug fix: Do not create groups as a side effect when revoking routes
Also changing pendingGroups to a cache that will automatically purge failed groups
Improving log messagesin several places

Change-Id: I6843a66d58e623259c7fd20ffe64d56a46d963f0
diff --git a/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java b/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java
index 01a09e4..5b05187 100644
--- a/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java
+++ b/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java
@@ -705,21 +705,23 @@
     /**
      * Returns the next objective ID for the given portNumber, given the treatment.
      * There could be multiple different treatments to the same outport, which
-     * would result in different objectives. If the next object
-     * does not exist, a new one is created and its id is returned.
+     * would result in different objectives. If the next object does not exist,
+     * and should be created, a new one is created and its id is returned.
      *
      * @param deviceId Device ID
      * @param portNum port number on device for which NextObjective is queried
      * @param treatment the actions to apply on the packets (should include outport)
      * @param meta metadata passed into the creation of a Next Objective if necessary
+     * @param createIfMissing true if a next object should be created if not found
      * @return next objective ID or -1 if an error occurred during retrieval or creation
      */
     public int getPortNextObjectiveId(DeviceId deviceId, PortNumber portNum,
                                       TrafficTreatment treatment,
-                                      TrafficSelector meta) {
+                                      TrafficSelector meta,
+                                      boolean createIfMissing) {
         DefaultGroupHandler ghdlr = groupHandlerMap.get(deviceId);
         if (ghdlr != null) {
-            return ghdlr.getPortNextObjectiveId(portNum, treatment, meta);
+            return ghdlr.getPortNextObjectiveId(portNum, treatment, meta, createIfMissing);
         } else {
             log.warn("getPortNextObjectiveId query - groupHandler for device {}"
                     + " not found", deviceId);