public class HashMapDb extends Object implements ILispDAO, AutoCloseable
Modifier and Type | Field and Description |
---|---|
protected static org.slf4j.Logger |
LOG |
Constructor and Description |
---|
HashMapDb() |
Modifier and Type | Method and Description |
---|---|
void |
close() |
Map<String,Object> |
get(Object key)
Get the entries from the DAO.
|
void |
getAll(IRowVisitor visitor)
Enumerate all the entries from the DAO.
|
Map<String,Object> |
getBest(Object key)
Get value for longest prefix match from the DAO.
|
AbstractMap.SimpleImmutableEntry<Eid,Map<String,?>> |
getBestPair(Object key)
Get longest prefix match and value from the DAO.
|
Eid |
getCoveringLessSpecific(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.
|
Eid |
getParentPrefix(Eid key)
Get parent prefix.
|
Eid |
getSiblingPrefix(Eid key)
Get sibling prefix.
|
Object |
getSpecific(Object key,
String valueKey)
Get a specific value from the DAO.
|
Set<Eid> |
getSubtree(Eid key)
Get the subtree of the given prefix.
|
Eid |
getVirtualParentSiblingPrefix(Eid key)
Get virtual parent sibling prefix.
|
Eid |
getWidestNegativePrefix(Eid key)
Get widest negative prefix.
|
boolean |
isEmpty()
Check if the DAO is empty.
|
void |
put(Object key,
MappingEntry<?>... values)
Put a entry into the DAO.
|
ILispDAO |
putNestedTable(Object key,
String valueKey)
Inserts a new, nested table for given key and subkey.
|
ILispDAO |
putTable(String key)
Insert a new table for given key.
|
void |
remove(Object key)
Remove an entry from the DAO.
|
void |
removeAll()
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) |
public void tryAddToIpTrie(Object key)
public void put(Object key, MappingEntry<?>... values)
ILispDAO
public Object getSpecific(Object key, String valueKey)
ILispDAO
getSpecific
in interface ILispDAO
key
- The key of the value to fetchvalueKey
- The value to fetchpublic Map<String,Object> get(Object key)
ILispDAO
public Map<String,Object> getBest(Object key)
ILispDAO
public AbstractMap.SimpleImmutableEntry<Eid,Map<String,?>> getBestPair(Object key)
ILispDAO
getBestPair
in interface ILispDAO
key
- The eid prefix, IPv4 or IPv6, to be looked up. Key must be normalizedpublic void getAll(IRowVisitor visitor)
ILispDAO
public Eid getCoveringLessSpecific(Eid key)
ILispDAO
getCoveringLessSpecific
in interface ILispDAO
key
- The eid prefix, IPv4 or IPv6, to be looked up. Key must be normalized.public Eid getParentPrefix(Eid key)
ILispDAO
getParentPrefix
in interface ILispDAO
key
- The eid prefix, IPv4 or IPv6, to be looked up. Key must be normalized.public Eid getSiblingPrefix(Eid key)
ILispDAO
getSiblingPrefix
in interface ILispDAO
key
- The eid prefix, IPv4 or IPv6, to be looked up. Key must be normalized.public Eid getVirtualParentSiblingPrefix(Eid key)
ILispDAO
getVirtualParentSiblingPrefix
in interface ILispDAO
key
- The eid prefix, IPv4 or IPv6, to be looked up. Key must be normalized.public Eid getWidestNegativePrefix(Eid key)
ILispDAO
getWidestNegativePrefix
in interface ILispDAO
key
- The eid prefix, IPv4 or IPv6, to be looked up. Key must be normalized.public Set<Eid> getSubtree(Eid key)
ILispDAO
getSubtree
in interface ILispDAO
key
- The eid prefix, IPv4 or IPv6, to be looked up. Key must be normalized.public void remove(Object key)
ILispDAO
public void removeSpecific(Object key, String valueKey)
ILispDAO
removeSpecific
in interface ILispDAO
key
- The key of the entryvalueKey
- The value to deletepublic void removeAll()
ILispDAO
public void close() throws Exception
close
in interface AutoCloseable
Exception
public ILispDAO putNestedTable(Object key, String valueKey)
ILispDAO
putNestedTable
in interface ILispDAO
key
- The key for which a new table is linked invalueKey
- The subkey under which to insert the new tablepublic ILispDAO putTable(String key)
ILispDAO
Copyright © 2019 OpenDaylight. All rights reserved.