mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-10-15 09:21:06 +02:00
Add MappingRepository type to signify where to store mapping info
Change-Id: If6e1deec011e85102a05b985306232f81834736b
This commit is contained in:
parent
01f6ae0209
commit
c7badf9b4e
@ -26,8 +26,8 @@ public interface MappingProviderService extends ProviderService<MappingProvider>
|
||||
/**
|
||||
* Signals that a new mapping has been received.
|
||||
*
|
||||
* @param mappingEntry newly added mapping entry
|
||||
* @param isMapDatabase indicate that where this map entry should be stored
|
||||
* @param mappingEntry newly added mapping entry
|
||||
* @param type indicates that where this map entry should be stored
|
||||
*/
|
||||
void mappingAdded(MappingEntry mappingEntry, boolean isMapDatabase);
|
||||
void mappingAdded(MappingEntry mappingEntry, MappingStore.Type type);
|
||||
}
|
||||
|
@ -21,4 +21,17 @@ import org.onosproject.store.Store;
|
||||
* Interface of a distributed store for managing mapping information.
|
||||
*/
|
||||
public interface MappingStore extends Store<MappingEvent, MappingStoreDelegate> {
|
||||
|
||||
enum Type {
|
||||
|
||||
/**
|
||||
* Signifies that mapping information should be stored in map database.
|
||||
*/
|
||||
MAP_DATABASE,
|
||||
|
||||
/**
|
||||
* Signifies that mapping information should be stored in map cache.
|
||||
*/
|
||||
MAP_CACHE
|
||||
}
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ public class MappingProviderServiceAdapter implements MappingProviderService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mappingAdded(MappingEntry mappingEntry, boolean isMapDatabase) {
|
||||
public void mappingAdded(MappingEntry mappingEntry, MappingStore.Type type) {
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -38,6 +38,9 @@ import org.onosproject.provider.lisp.mapping.util.MappingEntryBuilder;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import static org.onosproject.mapping.MappingStore.Type.MAP_CACHE;
|
||||
import static org.onosproject.mapping.MappingStore.Type.MAP_DATABASE;
|
||||
|
||||
/**
|
||||
* Provider which uses a LISP controller to manage EID-RLOC mapping.
|
||||
*/
|
||||
@ -137,14 +140,14 @@ public class LispMappingProvider extends AbstractProvider implements MappingProv
|
||||
LispMapReply reply = (LispMapReply) msg;
|
||||
|
||||
MappingEntry replyMe = new MappingEntryBuilder(deviceId, reply).build();
|
||||
providerService.mappingAdded(replyMe, false);
|
||||
providerService.mappingAdded(replyMe, MAP_CACHE);
|
||||
break;
|
||||
|
||||
case LISP_MAP_NOTIFY:
|
||||
LispMapNotify notify = (LispMapNotify) msg;
|
||||
|
||||
MappingEntry notifyMe = new MappingEntryBuilder(deviceId, notify).build();
|
||||
providerService.mappingAdded(notifyMe, true);
|
||||
providerService.mappingAdded(notifyMe, MAP_DATABASE);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
Loading…
x
Reference in New Issue
Block a user