use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.ll.graceful.restart.rev181112.Config2 in project bgpcep by opendaylight.
the class GracefulRestartUtil method getLlGracefulTimers.
static Map<TablesKey, Integer> getLlGracefulTimers(final Collection<? extends AfiSafi> afiSafis, final BGPTableTypeRegistryConsumer tableTypeRegistry) {
final Map<TablesKey, Integer> timers = new HashMap<>();
afiSafis.forEach(afiSafi -> {
final GracefulRestart gracefulRestart = afiSafi.getGracefulRestart();
if (gracefulRestart != null) {
final Config gracefulRestartConfig = gracefulRestart.getConfig();
if (gracefulRestartConfig != null) {
final LlGracefulRestart llGracefulRestart;
final Config1 peerAug = gracefulRestartConfig.augmentation(Config1.class);
if (peerAug != null) {
llGracefulRestart = peerAug.getLlGracefulRestart();
} else {
final Config2 neighborAug = gracefulRestartConfig.augmentation(Config2.class);
if (neighborAug != null) {
llGracefulRestart = neighborAug.getLlGracefulRestart();
} else {
return;
}
}
if (llGracefulRestart != null) {
final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.ll.graceful.restart.rev181112.afi.safi.ll.graceful.restart.ll.graceful.restart.Config config = llGracefulRestart.getConfig();
if (config != null) {
final Uint24 staleTime = config.getLongLivedStaleTime();
if (staleTime != null && staleTime.getValue().toJava() > 0) {
final TablesKey key = tableTypeRegistry.getTableKey(afiSafi.getAfiSafiName());
if (key != null) {
timers.put(key, staleTime.getValue().intValue());
} else {
LOG.debug("Skipping unsupported afi-safi {}", afiSafi.getAfiSafiName());
}
}
}
}
}
}
});
return timers;
}
Aggregations