Had to change the key to a map from a yang generated class to the object's ID. 26/19826/2
authorSteven Pisarski <s.pisarski@cablelabs.com>
Thu, 7 May 2015 16:26:46 +0000 (10:26 -0600)
committerThomas Kee <xsited@yahoo.com>
Fri, 8 May 2015 19:52:03 +0000 (12:52 -0700)
This issue may be due to some unintended changes to the code responsible for generating the data model that seem to surround the generated hashCode() method.

Change-Id: Ibeb2c05b6513c8b58a2f193547b537bc9fea898f
Signed-off-by: Steven Pisarski <s.pisarski@cablelabs.com>
packetcable-policy-server/src/main/java/org/opendaylight/controller/packetcable/provider/PacketcableProvider.java

index 2350e7502ebe4a3802a2d405654355ef0cf6a15f..26705d44ab77db41c4842b694602b87cec83857c 100644 (file)
@@ -70,7 +70,7 @@ public class PacketcableProvider implements DataChangeListener, AutoCloseable {
     /**
      * Holds a PCMMService object for each CCAP being managed.
      */
-    private final Map<Ccaps, PCMMService> pcmmServiceMap = new ConcurrentHashMap<>();
+    private final Map<String, PCMMService> pcmmServiceMap = new ConcurrentHashMap<>();
 
     /**
      * Constructor
@@ -171,7 +171,7 @@ public class PacketcableProvider implements DataChangeListener, AutoCloseable {
             }
         }
 
-        final PCMMService service = pcmmServiceMap.remove(ccap);
+        final PCMMService service = pcmmServiceMap.remove(ccap.getCcapId());
         if (service != null) service.disconect();
     }
 
@@ -345,14 +345,14 @@ public class PacketcableProvider implements DataChangeListener, AutoCloseable {
                 // get the CCAP node identity from the Instance Data
                 final String ccapId = thisCcap.getCcapId();
 
-                if (pcmmServiceMap.get(thisCcap) == null) {
+                if (pcmmServiceMap.get(thisCcap.getCcapId()) == null) {
                     final PCMMService pcmmService = new PCMMService(IPCMMClient.CLIENT_TYPE, thisCcap);
                     // TODO - may want to use the AMID but for the client type but probably not???
 /*
                             final PCMMService pcmmService = new PCMMService(
                                     thisCcap.getAmId().getAmType().shortValue(), thisCcap);
 */
-                    pcmmServiceMap.put(thisCcap, pcmmService);
+                    pcmmServiceMap.put(thisCcap.getCcapId(), pcmmService);
                     message = pcmmService.addCcap();
                     if (message.contains("200 OK")) {
                         ccapMap.put(ccapId, thisCcap);
@@ -387,8 +387,8 @@ public class PacketcableProvider implements DataChangeListener, AutoCloseable {
                         if (scn != null) {
                             final ServiceFlowDirection scnDir = findScnOnCcap(scn, thisCcap);
                             if (scnDir != null) {
-                                if (pcmmServiceMap.get(thisCcap) != null) {
-                                    message = pcmmServiceMap.get(thisCcap).sendGateSet(gatePathStr, subId, gate, scnDir);
+                                if (pcmmServiceMap.get(thisCcap.getCcapId()) != null) {
+                                    message = pcmmServiceMap.get(thisCcap.getCcapId()).sendGateSet(gatePathStr, subId, gate, scnDir);
                                     if (message.contains("200 OK")) {
                                         gateMap.put(gatePathStr, gate);
                                         gateCcapMap.put(gatePathStr, thisCcap.getCcapId());
@@ -445,7 +445,7 @@ public class PacketcableProvider implements DataChangeListener, AutoCloseable {
                 final String gateId = thisGate.getGateId();
                 final String ccapId = gateCcapMap.remove(gatePathStr);
                 final Ccaps thisCcap = ccapMap.get(ccapId);
-                final PCMMService service = pcmmServiceMap.get(thisCcap);
+                final PCMMService service = pcmmServiceMap.get(thisCcap.getCcapId());
                 if (service != null) {
                     service.sendGateDelete(gatePathStr);
                     logger.info("onDataChanged(): removed QoS gate {} for {}/{}/{}: ", gateId, ccapId, gatePathStr, thisGate);