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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd data for key.voidaddMapping(Eid key, Object value) Add mapping.voidaddMapping(Eid key, Object value, Set<IpAddressBinary> sourceRlocs) Add mapping.voidaddMapping(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.voidremoveData(Eid eid, String subKey) Generic removal of data.voidremoveMapping(Eid eid) Remove mapping.voidremoveMapping(Eid eid, XtrId xtrId) Remove mapping.voidremoveXtrIdMappings(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:IMapCacheAdd mapping.- Specified by:
addMappingin interfaceIMapCache- Parameters:
key- Key of the mappingvalue- Value to be stored
-
addMapping
Description copied from interface:ILispMapCacheAdd mapping.- Specified by:
addMappingin 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:ILispMapCacheAdd mapping.- Specified by:
addMappingin interfaceILispMapCache- Parameters:
key- Key of the mappingxtrId- xTR-ID of the mappingvalue- Mapping to be stored
-
getMapping
Description copied from interface:IMapCacheRetrieves mapping for the provided srcKey and dstKey.- Specified by:
getMappingin 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:ILispMapCacheRetrieves mapping for the provided srcKey, dstKey and a XtrId.- Specified by:
getMappingin 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:ILispMapCacheRetrieve all xTR-ID sub-mappings for an EID. Used for merging logic.- Specified by:
getAllXtrIdMappingsin interfaceILispMapCache- Parameters:
eid- Key to be looked up- Returns:
- The list of Objects which should be mappings
-
getWidestNegativeMapping
Description copied from interface:IMapCacheRetrieves widest negative prefix.- Specified by:
getWidestNegativeMappingin 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:ILispMapCacheLook 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 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:ILispMapCacheReturns the parent prefix for given key.- Specified by:
getParentPrefixin 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:ILispMapCacheReturns the sibling prefix for given key.- Specified by:
getSiblingPrefixin 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:ILispMapCacheReturns the virtual parent sibling prefix for given key.- Specified by:
getVirtualParentSiblingPrefixin 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:IMapCacheRetrieves the subtree of a prefix.- Specified by:
getSubtreein interfaceIMapCache- Parameters:
eid- Key to be looked up- Returns:
- The set of prefixes in the subtree for the prefix
-
removeMapping
Description copied from interface:IMapCacheRemove mapping.- Specified by:
removeMappingin interfaceIMapCache- Parameters:
eid- Key to be removed
-
removeMapping
Description copied from interface:ILispMapCacheRemove mapping.- Specified by:
removeMappingin interfaceILispMapCache- Parameters:
eid- Key to be removedxtrId- xTR-ID of the mapping to be removed
-
removeXtrIdMappings
Description copied from interface:ILispMapCacheBatch 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:
removeXtrIdMappingsin interfaceILispMapCache- Parameters:
eid- Key to be looked upxtrIds- List of xTR-IDs that need to be removed
-
addData
Description copied from interface:IMapCacheAdd data for key. -
getData
Description copied from interface:IMapCacheGeneric retrieval of data. -
removeData
Description copied from interface:IMapCacheGeneric removal of data.- Specified by:
removeDatain interfaceIMapCache- Parameters:
eid- The key of the data to be removedsubKey- The subKey of the data to be removed
-
printMappings
Description copied from interface:IMapCachePrint mappings in cache. Used for testing, debugging and the karaf shell.- Specified by:
printMappingsin interfaceIMapCache- Returns:
- a String consisting of all the mappings in the cache
-
prettyPrintMappings
Description copied from interface:IMapCachePrint mappings in cache in a human friendly format.- Specified by:
prettyPrintMappingsin interfaceIMapCache- Returns:
- a String consisting of all the mappings in the cache
-