Class FlatMapCache
java.lang.Object
org.opendaylight.lispflowmapping.mapcache.FlatMapCache
- All Implemented Interfaces:
IMapCache
Flat key implementation of a map-cache. As the name suggests, no longest prefix matching is done for IP addresses
or their derivatives.
- Author:
- Florin Coras
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add data for key.void
addMapping
(Eid eid, Object value) Add mapping.Generic retrieval of data.getMapping
(Eid srcKey, Eid dstKey) Retrieves mapping for the provided srcKey and dstKey.getSubtree
(Eid key) Retrieves the subtree of a prefix.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.
-
Constructor Details
-
FlatMapCache
-
-
Method Details
-
addMapping
Description copied from interface:IMapCache
Add mapping.- Specified by:
addMapping
in interfaceIMapCache
- Parameters:
eid
- Key of the mappingvalue
- Value to be stored
-
getMapping
Description copied from interface:IMapCache
Retrieves mapping for the provided srcKey and dstKey.- Specified by:
getMapping
in interfaceIMapCache
- Parameters:
srcKey
- Source Key to be looked updstKey
- Destination Key to be looked up- Returns:
- Returns the object found in the cache or null if nothing is found.
-
getWidestNegativeMapping
Description copied from interface:IMapCache
Retrieves widest negative prefix.- Specified by:
getWidestNegativeMapping
in interfaceIMapCache
- Parameters:
key
- Source Key to be looked up- Returns:
- Returns the widest negative prefix or null if nothing is found.
-
getSubtree
Description copied from interface:IMapCache
Retrieves the subtree of a prefix.- Specified by:
getSubtree
in interfaceIMapCache
- Parameters:
key
- 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
-
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
-