Class MappingSystem
java.lang.Object
org.opendaylight.lispflowmapping.implementation.MappingSystem
- All Implemented Interfaces:
IMappingSystem
The Mapping System coordinates caching of md-sal stored mappings and if so configured enables longest prefix match
mapping lookups.
- Author:
- Florin Coras, Lorand Jakab
-
Constructor Summary
ConstructorsConstructorDescriptionMappingSystem(ILispDAO dao, boolean iterateMask, org.opendaylight.mdsal.binding.api.NotificationPublishService nps, boolean mappingMerge) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAuthenticationKey(Eid key, MappingAuthkey authKey) Add authentication key.voidaddData(MappingOrigin origin, Eid key, String subKey, Object data) Add data for key.voidaddMapping(MappingOrigin origin, Eid key, MappingData mappingData) Add mapping.addNegativeMapping(Eid key) Generate and add a negative mapping entry originated from the southbound, and return the generated mapping.voidvoidvoiddestroy()getAuthenticationKey(Eid key) Retrieve authentication key.getData(MappingOrigin origin, Eid key, String subKey) Generic retrieval of data.getMapping(Eid dst) Retrieves mapping for the provided dst key.getMapping(Eid src, Eid dst) Retrieves mapping for the provided src and dst key.getMapping(Eid src, Eid dst, XtrId xtrId) Retrieves mapping for the provided dst key for a particular xtr id.getMapping(MappingOrigin origin, Eid key) Retrieves mapping from table for provided key.getParentPrefix(Eid key) Returns the parent prefix for given key.getSubscribers(Eid address) Retrieves the subscribers for an EID.getSubtree(MappingOrigin origin, Eid key) Retrieves the subtree of a maskable prefix from the given map-cache.Retrieves widest negative prefix from table for provided key.handleSbExpiredMapping(Eid key, XtrId xtrId, MappingData mappingData) voidbooleanisMaster()Get cluster master status.voidnotifyChange(Eid eid, MappingRecord mapping, MappingChange mappingChange) Print keys in cache in a human friendly format.Print mappings in cache in a human friendly format.Print all authentication keys.Print all mappings.voidrefreshMappingRegistration(Eid key, XtrId xtrId, Long timestamp) Refresh southbound mapping registration timestamp.voidRemove authentication key.voidremoveData(MappingOrigin origin, Eid key, String subKey) Generic removal of data.voidremoveMapping(MappingOrigin origin, Eid key) Remove mapping.voidsetDataStoreBackEnd(DataStoreBackEnd dataStoreBackEnd) voidsetIsMaster(boolean isMaster) Set cluster master status.voidsetIterateMask(boolean iterate) Sets iterateMask.voidsetMappingMerge(boolean mappingMerge) Configure merge policy.voidsubscribe(Subscriber subscriber, Eid subscribedEid) Subscribe a Subscriber to receive updates about mapping changes for an EID.voidupdateMapping(MappingOrigin origin, Eid key, MappingData mappingData) Update mapping.
-
Constructor Details
-
MappingSystem
public MappingSystem(ILispDAO dao, boolean iterateMask, org.opendaylight.mdsal.binding.api.NotificationPublishService nps, boolean mappingMerge)
-
-
Method Details
-
setDataStoreBackEnd
-
setMappingMerge
public void setMappingMerge(boolean mappingMerge) Description copied from interface:IMappingSystemConfigure merge policy. If set to true, mappings are merged.- Specified by:
setMappingMergein interfaceIMappingSystem- Parameters:
mappingMerge- Value to configure
-
setIterateMask
public void setIterateMask(boolean iterate) Description copied from interface:IMappingSystemSets iterateMask. If set to true, longest prefix matching for IP keys is used.- Specified by:
setIterateMaskin interfaceIMappingSystem- Parameters:
iterate- Value to configure
-
initialize
public void initialize() -
updateMapping
Description copied from interface:IMappingSystemUpdate mapping.- Specified by:
updateMappingin interfaceIMappingSystem- Parameters:
origin- Table where mapping should be addedkey- Key of the mappingmappingData- Mapping to be stored
-
addMapping
Description copied from interface:IMappingSystemAdd mapping.- Specified by:
addMappingin interfaceIMappingSystem- Parameters:
origin- Table where mapping should be addedkey- Key of the mappingmappingData- Mapping to be stored
-
addNegativeMapping
Description copied from interface:IMappingSystemGenerate and add a negative mapping entry originated from the southbound, and return the generated mapping.- Specified by:
addNegativeMappingin interfaceIMappingSystem- Parameters:
key- Key of the mapping- Returns:
- Returns the generated negative mapping (which is never null).
-
refreshMappingRegistration
Description copied from interface:IMappingSystemRefresh southbound mapping registration timestamp.- Specified by:
refreshMappingRegistrationin interfaceIMappingSystem- Parameters:
key- The EID whose registration must be refreshedxtrId- xTR-ID of the mapping to be refreshedtimestamp- New timestamp for the mapping
-
getMapping
Description copied from interface:IMappingSystemRetrieves mapping for the provided src and dst key.- Specified by:
getMappingin interfaceIMappingSystem- Parameters:
src- Source Key to be looked updst- Destination Key to be looked up- Returns:
- Returns the mapping found in the MappingSystem or null if nothing is found.
-
getMapping
Description copied from interface:IMappingSystemRetrieves mapping for the provided dst key.- Specified by:
getMappingin interfaceIMappingSystem- Parameters:
dst- Destination Key to be looked up- Returns:
- Returns the mapping found in the Mapping System or null if nothing is found.
-
getMapping
Description copied from interface:IMappingSystemRetrieves mapping for the provided dst key for a particular xtr id.- Specified by:
getMappingin interfaceIMappingSystem- Parameters:
src- Source Key to be looked up.dst- Destination Key to be looked up.xtrId- Xtr Id for which this look to be done. If null, this method works like regular getMapping(src, dst)- Returns:
- Returns the mapping found in the simple map cache or null if nothing is found.
-
getMapping
Description copied from interface:IMappingSystemRetrieves mapping from table for provided key.- Specified by:
getMappingin interfaceIMappingSystem- Parameters:
origin- Table where mapping should be looked upkey- Key to be looked up- Returns:
- Returns the mapping found in the cache or null if nothing is found.
-
handleSbExpiredMapping
-
getWidestNegativePrefix
Description copied from interface:IMappingSystemRetrieves widest negative prefix from table for provided key.- Specified by:
getWidestNegativePrefixin interfaceIMappingSystem- Parameters:
key- Key to be looked up- Returns:
- Returns the prefix found in the cache or null if nothing is found.
-
getSubtree
Description copied from interface:IMappingSystemRetrieves the subtree of a maskable prefix from the given map-cache.- Specified by:
getSubtreein interfaceIMappingSystem- Parameters:
origin- Table where the key should be looked upkey- Key to be looked up- Returns:
- The child prefixes of the prefix, including the prefix itself if present
-
removeMapping
Description copied from interface:IMappingSystemRemove mapping.- Specified by:
removeMappingin interfaceIMappingSystem- Parameters:
origin- Table for mapping that should be removedkey- Key to be removed
-
notifyChange
-
subscribe
Description copied from interface:IMappingSystemSubscribe a Subscriber to receive updates about mapping changes for an EID.- Specified by:
subscribein interfaceIMappingSystem- Parameters:
subscriber- The Subscriber object with information about the subscribersubscribedEid- The EID for which the subscriber will receive updates
-
getSubscribers
Description copied from interface:IMappingSystemRetrieves the subscribers for an EID.- Specified by:
getSubscribersin interfaceIMappingSystem- Parameters:
address- The EID to be looked up- Returns:
- The set of subscribers for the EID
-
addAuthenticationKey
Description copied from interface:IMappingSystemAdd authentication key.- Specified by:
addAuthenticationKeyin interfaceIMappingSystem- Parameters:
key- The key for which the authentication key is addedauthKey- The authentication key
-
getAuthenticationKey
Description copied from interface:IMappingSystemRetrieve authentication key.- Specified by:
getAuthenticationKeyin interfaceIMappingSystem- Parameters:
key- The key for which the authentication key is being looked up.- Returns:
- The authentication key.
-
removeAuthenticationKey
Description copied from interface:IMappingSystemRemove authentication key.- Specified by:
removeAuthenticationKeyin interfaceIMappingSystem- Parameters:
key- Key for which the authentication key should be removed.
-
addData
Description copied from interface:IMappingSystemAdd data for key.- Specified by:
addDatain interfaceIMappingSystem- Parameters:
origin- Table for data that should be addedkey- The key for which data is insertedsubKey- The subKey where data should be inserteddata- The data to be stored
-
getData
Description copied from interface:IMappingSystemGeneric retrieval of data.- Specified by:
getDatain interfaceIMappingSystem- Parameters:
origin- Table from where data should be retrievedkey- The key where the data is storedsubKey- The subKey where data is stored- Returns:
- The data
-
removeData
Description copied from interface:IMappingSystemGeneric removal of data.- Specified by:
removeDatain interfaceIMappingSystem- Parameters:
origin- Table from where data should be removedkey- The key of the data to be removedsubKey- The subKey of the data to be removed
-
getParentPrefix
Description copied from interface:IMappingSystemReturns the parent prefix for given key.- Specified by:
getParentPrefixin interfaceIMappingSystem- Parameters:
key- The key which parent is to be returned.- Returns:
- The parent perfix of a specific key.
-
destroy
public void destroy() -
printMappings
Description copied from interface:IMappingSystemPrint all mappings. Used for testing, debugging and the karaf shell.- Specified by:
printMappingsin interfaceIMappingSystem- Returns:
- String consisting of all mappings
-
prettyPrintMappings
Description copied from interface:IMappingSystemPrint mappings in cache in a human friendly format.- Specified by:
prettyPrintMappingsin interfaceIMappingSystem- Returns:
- a String consisting of all the mappings in the cache
-
printKeys
Description copied from interface:IMappingSystemPrint all authentication keys. Used for testing, debugging and the karaf shell.- Specified by:
printKeysin interfaceIMappingSystem- Returns:
- String consisting of all mappings
-
prettyPrintKeys
Description copied from interface:IMappingSystemPrint keys in cache in a human friendly format.- Specified by:
prettyPrintKeysin interfaceIMappingSystem- Returns:
- a String consisting of all the keys in the cache
-
cleanCaches
public void cleanCaches() -
cleanSBMappings
public void cleanSBMappings() -
setIsMaster
public void setIsMaster(boolean isMaster) Description copied from interface:IMappingSystemSet cluster master status.- Specified by:
setIsMasterin interfaceIMappingSystem- Parameters:
isMaster- is|isn't master
-
isMaster
public boolean isMaster()Description copied from interface:IMappingSystemGet cluster master status.- Specified by:
isMasterin interfaceIMappingSystem- Returns:
- isMaster is|isn't master
-