Checkstyle fixes re. hidden fields 47/42347/3
authorMichael Vorburger <vorburger@redhat.com>
Fri, 22 Jul 2016 22:27:09 +0000 (00:27 +0200)
committerLori Jakab <lorand.jakab@gmail.com>
Tue, 26 Jul 2016 12:03:37 +0000 (12:03 +0000)
To be enforced / preparing for
https://git.opendaylight.org/gerrit/#/c/41305/

Change-Id: I7ad255aa06f29a599fd13e9ebb9d080f56444443
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
mappingservice/mapcache/src/main/java/org/opendaylight/lispflowmapping/mapcache/MultiTableMapCache.java

index 5aa2808187898c445a62831a97203c1ae55d70dc..1dfbf8e03bfed9716ee9fe4aca436fe5ecd82259 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.lispflowmapping.mapcache;
 
 import java.util.Date;
@@ -29,10 +28,10 @@ import org.slf4j.LoggerFactory;
  * another for source, queried and populated in this exact order.
  *
  * @author Florin Coras
- *
  */
 public class MultiTableMapCache implements IMapCache {
     private static final Logger LOG = LoggerFactory.getLogger(MultiTableMapCache.class);
+
     private ILispDAO dao;
 
     public MultiTableMapCache(ILispDAO dao) {
@@ -78,8 +77,8 @@ public class MultiTableMapCache implements IMapCache {
         }
     }
 
-    private Object getMappingExactSD(Eid srcEid, Eid dstEid, ILispDAO dao) {
-        Map<String, ?> daoEntry = dao.get(dstEid);
+    private Object getMappingExactSD(Eid srcEid, Eid dstEid, ILispDAO mappingsDb) {
+        Map<String, ?> daoEntry = mappingsDb.get(dstEid);
         if (daoEntry != null) {
             // try SrcDst eid lookup
             ILispDAO srcDstDao = (ILispDAO) daoEntry.get(SubKeys.LCAF_SRCDST);
@@ -94,11 +93,11 @@ public class MultiTableMapCache implements IMapCache {
 
     // Returns the mapping corresponding to the longest prefix match for eid.
     // eid must be a simple (maskable or not) address
-    private Object getMappingLpmEid(Eid eid, ILispDAO dao) {
+    private Object getMappingLpmEid(Eid eid, ILispDAO mappingsDb) {
         if (eid == null) {
             return null;
         }
-        Map<String, ?> daoEntry = dao.getBest(MaskUtil.normalize(eid));
+        Map<String, ?> daoEntry = mappingsDb.getBest(MaskUtil.normalize(eid));
         if (daoEntry != null) {
             return daoEntry.get(SubKeys.RECORD);
         } else {
@@ -108,8 +107,8 @@ public class MultiTableMapCache implements IMapCache {
 
     // Returns a mapping corresponding to either the longest prefix match for both dstEid and srcEid,
     // if a SourceDest mapping exists, or to dstEid
-    private Object getMappingLpmSD(Eid srcEid, Eid dstEid, ILispDAO dao) {
-        Map<String, ?> daoEntry = dao.getBest(MaskUtil.normalize(dstEid));
+    private Object getMappingLpmSD(Eid srcEid, Eid dstEid, ILispDAO mappingsDb) {
+        Map<String, ?> daoEntry = mappingsDb.getBest(MaskUtil.normalize(dstEid));
         if (daoEntry != null) {
             // try SrcDst eid lookup
             ILispDAO srcDstDao = (ILispDAO) daoEntry.get(SubKeys.LCAF_SRCDST);
@@ -243,20 +242,20 @@ public class MultiTableMapCache implements IMapCache {
 
     // SrcDst LCAFs are stored in a 2-tier DAO with dst having priority over src.
     // This method returns the DAO associated to a dst or creates it if it doesn't exist.
-    private ILispDAO getOrInstantiateSDInnerDao(Eid address, ILispDAO dao) {
+    private ILispDAO getOrInstantiateSDInnerDao(Eid address, ILispDAO mappingsDb) {
         Eid dstKey = SourceDestKeyHelper.getDstBinary(address);
-        ILispDAO srcDstDao = (ILispDAO) dao.getSpecific(dstKey, SubKeys.LCAF_SRCDST);
+        ILispDAO srcDstDao = (ILispDAO) mappingsDb.getSpecific(dstKey, SubKeys.LCAF_SRCDST);
         if (srcDstDao == null) {
             // inserts nested table for source
-            srcDstDao = dao.putNestedTable(dstKey, SubKeys.LCAF_SRCDST);
+            srcDstDao = mappingsDb.putNestedTable(dstKey, SubKeys.LCAF_SRCDST);
         }
         return srcDstDao;
     }
 
     // SrcDst LCAFs are stored in a 2-tier DAO with dst having priority over src.
     // This method returns the DAO associated to dst or null if it doesn't exist.
-    private ILispDAO getSDInnerDao(Eid address, ILispDAO dao) {
-        return (ILispDAO) dao.getSpecific(SourceDestKeyHelper.getDstBinary(address), SubKeys.LCAF_SRCDST);
+    private ILispDAO getSDInnerDao(Eid address, ILispDAO mappingsDb) {
+        return (ILispDAO) mappingsDb.getSpecific(SourceDestKeyHelper.getDstBinary(address), SubKeys.LCAF_SRCDST);
     }
 
     public String printMappings() {
@@ -326,9 +325,9 @@ public class MultiTableMapCache implements IMapCache {
 
         if (key.getAddress() instanceof SourceDestKey) {
             ILispDAO srcDstDao = getOrInstantiateSDInnerDao(key, table);
-            srcDstDao.put(SourceDestKeyHelper.getSrcBinary(key), new MappingEntry<Object>(subKey, data));
+            srcDstDao.put(SourceDestKeyHelper.getSrcBinary(key), new MappingEntry<>(subKey, data));
         } else {
-            table.put(key, new MappingEntry<Object>(subKey, data));
+            table.put(key, new MappingEntry<>(subKey, data));
         }
     }