Class FlatMapCache

java.lang.Object
org.opendaylight.lispflowmapping.mapcache.FlatMapCache
All Implemented Interfaces:
IMapCache

public class FlatMapCache extends Object implements IMapCache
Flat key implementation of a map-cache. As the name suggests, no longest prefix matching is done for IP addresses or their derivatives.
Author:
Florin Coras
  • Constructor Details

    • FlatMapCache

      public FlatMapCache(ILispDAO dao)
  • Method Details

    • addMapping

      public void addMapping(Eid eid, Object value)
      Description copied from interface: IMapCache
      Add mapping.
      Specified by:
      addMapping in interface IMapCache
      Parameters:
      eid - Key of the mapping
      value - Value to be stored
    • getMapping

      public Object getMapping(Eid srcKey, Eid dstKey)
      Description copied from interface: IMapCache
      Retrieves mapping for the provided srcKey and dstKey.
      Specified by:
      getMapping in interface IMapCache
      Parameters:
      srcKey - Source Key to be looked up
      dstKey - Destination Key to be looked up
      Returns:
      Returns the object found in the cache or null if nothing is found.
    • getWidestNegativeMapping

      public Eid getWidestNegativeMapping(Eid key)
      Description copied from interface: IMapCache
      Retrieves widest negative prefix.
      Specified by:
      getWidestNegativeMapping in interface IMapCache
      Parameters:
      key - Source Key to be looked up
      Returns:
      Returns the widest negative prefix or null if nothing is found.
    • getSubtree

      public Set<Eid> getSubtree(Eid key)
      Description copied from interface: IMapCache
      Retrieves the subtree of a prefix.
      Specified by:
      getSubtree in interface IMapCache
      Parameters:
      key - Key to be looked up
      Returns:
      The set of prefixes in the subtree for the prefix
    • removeMapping

      public void removeMapping(Eid eid)
      Description copied from interface: IMapCache
      Remove mapping.
      Specified by:
      removeMapping in interface IMapCache
      Parameters:
      eid - Key to be removed
    • addData

      public void addData(Eid eid, String subKey, Object value)
      Description copied from interface: IMapCache
      Add data for key.
      Specified by:
      addData in interface IMapCache
      Parameters:
      eid - The key for which data is inserted
      subKey - The subKey where data should be inserted
      value - The data to be stored
    • getData

      public Object getData(Eid eid, String subKey)
      Description copied from interface: IMapCache
      Generic retrieval of data.
      Specified by:
      getData in interface IMapCache
      Parameters:
      eid - The key where the data is stored
      subKey - The subKey where data is stored
      Returns:
      The data
    • removeData

      public void removeData(Eid eid, String subKey)
      Description copied from interface: IMapCache
      Generic removal of data.
      Specified by:
      removeData in interface IMapCache
      Parameters:
      eid - The key of the data to be removed
      subKey - The subKey of the data to be removed
    • printMappings

      public String printMappings()
      Description copied from interface: IMapCache
      Print mappings in cache. Used for testing, debugging and the karaf shell.
      Specified by:
      printMappings in interface IMapCache
      Returns:
      a String consisting of all the mappings in the cache
    • prettyPrintMappings

      public String prettyPrintMappings()
      Description copied from interface: IMapCache
      Print mappings in cache in a human friendly format.
      Specified by:
      prettyPrintMappings in interface IMapCache
      Returns:
      a String consisting of all the mappings in the cache