use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi.list.afi.safi.GracefulRestartBuilder in project bgpcep by opendaylight.
the class NeighborUtilTest method buildAfisSafisState.
@Test
public void buildAfisSafisState() {
assertEquals(Collections.emptyList(), NeighborUtil.buildAfisSafisState(this.bgpAfiSafiState, this.tableRegistry));
final GracefulRestart graceful = new GracefulRestartBuilder().setState(new StateBuilder().addAugmentation(NeighborAfiSafiGracefulRestartStateAugmentation.class, new NeighborAfiSafiGracefulRestartStateAugmentationBuilder().setAdvertised(false).setReceived(false).build()).build()).build();
final org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi.list.afi.safi.State afiSafiState = new org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi.list.afi.safi.StateBuilder().addAugmentation(NeighborAfiSafiStateAugmentation.class, new NeighborAfiSafiStateAugmentationBuilder().setActive(false).build()).build();
this.afiSafi = Optional.of(IPV4UNICAST.class);
final AfiSafi expected = new AfiSafiBuilder().setAfiSafiName(this.afiSafi.get()).setState(afiSafiState).setGracefulRestart(graceful).build();
assertEquals(Collections.singletonList(expected), NeighborUtil.buildAfisSafisState(this.bgpAfiSafiState, this.tableRegistry));
}
use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi.list.afi.safi.GracefulRestartBuilder in project bgpcep by opendaylight.
the class StateProviderImplTest method buildAfiSafis.
private static AfiSafis buildAfiSafis() {
final NeighborAfiSafiStateAugmentationBuilder neighborAfiSafiStateAugmentation = new NeighborAfiSafiStateAugmentationBuilder().setActive(true).setPrefixes(new PrefixesBuilder().setSent(1L).setReceived(2L).setInstalled(1L).build());
final AfiSafi afiSafi = new AfiSafiBuilder().setAfiSafiName(IPV4UNICAST.class).setGracefulRestart(new GracefulRestartBuilder().setState(new StateBuilder().setEnabled(false).addAugmentation(NeighborAfiSafiGracefulRestartStateAugmentation.class, new NeighborAfiSafiGracefulRestartStateAugmentationBuilder().setAdvertised(true).setReceived(true).build()).build()).build()).setState(new org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi.list.afi.safi.StateBuilder().setEnabled(false).addAugmentation(NeighborAfiSafiStateAugmentation.class, neighborAfiSafiStateAugmentation.build()).build()).build();
return new AfiSafisBuilder().setAfiSafi(Collections.singletonList(afiSafi)).build();
}
use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi.list.afi.safi.GracefulRestartBuilder in project netvirt by opendaylight.
the class BgpConfigurationManager method addGracefulRestart.
public void addGracefulRestart(int staleTime) {
InstanceIdentifier.InstanceIdentifierBuilder<GracefulRestart> iib = InstanceIdentifier.builder(Bgp.class).child(GracefulRestart.class);
InstanceIdentifier<GracefulRestart> iid = iib.build();
GracefulRestart dto = new GracefulRestartBuilder().setStalepathTime((long) staleTime).build();
update(iid, dto);
}
Aggregations