public GracefulRestartBuilder(GracefulRestart base) { this._stalepathTime = base.getStalepathTime(); if (base instanceof GracefulRestartImpl) { GracefulRestartImpl impl = (GracefulRestartImpl) base; if (!impl.augmentation.isEmpty()) { this.augmentation = new HashMap<>(impl.augmentation); } } else if (base instanceof AugmentationHolder) { @SuppressWarnings("unchecked") AugmentationHolder<org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.GracefulRestart> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.GracefulRestart>) base; if (!casted.augmentations().isEmpty()) { this.augmentation = new HashMap<>(casted.augmentations()); } } }
if (!Objects.equals(_stalepathTime, other.getStalepathTime())) { return false; if (!e.getValue().equals(other.getAugmentation(e.getKey()))) { return false;
protected void update(InstanceIdentifier<GracefulRestart> iid, GracefulRestart oldval, GracefulRestart newval) { LOG.debug("received update GracefulRestart config val {}", newval.getStalepathTime().intValue()); synchronized(BgpConfigurationManager.this) { BgpRouter br = getClient(yangObj); if (br == null) { return; } try { br.addGracefulRestart(newval.getStalepathTime().intValue()); } catch (Exception e) { LOG.error(yangObj+"update received exception: \""+e+"\"; "+addWarn); } } }
protected synchronized void add(InstanceIdentifier<GracefulRestart> iid, GracefulRestart val) { synchronized(BgpConfigurationManager.this) { BgpRouter br = getClient(yangObj); if (br == null) { return; } try { br.addGracefulRestart(val.getStalepathTime().intValue()); } catch (Exception e) { LOG.error(yangObj+"Add received exception: \""+e+"\"; "+addWarn); } } }
protected synchronized void remove(InstanceIdentifier<GracefulRestart> iid, GracefulRestart val) { LOG.debug("received delete GracefulRestart config val {}", val.getStalepathTime().intValue()); synchronized(BgpConfigurationManager.this) { BgpRouter br = getClient(yangObj); if (br == null) { return; } try { br.delGracefulRestart(); } catch (Exception e) { LOG.error(yangObj+" Delete received exception: \""+e+"\"; " +delWarn); } } }
protected void update(InstanceIdentifier<GracefulRestart> iid, GracefulRestart oldval, GracefulRestart newval) { if (ignoreClusterDcnEventForFollower()) { return; } LOG.debug("received update GracefulRestart config val {}", newval.getStalepathTime().intValue()); synchronized (BgpConfigurationManager.this) { BgpRouter br = getClient(yangObj); if (br == null) { return; } try { br.addGracefulRestart(newval.getStalepathTime().intValue()); } catch (Exception e) { LOG.error(yangObj + "update received exception: \"" + e + "\"; " + addWarn); } } }
protected synchronized void add(InstanceIdentifier<GracefulRestart> iid, GracefulRestart val) { if (ignoreClusterDcnEventForFollower()) { return; } synchronized (BgpConfigurationManager.this) { BgpRouter br = getClient(yangObj); if (br == null) { return; } try { br.addGracefulRestart(val.getStalepathTime().intValue()); } catch (Exception e) { LOG.error(yangObj + "Add received exception: \"" + e + "\"; " + addWarn); } } }
protected synchronized void remove(InstanceIdentifier<GracefulRestart> iid, GracefulRestart val) { if (ignoreClusterDcnEventForFollower()) { return; } LOG.debug("received delete GracefulRestart config val {}", val.getStalepathTime().intValue()); synchronized (BgpConfigurationManager.this) { BgpRouter br = getClient(yangObj); if (br == null) { return; } try { br.delGracefulRestart(); } catch (Exception e) { LOG.error(yangObj + " Delete received exception: \"" + e + "\"; " + delWarn); } } }
public static long getStalePathtime(int defValue, AsId as_num) { long spt = 0; try { spt = getConfig().getGracefulRestart().getStalepathTime(); } catch (Exception e) { try { spt = as_num.getStalepathTime(); LOG.trace("BGP config/Stale-path time is not set using graceful"); } catch (Exception ignore) { LOG.trace("BGP AS id is not set using graceful"); spt = defValue; } } if (spt == 0) { LOG.trace("BGP config/Stale-path time is not set using graceful/start-bgp"); spt = defValue; } return spt; }
@Override public void run() { try { long startTime = System.currentTimeMillis(); LOG.error("started creating stale fib map "); createStaleFibMap(); long endTime = System.currentTimeMillis(); LOG.error("took {} msecs for stale fib map creation ", endTime - startTime); LOG.error("started bgp config replay "); startTime = endTime; replay(); endTime = System.currentTimeMillis(); LOG.error("took {} msecs for bgp replay ", endTime - startTime); long route_sync_time = BGP_RESTART_ROUTE_SYNC_SEC; try { route_sync_time = bgpManager.getConfig().getGracefulRestart().getStalepathTime(); } catch (Exception e) { LOG.error("BGP config/Stale-path time is not set"); } Thread.sleep(route_sync_time * 1000L); new RouteCleanup().call(); } catch (Exception eCancel) { LOG.error("Stale Cleanup Task Cancelled", eCancel); } } };
s = g.getStalepathTime().intValue();
s = g.getStalepathTime().intValue();
if (g != null) { try { br.addGracefulRestart(g.getStalepathTime().intValue()); } catch (Exception e) { LOG.error("Replay:addGr() received exception: \"" + e + "\"");
if (g != null) { try { br.addGracefulRestart(g.getStalepathTime().intValue()); } catch (Exception e) { LOG.error("Replay:addGr() received exception: \""+e+"\"");