Class SimpleMapCache
java.lang.Object
org.opendaylight.lispflowmapping.mapcache.SimpleMapCache
- All Implemented Interfaces:
ILispMapCache
,IMapCache
Simple map-cache that works with 'simple' addresses (see lisp-proto.yang). It can do longest prefix matching for IP
addresses.
- Author:
- Florin Coras, Lorand Jakab
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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.getAllXtrIdMappings
(Eid eid) Retrieve all xTR-ID sub-mappings for an 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.Generic retrieval of data.getMapping
(Eid srcEid, Eid dstEid) Retrieves mapping for the provided srcKey and dstKey.getMapping
(Eid eid, XtrId xtrId) Retrieves mapping for the provided srcKey, dstKey and a XtrId.getParentPrefix
(Eid eid) Returns the parent prefix for given key.getSiblingPrefix
(Eid eid) Returns the sibling prefix for given key.getSubtree
(Eid eid) Retrieves the subtree of a prefix.Returns the virtual parent sibling prefix for given key.Retrieves widest negative prefix.Print mappings in cache in a human friendly format.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.
-
Constructor Details
-
SimpleMapCache
-
-
Method Details
-
addMapping
Description copied from interface:IMapCache
Add mapping.- Specified by:
addMapping
in interfaceIMapCache
- Parameters:
key
- Key of the mappingvalue
- Value to be stored
-
addMapping
Description copied from interface:ILispMapCache
Add mapping.- Specified by:
addMapping
in interfaceILispMapCache
- Parameters:
key
- Key of the mappingvalue
- Mapping to be storedsourceRlocs
- The set of RLOCs from all registrations. Used for merging
-
addMapping
Description copied from interface:ILispMapCache
Add mapping.- Specified by:
addMapping
in interfaceILispMapCache
- Parameters:
key
- Key of the mappingxtrId
- xTR-ID of the mappingvalue
- Mapping to be stored
-
getMapping
Description copied from interface:IMapCache
Retrieves mapping for the provided srcKey and dstKey.- Specified by:
getMapping
in interfaceIMapCache
- Parameters:
srcEid
- Source Key to be looked updstEid
- Destination Key to be looked up- Returns:
- Returns the object found in the cache or null if nothing is found.
-
getMapping
Description copied from interface:ILispMapCache
Retrieves mapping for the provided srcKey, dstKey and a XtrId.- Specified by:
getMapping
in interfaceILispMapCache
- Parameters:
eid
- Key to be looked upxtrId
- xTR-ID for which look-up to be done- Returns:
- Returns the mapping found in the cache
-
getAllXtrIdMappings
Description copied from interface:ILispMapCache
Retrieve all xTR-ID sub-mappings for an EID. Used for merging logic.- Specified by:
getAllXtrIdMappings
in interfaceILispMapCache
- Parameters:
eid
- Key to be looked up- Returns:
- The list of Objects which should be mappings
-
getWidestNegativeMapping
Description copied from interface:IMapCache
Retrieves widest negative prefix.- Specified by:
getWidestNegativeMapping
in interfaceIMapCache
- Parameters:
eid
- Source Key to be looked up- Returns:
- Returns the widest negative prefix or null if nothing is found.
-
getCoveringLessSpecific
Description copied from interface:ILispMapCache
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 interfaceILispMapCache
- Parameters:
eid
- The eid prefix, IPv4 or IPv6, to be looked up. Key must be normalized.- Returns:
- The covering prefix.
-
getParentPrefix
Description copied from interface:ILispMapCache
Returns the parent prefix for given key.- Specified by:
getParentPrefix
in interfaceILispMapCache
- Parameters:
eid
- The key for which parent is to be returned.- Returns:
- The parent prefix of a specific key.
-
getSiblingPrefix
Description copied from interface:ILispMapCache
Returns the sibling prefix for given key.- Specified by:
getSiblingPrefix
in interfaceILispMapCache
- Parameters:
eid
- The key for which sibling is to be returned.- Returns:
- The sibling prefix of a specific key.
-
getVirtualParentSiblingPrefix
Description copied from interface:ILispMapCache
Returns the virtual parent sibling prefix for given key.- Specified by:
getVirtualParentSiblingPrefix
in interfaceILispMapCache
- Parameters:
eid
- The key for which virtual parent sibling is to be returned.- Returns:
- The virtual parent sibling prefix of a specific key.
-
getSubtree
Description copied from interface:IMapCache
Retrieves the subtree of a prefix.- Specified by:
getSubtree
in interfaceIMapCache
- Parameters:
eid
- Key to be looked up- Returns:
- The set of prefixes in the subtree for the prefix
-
removeMapping
Description copied from interface:IMapCache
Remove mapping.- Specified by:
removeMapping
in interfaceIMapCache
- Parameters:
eid
- Key to be removed
-
removeMapping
Description copied from interface:ILispMapCache
Remove mapping.- Specified by:
removeMapping
in interfaceILispMapCache
- Parameters:
eid
- Key to be removedxtrId
- xTR-ID of the mapping to be removed
-
removeXtrIdMappings
Description copied from interface:ILispMapCache
Batch remove several xTR-ID sub-mappings under a certain key.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.
- Specified by:
removeXtrIdMappings
in interfaceILispMapCache
- Parameters:
eid
- Key to be looked upxtrIds
- List of xTR-IDs that need to be removed
-
addData
Description copied from interface:IMapCache
Add data for key. -
getData
Description copied from interface:IMapCache
Generic retrieval of data. -
removeData
Description copied from interface:IMapCache
Generic removal of data.- Specified by:
removeData
in interfaceIMapCache
- Parameters:
eid
- The key of the data to be removedsubKey
- The subKey of the data to be removed
-
printMappings
Description copied from interface:IMapCache
Print mappings in cache. Used for testing, debugging and the karaf shell.- Specified by:
printMappings
in interfaceIMapCache
- Returns:
- a String consisting of all the mappings in the cache
-
prettyPrintMappings
Description copied from interface:IMapCache
Print mappings in cache in a human friendly format.- Specified by:
prettyPrintMappings
in interfaceIMapCache
- Returns:
- a String consisting of all the mappings in the cache
-