Class HashMapDb
java.lang.Object
org.opendaylight.lispflowmapping.inmemorydb.HashMapDb
- All Implemented Interfaces:
AutoCloseable
,ILispDAO
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Get the entries from the DAO.void
getAll
(IRowVisitor visitor) Enumerate all the entries from the DAO.Get value for longest prefix match from the DAO.getBestPair
(Object key) Get longest prefix match and value from the DAO.Look up the covering prefix for the argument, but exclude the argument itself, so the result is always less specific than the lookup key.getParentPrefix
(Eid key) Get parent prefix.getSiblingPrefix
(Eid key) Get sibling prefix.getSpecific
(Object key, String valueKey) Get a specific value from the DAO.getSubtree
(Eid key) Get the subtree of the given prefix.Get virtual parent sibling prefix.Get widest negative prefix.boolean
isEmpty()
Check if the DAO is empty.void
put
(Object key, MappingEntry<?>... values) Put a entry into the DAO.putNestedTable
(Object key, String valueKey) Inserts a new, nested table for given key and subkey.Insert a new table for given key.void
Remove an entry from the DAO.void
Clear the DAO and remove all of the entries.void
removeSpecific
(Object key, String valueKey) Remove an entry from the DAO.void
tryAddToIpTrie
(Object key)
-
Field Details
-
LOG
protected static final org.slf4j.Logger LOG
-
-
Constructor Details
-
HashMapDb
@Inject public HashMapDb()
-
-
Method Details
-
close
@PreDestroy public void close()- Specified by:
close
in interfaceAutoCloseable
-
tryAddToIpTrie
-
put
Description copied from interface:ILispDAO
Put a entry into the DAO. -
getSpecific
Description copied from interface:ILispDAO
Get a specific value from the DAO.- Specified by:
getSpecific
in interfaceILispDAO
- Parameters:
key
- The key of the value to fetchvalueKey
- The value to fetch- Returns:
- The value from the DAO.
-
get
Description copied from interface:ILispDAO
Get the entries from the DAO. -
getBest
Description copied from interface:ILispDAO
Get value for longest prefix match from the DAO. -
getBestPair
Description copied from interface:ILispDAO
Get longest prefix match and value from the DAO.- Specified by:
getBestPair
in 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
Description copied from interface:ILispDAO
Enumerate all the entries from the DAO. -
getCoveringLessSpecific
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 interfaceILispDAO
- Parameters:
key
- The eid prefix, IPv4 or IPv6, to be looked up. Key must be normalized.- Returns:
- The covering prefix.
-
getParentPrefix
Description copied from interface:ILispDAO
Get parent prefix.- Specified by:
getParentPrefix
in 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
Description copied from interface:ILispDAO
Get sibling prefix.- Specified by:
getSiblingPrefix
in 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
Description copied from interface:ILispDAO
Get virtual parent sibling prefix.- Specified by:
getVirtualParentSiblingPrefix
in 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
Description copied from interface:ILispDAO
Get widest negative prefix.- Specified by:
getWidestNegativePrefix
in interfaceILispDAO
- Parameters:
key
- The eid prefix, IPv4 or IPv6, to be looked up. Key must be normalized.- Returns:
- The widest negative prefix found.
-
getSubtree
Description copied from interface:ILispDAO
Get the subtree of the given prefix.- Specified by:
getSubtree
in 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
Description copied from interface:ILispDAO
Remove an entry from the DAO. -
removeSpecific
Description copied from interface:ILispDAO
Remove an entry from the DAO.- Specified by:
removeSpecific
in interfaceILispDAO
- Parameters:
key
- The key of the entryvalueKey
- The value to delete
-
removeAll
public void removeAll()Description copied from interface:ILispDAO
Clear the DAO and remove all of the entries. -
putNestedTable
Description copied from interface:ILispDAO
Inserts a new, nested table for given key and subkey. Also acts as factory method.- Specified by:
putNestedTable
in 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
Description copied from interface:ILispDAO
Insert a new table for given key. -
isEmpty
public boolean isEmpty()Description copied from interface:ILispDAO
Check if the DAO is empty.
-