Class HashMapDb
- java.lang.Object
-
- org.opendaylight.lispflowmapping.inmemorydb.HashMapDb
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.slf4j.LoggerLOG
-
Constructor Summary
Constructors Constructor Description HashMapDb()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()java.util.Map<java.lang.String,java.lang.Object>get(java.lang.Object key)Get the entries from the DAO.voidgetAll(IRowVisitor visitor)Enumerate all the entries from the DAO.java.util.Map<java.lang.String,java.lang.Object>getBest(java.lang.Object key)Get value for longest prefix match from the DAO.java.util.AbstractMap.SimpleImmutableEntry<Eid,java.util.Map<java.lang.String,?>>getBestPair(java.lang.Object key)Get longest prefix match and value from the DAO.EidgetCoveringLessSpecific(Eid key)Look up the covering prefix for the argument, but exclude the argument itself, so the result is always less specific than the lookup key.EidgetParentPrefix(Eid key)Get parent prefix.EidgetSiblingPrefix(Eid key)Get sibling prefix.java.lang.ObjectgetSpecific(java.lang.Object key, java.lang.String valueKey)Get a specific value from the DAO.java.util.Set<Eid>getSubtree(Eid key)Get the subtree of the given prefix.EidgetVirtualParentSiblingPrefix(Eid key)Get virtual parent sibling prefix.EidgetWidestNegativePrefix(Eid key)Get widest negative prefix.booleanisEmpty()Check if the DAO is empty.voidput(java.lang.Object key, MappingEntry<?>... values)Put a entry into the DAO.ILispDAOputNestedTable(java.lang.Object key, java.lang.String valueKey)Inserts a new, nested table for given key and subkey.ILispDAOputTable(java.lang.String key)Insert a new table for given key.voidremove(java.lang.Object key)Remove an entry from the DAO.voidremoveAll()Clear the DAO and remove all of the entries.voidremoveSpecific(java.lang.Object key, java.lang.String valueKey)Remove an entry from the DAO.voidtryAddToIpTrie(java.lang.Object key)
-
-
-
Method Detail
-
tryAddToIpTrie
public void tryAddToIpTrie(java.lang.Object key)
-
put
public void put(java.lang.Object key, MappingEntry<?>... values)Description copied from interface:ILispDAOPut a entry into the DAO.
-
getSpecific
public java.lang.Object getSpecific(java.lang.Object key, java.lang.String valueKey)Description copied from interface:ILispDAOGet a specific value from the DAO.- Specified by:
getSpecificin interfaceILispDAO- Parameters:
key- The key of the value to fetchvalueKey- The value to fetch- Returns:
- The value from the DAO.
-
get
public java.util.Map<java.lang.String,java.lang.Object> get(java.lang.Object key)
Description copied from interface:ILispDAOGet the entries from the DAO.
-
getBest
public java.util.Map<java.lang.String,java.lang.Object> getBest(java.lang.Object key)
Description copied from interface:ILispDAOGet value for longest prefix match from the DAO.
-
getBestPair
public java.util.AbstractMap.SimpleImmutableEntry<Eid,java.util.Map<java.lang.String,?>> getBestPair(java.lang.Object key)
Description copied from interface:ILispDAOGet longest prefix match and value from the DAO.- Specified by:
getBestPairin interfaceILispDAO- 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:ILispDAOEnumerate all the entries from the DAO.
-
getCoveringLessSpecific
public Eid getCoveringLessSpecific(Eid key)
Description copied from interface:ILispDAOLook 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:
getCoveringLessSpecificin interfaceILispDAO- 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:ILispDAOGet parent prefix.- Specified by:
getParentPrefixin interfaceILispDAO- 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:ILispDAOGet sibling prefix.- Specified by:
getSiblingPrefixin interfaceILispDAO- 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:ILispDAOGet virtual parent sibling prefix.- Specified by:
getVirtualParentSiblingPrefixin interfaceILispDAO- 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:ILispDAOGet widest negative prefix.- Specified by:
getWidestNegativePrefixin interfaceILispDAO- Parameters:
key- The eid prefix, IPv4 or IPv6, to be looked up. Key must be normalized.- Returns:
- The widest negative prefix found.
-
getSubtree
public java.util.Set<Eid> getSubtree(Eid key)
Description copied from interface:ILispDAOGet the subtree of the given prefix.- Specified by:
getSubtreein interfaceILispDAO- 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(java.lang.Object key)
Description copied from interface:ILispDAORemove an entry from the DAO.
-
removeSpecific
public void removeSpecific(java.lang.Object key, java.lang.String valueKey)Description copied from interface:ILispDAORemove an entry from the DAO.- Specified by:
removeSpecificin interfaceILispDAO- Parameters:
key- The key of the entryvalueKey- The value to delete
-
removeAll
public void removeAll()
Description copied from interface:ILispDAOClear the DAO and remove all of the entries.
-
close
public void close() throws java.lang.Exception- Specified by:
closein interfacejava.lang.AutoCloseable- Throws:
java.lang.Exception
-
putNestedTable
public ILispDAO putNestedTable(java.lang.Object key, java.lang.String valueKey)
Description copied from interface:ILispDAOInserts a new, nested table for given key and subkey. Also acts as factory method.- Specified by:
putNestedTablein interfaceILispDAO- Parameters:
key- The key for which a new table is linked invalueKey- The subkey under which to insert the new table- Returns:
- The inserted table
-
putTable
public ILispDAO putTable(java.lang.String key)
Description copied from interface:ILispDAOInsert a new table for given key.
-
-