use of org.opendaylight.lispflowmapping.mapcache.AuthKeyDb in project lispflowmapping by opendaylight.
the class MappingSystem method buildMapCaches.
private void buildMapCaches() {
/*
* There exists a direct relationship between MappingOrigins and the tables that are part of the MappingSystem.
* Therefore, if a new origin is added, probably a new table should be instantiated here as well. Here we
* instantiate a SimpleMapCache for southbound originated LISP mappings and a MultiTableMapCache for northbound
* originated mappings. Use of FlatMapCache would be possible when no longest prefix match is needed at all,
* but that option is no longer supported in the code, since it was never tested and may lead to unexpected
* results.
*/
sdao = dao.putTable(MappingOrigin.Southbound.toString());
pmc = new MultiTableMapCache(dao.putTable(MappingOrigin.Northbound.toString()));
smc = new SimpleMapCache(sdao);
akdb = new AuthKeyDb(dao.putTable(AUTH_KEY_TABLE));
tableMap.put(MappingOrigin.Northbound, pmc);
tableMap.put(MappingOrigin.Southbound, smc);
}
use of org.opendaylight.lispflowmapping.mapcache.AuthKeyDb in project lispflowmapping by opendaylight.
the class LispSouthboundPlugin method init.
public void init() {
LOG.info("LISP (RFC6830) Southbound Plugin is initializing...");
synchronized (startLock) {
this.akdb = new AuthKeyDb(new HashMapDb());
this.authenticationKeyDataListener = new AuthenticationKeyDataListener(dataBroker, akdb);
this.dsbe = new DataStoreBackEnd(dataBroker);
restoreDaoFromDatastore();
LispSouthboundHandler lsbh = new LispSouthboundHandler(this);
this.lispSouthboundHandler = lsbh;
LispXtrSouthboundHandler lxsbh = new LispXtrSouthboundHandler(this);
this.lispXtrSouthboundHandler = lxsbh;
if (Epoll.isAvailable()) {
eventLoopGroup = new EpollEventLoopGroup(numChannels, threadFactory);
channelType = EpollDatagramChannel.class;
bootstrap.option(ChannelOption.ALLOCATOR, PooledByteBufAllocator.DEFAULT);
bootstrap.option(EpollChannelOption.SO_REUSEPORT, true);
LOG.debug("Using Netty Epoll for UDP sockets");
} else {
eventLoopGroup = new NioEventLoopGroup(0, threadFactory);
channelType = NioDatagramChannel.class;
LOG.debug("Using Netty I/O (non-Epoll) for UDP sockets");
}
bootstrap.group(eventLoopGroup);
bootstrap.channel(channelType);
bootstrap.handler(lsbh);
xtrBootstrap.group(eventLoopGroup);
xtrBootstrap.channel(channelType);
xtrBootstrap.handler(lxsbh);
start();
startXtr();
clusterSingletonService.registerClusterSingletonService(this);
LOG.info("LISP (RFC6830) Southbound Plugin is up!");
}
}
Aggregations