Class FlatMapCache
- java.lang.Object
-
- org.opendaylight.lispflowmapping.mapcache.FlatMapCache
-
-
Constructor Summary
Constructors Constructor Description FlatMapCache(ILispDAO dao)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddData(Eid eid, java.lang.String subKey, java.lang.Object value)Add data for key.voidaddMapping(Eid eid, java.lang.Object value)Add mapping.java.lang.ObjectgetData(Eid eid, java.lang.String subKey)Generic retrieval of data.java.lang.ObjectgetMapping(Eid srcKey, Eid dstKey)Retrieves mapping for the provided srcKey and dstKey.java.util.Set<Eid>getSubtree(Eid key)Retrieves the subtree of a prefix.EidgetWidestNegativeMapping(Eid key)Retrieves widest negative prefix.java.lang.StringprettyPrintMappings()Print mappings in cache in a human friendly format.java.lang.StringprintMappings()Print mappings in cache.voidremoveData(Eid eid, java.lang.String subKey)Generic removal of data.voidremoveMapping(Eid eid)Remove mapping.
-
-
-
Constructor Detail
-
FlatMapCache
public FlatMapCache(ILispDAO dao)
-
-
Method Detail
-
addMapping
public void addMapping(Eid eid, java.lang.Object value)
Description copied from interface:IMapCacheAdd mapping.- Specified by:
addMappingin interfaceIMapCache- Parameters:
eid- Key of the mappingvalue- Value to be stored
-
getMapping
public java.lang.Object getMapping(Eid srcKey, Eid dstKey)
Description copied from interface:IMapCacheRetrieves mapping for the provided srcKey and dstKey.- Specified by:
getMappingin 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
public Eid getWidestNegativeMapping(Eid key)
Description copied from interface:IMapCacheRetrieves widest negative prefix.- Specified by:
getWidestNegativeMappingin interfaceIMapCache- Parameters:
key- Source Key to be looked up- Returns:
- Returns the widest negative prefix or null if nothing is found.
-
getSubtree
public java.util.Set<Eid> getSubtree(Eid key)
Description copied from interface:IMapCacheRetrieves the subtree of a prefix.- Specified by:
getSubtreein interfaceIMapCache- Parameters:
key- Key to be looked up- Returns:
- The set of prefixes in the subtree for the prefix
-
removeMapping
public void removeMapping(Eid eid)
Description copied from interface:IMapCacheRemove mapping.- Specified by:
removeMappingin interfaceIMapCache- Parameters:
eid- Key to be removed
-
addData
public void addData(Eid eid, java.lang.String subKey, java.lang.Object value)
Description copied from interface:IMapCacheAdd data for key.
-
getData
public java.lang.Object getData(Eid eid, java.lang.String subKey)
Description copied from interface:IMapCacheGeneric retrieval of data.
-
removeData
public void removeData(Eid eid, java.lang.String subKey)
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
public java.lang.String 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
public java.lang.String 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
-
-