Class MultiTableMapCache

  • All Implemented Interfaces:
    IMapCache

    public class MultiTableMapCache
    extends java.lang.Object
    implements IMapCache
    Multi table map-cache that works with 'simple' and SourceDest LCAF addresses (see lisp-proto.yang). It can do longest prefix matching for IP and SourceDest LCAF addresses. In case of the latter, it uses two tables, one for dst and another for source, queried and populated in this exact order.
    Author:
    Florin Coras
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addData​(Eid eid, java.lang.String subKey, java.lang.Object data)
      Add data for key.
      void addMapping​(Eid key, java.lang.Object value)
      Add mapping.
      java.lang.Object getData​(Eid eid, java.lang.String subKey)
      Generic retrieval of data.
      java.lang.Object getMapping​(Eid srcEid, Eid dstEid)
      Retrieves mapping for the provided srcKey and dstKey.
      java.util.Set<Eid> getSubtree​(Eid key)
      Retrieves the subtree of a prefix.
      Eid getWidestNegativeMapping​(Eid key)
      Retrieves widest negative prefix.
      java.lang.String prettyPrintMappings()
      Print mappings in cache in a human friendly format.
      java.lang.String printMappings()
      Print mappings in cache.
      void removeData​(Eid eid, java.lang.String subKey)
      Generic removal of data.
      void removeMapping​(Eid eid)
      Remove mapping.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MultiTableMapCache

        public MultiTableMapCache​(ILispDAO dao)
    • Method Detail

      • addMapping

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

        public java.lang.Object getMapping​(Eid srcEid,
                                           Eid dstEid)
        Description copied from interface: IMapCache
        Retrieves mapping for the provided srcKey and dstKey.
        Specified by:
        getMapping in interface IMapCache
        Parameters:
        srcEid - Source Key to be looked up
        dstEid - 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 java.util.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,
                            java.lang.String subKey,
                            java.lang.Object data)
        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
        data - The data to be stored
      • getData

        public java.lang.Object getData​(Eid eid,
                                        java.lang.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,
                               java.lang.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 java.lang.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 java.lang.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