public class SimpleMapCache extends Object implements ILispMapCache
Constructor and Description |
---|
SimpleMapCache(ILispDAO dao) |
Modifier and Type | Method and Description |
---|---|
void |
addData(Eid eid,
String subKey,
Object data)
Add data for key.
|
void |
addMapping(Eid key,
Object value)
Add mapping.
|
void |
addMapping(Eid key,
Object value,
Set<IpAddressBinary> sourceRlocs)
Add mapping.
|
void |
addMapping(Eid key,
XtrId xtrId,
Object value)
Add mapping.
|
List<Object> |
getAllXtrIdMappings(Eid eid)
Retrieve all xTR-ID sub-mappings for an EID.
|
Eid |
getCoveringLessSpecific(Eid eid)
Look up the covering prefix for the argument, but exclude the argument itself, so the result is always less
specific than the lookup key.
|
Object |
getData(Eid eid,
String subKey)
Generic retrieval of data.
|
Object |
getMapping(Eid srcEid,
Eid dstEid)
Retrieves mapping for the provided srcKey and dstKey.
|
Object |
getMapping(Eid eid,
XtrId xtrId)
Retrieves mapping for the provided srcKey, dstKey and a XtrId.
|
Eid |
getParentPrefix(Eid eid)
Returns the parent prefix for given key.
|
Eid |
getSiblingPrefix(Eid eid)
Returns the sibling prefix for given key.
|
Set<Eid> |
getSubtree(Eid eid)
Retrieves the subtree of a prefix.
|
Eid |
getVirtualParentSiblingPrefix(Eid eid)
Returns the virtual parent sibling prefix for given key.
|
Eid |
getWidestNegativeMapping(Eid eid)
Retrieves widest negative prefix.
|
String |
prettyPrintMappings()
Print mappings in cache in a human friendly format.
|
String |
printMappings()
Print mappings in cache.
|
void |
removeData(Eid eid,
String subKey)
Generic removal of data.
|
void |
removeMapping(Eid eid)
Remove mapping.
|
void |
removeMapping(Eid eid,
XtrId xtrId)
Remove mapping.
|
void |
removeXtrIdMappings(Eid eid,
List<XtrId> xtrIds)
Batch remove several xTR-ID sub-mappings under a certain key.
|
public SimpleMapCache(ILispDAO dao)
public void addMapping(Eid key, Object value)
IMapCache
addMapping
in interface IMapCache
key
- Key of the mappingvalue
- Value to be storedpublic void addMapping(Eid key, Object value, Set<IpAddressBinary> sourceRlocs)
ILispMapCache
addMapping
in interface ILispMapCache
key
- Key of the mappingvalue
- Mapping to be storedsourceRlocs
- The set of RLOCs from all registrations. Used for mergingpublic void addMapping(Eid key, XtrId xtrId, Object value)
ILispMapCache
addMapping
in interface ILispMapCache
key
- Key of the mappingxtrId
- xTR-ID of the mappingvalue
- Mapping to be storedpublic Object getMapping(Eid srcEid, Eid dstEid)
IMapCache
getMapping
in interface IMapCache
srcEid
- Source Key to be looked updstEid
- Destination Key to be looked uppublic Object getMapping(Eid eid, XtrId xtrId)
ILispMapCache
getMapping
in interface ILispMapCache
eid
- Key to be looked upxtrId
- xTR-ID for which look-up to be donepublic List<Object> getAllXtrIdMappings(Eid eid)
ILispMapCache
getAllXtrIdMappings
in interface ILispMapCache
eid
- Key to be looked uppublic Eid getWidestNegativeMapping(Eid eid)
IMapCache
getWidestNegativeMapping
in interface IMapCache
eid
- Source Key to be looked uppublic Eid getCoveringLessSpecific(Eid eid)
ILispMapCache
getCoveringLessSpecific
in interface ILispMapCache
eid
- The eid prefix, IPv4 or IPv6, to be looked up. Key must be normalized.public Eid getParentPrefix(Eid eid)
ILispMapCache
getParentPrefix
in interface ILispMapCache
eid
- The key for which parent is to be returned.public Eid getSiblingPrefix(Eid eid)
ILispMapCache
getSiblingPrefix
in interface ILispMapCache
eid
- The key for which sibling is to be returned.public Eid getVirtualParentSiblingPrefix(Eid eid)
ILispMapCache
getVirtualParentSiblingPrefix
in interface ILispMapCache
eid
- The key for which virtual parent sibling is to be returned.public Set<Eid> getSubtree(Eid eid)
IMapCache
getSubtree
in interface IMapCache
eid
- Key to be looked uppublic void removeMapping(Eid eid)
IMapCache
removeMapping
in interface IMapCache
eid
- Key to be removedpublic void removeMapping(Eid eid, XtrId xtrId)
ILispMapCache
removeMapping
in interface ILispMapCache
eid
- Key to be removedxtrId
- xTR-ID of the mapping to be removedpublic void removeXtrIdMappings(Eid eid, List<XtrId> xtrIds)
ILispMapCache
This is a performance optimization, since interactive calls to removeMapping() would result in LPM lookups of the key for each call. With this method, only one such lookup is performed.
removeXtrIdMappings
in interface ILispMapCache
eid
- Key to be looked upxtrIds
- List of xTR-IDs that need to be removedpublic void addData(Eid eid, String subKey, Object data)
IMapCache
public Object getData(Eid eid, String subKey)
IMapCache
public void removeData(Eid eid, String subKey)
IMapCache
removeData
in interface IMapCache
eid
- The key of the data to be removedsubKey
- The subKey of the data to be removedpublic String printMappings()
IMapCache
printMappings
in interface IMapCache
public String prettyPrintMappings()
IMapCache
prettyPrintMappings
in interface IMapCache
Copyright © 2019 OpenDaylight. All rights reserved.