java.lang.Object
org.opendaylight.lispflowmapping.inmemorydb.HashMapDb
All Implemented Interfaces:
AutoCloseable, ILispDAO

public class HashMapDb extends Object implements ILispDAO, AutoCloseable
  • Field Details

    • LOG

      protected static final org.slf4j.Logger LOG
  • Constructor Details

    • HashMapDb

      public HashMapDb()
  • Method Details

    • tryAddToIpTrie

      public void tryAddToIpTrie(Object key)
    • put

      public void put(Object key, MappingEntry<?>... values)
      Description copied from interface: ILispDAO
      Put a entry into the DAO.
      Specified by:
      put in interface ILispDAO
      Parameters:
      key - The entry's key.
      values - The entry's value.
    • getSpecific

      public Object getSpecific(Object key, String valueKey)
      Description copied from interface: ILispDAO
      Get a specific value from the DAO.
      Specified by:
      getSpecific in interface ILispDAO
      Parameters:
      key - The key of the value to fetch
      valueKey - The value to fetch
      Returns:
      The value from the DAO.
    • get

      public Map<String,Object> get(Object key)
      Description copied from interface: ILispDAO
      Get the entries from the DAO.
      Specified by:
      get in interface ILispDAO
      Parameters:
      key - The key to be looked up as exact match.
      Returns:
      The value from the DAO.
    • getBest

      public Map<String,Object> getBest(Object key)
      Description copied from interface: ILispDAO
      Get value for longest prefix match from the DAO.
      Specified by:
      getBest in interface ILispDAO
      Parameters:
      key - The eid prefix, IPv4 or IPv6, to be looked up. Key must be normalized.
      Returns:
      The value from the DAO.
    • getBestPair

      public AbstractMap.SimpleImmutableEntry<Eid,Map<String,?>> getBestPair(Object key)
      Description copied from interface: ILispDAO
      Get longest prefix match and value from the DAO.
      Specified by:
      getBestPair in interface ILispDAO
      Parameters:
      key - The eid prefix, IPv4 or IPv6, to be looked up. Key must be normalized
      Returns:
      The best match and value pair from the DAO.
    • getAll

      public void getAll(IRowVisitor visitor)
      Description copied from interface: ILispDAO
      Enumerate all the entries from the DAO.
      Specified by:
      getAll in interface ILispDAO
      Parameters:
      visitor - The visitor object.
    • getCoveringLessSpecific

      public Eid getCoveringLessSpecific(Eid key)
      Description copied from interface: ILispDAO
      Look up the covering prefix for the argument, but exclude the argument itself, so the result is always less specific than the lookup key.
      Specified by:
      getCoveringLessSpecific in interface ILispDAO
      Parameters:
      key - The eid prefix, IPv4 or IPv6, to be looked up. Key must be normalized.
      Returns:
      The covering prefix.
    • getParentPrefix

      public Eid getParentPrefix(Eid key)
      Description copied from interface: ILispDAO
      Get parent prefix.
      Specified by:
      getParentPrefix in interface ILispDAO
      Parameters:
      key - The eid prefix, IPv4 or IPv6, to be looked up. Key must be normalized.
      Returns:
      The parent prefix of the longest prefix match for the key.
    • getSiblingPrefix

      public Eid getSiblingPrefix(Eid key)
      Description copied from interface: ILispDAO
      Get sibling prefix.
      Specified by:
      getSiblingPrefix in interface ILispDAO
      Parameters:
      key - The eid prefix, IPv4 or IPv6, to be looked up. Key must be normalized.
      Returns:
      The sibling prefix of the longest prefix match for the key.
    • getVirtualParentSiblingPrefix

      public Eid getVirtualParentSiblingPrefix(Eid key)
      Description copied from interface: ILispDAO
      Get virtual parent sibling prefix.
      Specified by:
      getVirtualParentSiblingPrefix in interface ILispDAO
      Parameters:
      key - The eid prefix, IPv4 or IPv6, to be looked up. Key must be normalized.
      Returns:
      The longest prefix match node's virtual parent's sibling or null if nothing is found.
    • getWidestNegativePrefix

      public Eid getWidestNegativePrefix(Eid key)
      Description copied from interface: ILispDAO
      Get widest negative prefix.
      Specified by:
      getWidestNegativePrefix in interface ILispDAO
      Parameters:
      key - The eid prefix, IPv4 or IPv6, to be looked up. Key must be normalized.
      Returns:
      The widest negative prefix found.
    • getSubtree

      public Set<Eid> getSubtree(Eid key)
      Description copied from interface: ILispDAO
      Get the subtree of the given prefix.
      Specified by:
      getSubtree in interface ILispDAO
      Parameters:
      key - The eid prefix, IPv4 or IPv6, to be looked up. Key must be normalized.
      Returns:
      The set of EIDs that part of the subtree of the given EID.
    • remove

      public void remove(Object key)
      Description copied from interface: ILispDAO
      Remove an entry from the DAO.
      Specified by:
      remove in interface ILispDAO
      Parameters:
      key - The key of the entry to delete
    • removeSpecific

      public void removeSpecific(Object key, String valueKey)
      Description copied from interface: ILispDAO
      Remove an entry from the DAO.
      Specified by:
      removeSpecific in interface ILispDAO
      Parameters:
      key - The key of the entry
      valueKey - The value to delete
    • removeAll

      public void removeAll()
      Description copied from interface: ILispDAO
      Clear the DAO and remove all of the entries.
      Specified by:
      removeAll in interface ILispDAO
    • close

      public void close() throws Exception
      Specified by:
      close in interface AutoCloseable
      Throws:
      Exception
    • putNestedTable

      public ILispDAO putNestedTable(Object key, String valueKey)
      Description copied from interface: ILispDAO
      Inserts a new, nested table for given key and subkey. Also acts as factory method.
      Specified by:
      putNestedTable in interface ILispDAO
      Parameters:
      key - The key for which a new table is linked in
      valueKey - The subkey under which to insert the new table
      Returns:
      The inserted table
    • putTable

      public ILispDAO putTable(String key)
      Description copied from interface: ILispDAO
      Insert a new table for given key.
      Specified by:
      putTable in interface ILispDAO
      Parameters:
      key - The key for the table
      Returns:
      The inserted table
    • isEmpty

      public boolean isEmpty()
      Description copied from interface: ILispDAO
      Check if the DAO is empty.
      Specified by:
      isEmpty in interface ILispDAO
      Returns:
      true if empty