</instructions>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <configuration>
+ <propertyExpansion>checkstyle.violationSeverity=error</propertyExpansion>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>findbugs-maven-plugin</artifactId>
+ <configuration>
+ <failOnError>true</failOnError>
+ </configuration>
+ </plugin>
</plugins>
</build>
}
/**
- * Build Openconfig Global containing RIB group stats from a list of BGP RIB State
+ * Build Openconfig Global containing RIB group stats from a list of BGP RIB State.
*
- * @param ribState containing RIb Operational State
+ * @param ribState containing RIb Operational State
* @param bgpTableTypeRegistry BGP TableType Registry
- * @return
+ * @return Global containing state
*/
@Nonnull
public static Global buildGlobal(final BGPRIBState ribState,
- final BGPTableTypeRegistryConsumer bgpTableTypeRegistry) {
- return new GlobalBuilder().setState(buildState(ribState))
- .setAfiSafis(new AfiSafisBuilder().setAfiSafi(buildAfisSafis(ribState, bgpTableTypeRegistry)).build())
- .build();
+ final BGPTableTypeRegistryConsumer bgpTableTypeRegistry) {
+ return new GlobalBuilder().setState(buildState(ribState))
+ .setAfiSafis(new AfiSafisBuilder().setAfiSafi(buildAfisSafis(ribState, bgpTableTypeRegistry)).build())
+ .build();
}
/**
- * Build per AFI SAFI Openconfig Global State containing RIB group stats from a list of BGP RIB State
- * @param ribState containing RIb Operational State
+ * Build per AFI SAFI Openconfig Global State containing RIB group stats from a list of BGP RIB State.
+ *
+ * @param ribState containing RIb Operational State
* @param bgpTableTypeRegistry BGP TableType Registry
* @return List containing per afi/safi operational state
*/
public static List<AfiSafi> buildAfisSafis(final BGPRIBState ribState,
- final BGPTableTypeRegistryConsumer bgpTableTypeRegistry) {
+ final BGPTableTypeRegistryConsumer bgpTableTypeRegistry) {
return ribState.getPathsCount().keySet().stream()
- .map(tk -> buildAfiSafi(ribState, tk, bgpTableTypeRegistry))
- .collect(Collectors.toList());
+ .map(tk -> buildAfiSafi(ribState, tk, bgpTableTypeRegistry))
+ .collect(Collectors.toList());
}
/**
- * Build Openconfig Global State
+ * Build Openconfig Global State.
+ *
* @param ribState containing RIb Operational State
* @return Openconfig Global State
*/
- public static org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.global.base.State buildState(
- final BGPRIBState ribState) {
+ public static org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.global.base
+ .State buildState(final BGPRIBState ribState) {
return new org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.global.base.StateBuilder()
- .setAs(ribState.getAs())
- .setRouterId(ribState.getRouteId())
- .setTotalPaths(ribState.getTotalPathsCount())
- .setTotalPrefixes(ribState.getTotalPrefixesCount())
- .build();
+ .setAs(ribState.getAs())
+ .setRouterId(ribState.getRouteId())
+ .setTotalPaths(ribState.getTotalPathsCount())
+ .setTotalPrefixes(ribState.getTotalPrefixesCount())
+ .build();
}
/**
+ * Build Afi Safi containing State.
*
- * @param ribState containing RIb Operational State
- * @param tablesKey table Key
+ * @param ribState containing RIb Operational State
+ * @param tablesKey table Key
* @param bgpTableTypeRegistry BGP TableType Registry
* @return Afi Safi Operational State
*/
public static AfiSafi buildAfiSafi(final BGPRIBState ribState, final TablesKey tablesKey,
- final BGPTableTypeRegistryConsumer bgpTableTypeRegistry) {
+ final BGPTableTypeRegistryConsumer bgpTableTypeRegistry) {
final Optional<Class<? extends AfiSafiType>> optAfiSafi = bgpTableTypeRegistry.getAfiSafiType(tablesKey);
if (!optAfiSafi.isPresent()) {
return null;
}
final State state = new StateBuilder()
- .addAugmentation(GlobalAfiSafiStateAugmentation.class, new GlobalAfiSafiStateAugmentationBuilder()
- .setTotalPaths(ribState.getPathCount(tablesKey)).setTotalPrefixes(ribState.getPrefixesCount(tablesKey))
- .build()).build();
+ .addAugmentation(GlobalAfiSafiStateAugmentation.class, new GlobalAfiSafiStateAugmentationBuilder()
+ .setTotalPaths(ribState.getPathCount(tablesKey))
+ .setTotalPrefixes(ribState.getPrefixesCount(tablesKey))
+ .build()).build();
return new AfiSafiBuilder().setAfiSafiName(optAfiSafi.get()).setState(state).build();
}
}
/**
* Build a Openconfig Neighbors container with all Neighbors Stats from a list of
- * BGPPeerGroupState
+ * BGPPeerGroupState.
*
- * @param peerStats List of BGPPeerState containing Neighbor state counters
+ * @param peerStats List of BGPPeerState containing Neighbor state counters
* @param bgpTableTypeRegistry BGP TableType Registry
* @return Openconfig Neighbors Stats
*/
@Nullable
public static Neighbors buildNeighbors(@Nonnull final List<BGPPeerState> peerStats,
- @Nonnull final BGPTableTypeRegistryConsumer bgpTableTypeRegistry) {
+ @Nonnull final BGPTableTypeRegistryConsumer bgpTableTypeRegistry) {
if (peerStats.isEmpty()) {
return null;
}
return new NeighborsBuilder().setNeighbor(peerStats.stream()
- .filter(Objects::nonNull)
- .map(neighbor -> buildNeighbor(neighbor, bgpTableTypeRegistry))
- .collect(Collectors.toList())).build();
+ .filter(Objects::nonNull)
+ .map(neighbor -> buildNeighbor(neighbor, bgpTableTypeRegistry))
+ .collect(Collectors.toList())).build();
}
/**
- * Build a list of neighbors containing Operational State from a list of BGPPeerState
+ * Build a list of neighbors containing Operational State from a list of BGPPeerState.
*
* @param neighbor containing Neighbor state counters
* @return neighbor containing Neighbor State
*/
@Nullable
public static Neighbor buildNeighbor(@Nonnull final BGPPeerState neighbor,
- @Nonnull final BGPTableTypeRegistryConsumer bgpTableTypeRegistry) {
+ @Nonnull final BGPTableTypeRegistryConsumer bgpTableTypeRegistry) {
return new NeighborBuilder()
- .setNeighborAddress(neighbor.getNeighborAddress())
- .setState(buildNeighborState(neighbor.getBGPSessionState(), neighbor.getBGPPeerMessagesState()))
- .setTimers(buildTimer(neighbor.getBGPTimersState()))
- .setTransport(buildTransport(neighbor.getBGPTransportState()))
- .setErrorHandling(buildErrorHandling(neighbor.getBGPErrorHandlingState()))
- .setGracefulRestart(buildGracefulRestart(neighbor.getBGPGracelfulRestart()))
- .setAfiSafis(buildAfisSafis(neighbor, bgpTableTypeRegistry))
- .build();
+ .setNeighborAddress(neighbor.getNeighborAddress())
+ .setState(buildNeighborState(neighbor.getBGPSessionState(), neighbor.getBGPPeerMessagesState()))
+ .setTimers(buildTimer(neighbor.getBGPTimersState()))
+ .setTransport(buildTransport(neighbor.getBGPTransportState()))
+ .setErrorHandling(buildErrorHandling(neighbor.getBGPErrorHandlingState()))
+ .setGracefulRestart(buildGracefulRestart(neighbor.getBGPGracelfulRestart()))
+ .setAfiSafis(buildAfisSafis(neighbor, bgpTableTypeRegistry))
+ .build();
}
/**
- * Builds Neighbor State from BGPPeerState counters
+ * Builds Neighbor State from BGPPeerState counters.
*
- * @param sessionState BGPPeerState containing Operational state counters
- * @param bgpPeerMessagesState
+ * @param sessionState BGPPeerState containing Operational state counters
+ * @param bgpPeerMessagesState message state
* @return Neighbor State
*/
@Nullable
public static State buildNeighborState(@Nullable final BGPSessionState sessionState,
- final BGPPeerMessagesState bgpPeerMessagesState) {
+ final BGPPeerMessagesState bgpPeerMessagesState) {
if (sessionState == null && bgpPeerMessagesState == null) {
return null;
}
}
/**
- * Builds Neighbor State from BGPPeerState counters
+ * Builds Neighbor State from BGPPeerState counters.
*
* @param neighbor BGPPeerState containing Operational state counters
* @return Timer State
return null;
}
final NeighborTimersStateAugmentation timerState = new NeighborTimersStateAugmentationBuilder()
- .setNegotiatedHoldTime(BigDecimal.valueOf(neighbor.getNegotiatedHoldTime()))
- .setUptime(new Timeticks(neighbor.getUpTime())).build();
+ .setNegotiatedHoldTime(BigDecimal.valueOf(neighbor.getNegotiatedHoldTime()))
+ .setUptime(new Timeticks(neighbor.getUpTime())).build();
return new TimersBuilder().setState(new org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp
- .neighbor.group.timers.StateBuilder()
- .addAugmentation(NeighborTimersStateAugmentation.class, timerState).build()).build();
+ .neighbor.group.timers.StateBuilder()
+ .addAugmentation(NeighborTimersStateAugmentation.class, timerState).build()).build();
}
/**
- * Builds Transport State from BGPTransportState counters
+ * Builds Transport State from BGPTransportState counters.
*
* @param neighbor BGPPeerState containing Operational state counters
* @return Transport State
return null;
}
final NeighborTransportStateAugmentation transportState = new NeighborTransportStateAugmentationBuilder()
- .setLocalPort(neighbor.getLocalPort()).setRemoteAddress(neighbor.getRemoteAddress())
- .setRemotePort(neighbor.getRemotePort()).build();
+ .setLocalPort(neighbor.getLocalPort()).setRemoteAddress(neighbor.getRemoteAddress())
+ .setRemotePort(neighbor.getRemotePort()).build();
return new TransportBuilder().setState(new org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009
- .bgp.neighbor.group.transport.StateBuilder()
- .addAugmentation(NeighborTransportStateAugmentation.class, transportState).build()).build();
+ .bgp.neighbor.group.transport.StateBuilder()
+ .addAugmentation(NeighborTransportStateAugmentation.class, transportState).build()).build();
}
/**
- * Builds Error Handling State from BGPPeerState counters
+ * Builds Error Handling State from BGPPeerState counters.
*
* @param errorHandlingState BGPErrorHandlingState containing ErrorHandlingState Operational state counters
* @return Error Handling State
if (errorHandlingState == null) {
return null;
}
- return new ErrorHandlingBuilder().setState(new org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.
- rev151009.bgp.neighbor.group.error.handling.StateBuilder()
- .addAugmentation(NeighborErrorHandlingStateAugmentation.class,
- buildErrorHandlingState(errorHandlingState.getErroneousUpdateReceivedCount())).build()).build();
+ return new ErrorHandlingBuilder().setState(new org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp
+ .rev151009.bgp.neighbor.group.error.handling.StateBuilder()
+ .addAugmentation(NeighborErrorHandlingStateAugmentation.class,
+ buildErrorHandlingState(errorHandlingState.getErroneousUpdateReceivedCount())).build()).build();
}
/**
- * Builds Graceful Restart containing Graceful Restart State from BGPGracelfulRestartState counters
+ * Builds Graceful Restart containing Graceful Restart State from BGPGracelfulRestartState counters.
*
* @param neighbor BGPPeerState containing Operational state counters
* @return Graceful Restart
@Nonnull
public static GracefulRestart buildGracefulRestart(@Nonnull final BGPGracelfulRestartState neighbor) {
final NeighborGracefulRestartStateAugmentation gracefulRestartState =
- new NeighborGracefulRestartStateAugmentationBuilder()
- .setLocalRestarting(neighbor.isLocalRestarting())
- .setPeerRestartTime(neighbor.getPeerRestartTime())
- //.setMode(mode) TBD once implemented
- .setPeerRestarting(neighbor.isPeerRestarting()).build();
+ new NeighborGracefulRestartStateAugmentationBuilder()
+ .setLocalRestarting(neighbor.isLocalRestarting())
+ .setPeerRestartTime(neighbor.getPeerRestartTime())
+ //.setMode(mode) TBD once implemented
+ .setPeerRestarting(neighbor.isPeerRestarting()).build();
return new GracefulRestartBuilder().setState(new org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp
- .rev151009.bgp.graceful.restart.graceful.restart.StateBuilder()
- .addAugmentation(NeighborGracefulRestartStateAugmentation.class, gracefulRestartState).build()).build();
+ .rev151009.bgp.graceful.restart.graceful.restart.StateBuilder()
+ .addAugmentation(NeighborGracefulRestartStateAugmentation.class, gracefulRestartState).build()).build();
}
/**
- * Builds Neighbor Afi Safi containing AfiSafi State
+ * Builds Neighbor Afi Safi containing AfiSafi State.
*
* @param neighbor BGPPeerState containing Operational state counters
* @return Afi Safis
*/
public static AfiSafis buildAfisSafis(@Nonnull final BGPPeerState neighbor,
- @Nonnull final BGPTableTypeRegistryConsumer bgpTableTypeRegistry) {
- return new AfiSafisBuilder().setAfiSafi(buildAfisSafisState(neighbor.getBGPAfiSafiState(), bgpTableTypeRegistry)).build();
+ @Nonnull final BGPTableTypeRegistryConsumer bgpTableTypeRegistry) {
+ return new AfiSafisBuilder().setAfiSafi(buildAfisSafisState(neighbor.getBGPAfiSafiState(),
+ bgpTableTypeRegistry)).build();
}
/**
- * Builds Neighbor State containing Capabilities State, session State
+ * Builds Neighbor State containing Capabilities State, session State.
*
* @return Neighbor State
*/
final List<Class<? extends BgpCapability>> supportedCapabilities = buildSupportedCapabilities(neighbor);
SessionState sessionState = null;
switch (neighbor.getSessionState()) {
- case IDLE:
- sessionState = SessionState.IDLE;
- break;
- case UP:
- sessionState = SessionState.ESTABLISHED;
- break;
- case OPEN_CONFIRM:
- sessionState = SessionState.OPENCONFIRM;
- break;
- default:
+ case IDLE:
+ sessionState = SessionState.IDLE;
+ break;
+ case UP:
+ sessionState = SessionState.ESTABLISHED;
+ break;
+ case OPEN_CONFIRM:
+ sessionState = SessionState.OPENCONFIRM;
+ break;
+ default:
}
return new NeighborStateAugmentationBuilder().setSupportedCapabilities(supportedCapabilities)
- .setSessionState(sessionState).build();
+ .setSessionState(sessionState).build();
}
/**
- * Builds Bgp Neighbor State containing Message State
+ * Builds Bgp Neighbor State containing Message State.
*
* @return BgpNeighborState containing Message State
*/
@Nonnull
public static BgpNeighborStateAugmentation buildMessageState(@Nonnull final BGPPeerMessagesState neighbor) {
return new BgpNeighborStateAugmentationBuilder()
- .setMessages(new MessagesBuilder()
- .setReceived(buildMessagesReceived(neighbor))
- .setSent(buildMessagesSent(neighbor)).build()).build();
+ .setMessages(new MessagesBuilder()
+ .setReceived(buildMessagesReceived(neighbor))
+ .setSent(buildMessagesSent(neighbor)).build()).build();
}
private static Received buildMessagesReceived(@Nonnull final BGPPeerMessagesState neighbor) {
return new ReceivedBuilder()
- .setUPDATE(toBigInteger(neighbor.getUpdateMessagesReceivedCount()))
- .setNOTIFICATION(toBigInteger(neighbor.getNotificationMessagesReceivedCount()))
- .build();
+ .setUPDATE(toBigInteger(neighbor.getUpdateMessagesReceivedCount()))
+ .setNOTIFICATION(toBigInteger(neighbor.getNotificationMessagesReceivedCount()))
+ .build();
}
public static BigInteger toBigInteger(final long updateReceivedCounter) {
private static Sent buildMessagesSent(@Nonnull final BGPPeerMessagesState neighbor) {
return new SentBuilder()
- .setUPDATE(toBigInteger(neighbor.getUpdateMessagesSentCount()))
- .setNOTIFICATION(toBigInteger(neighbor.getNotificationMessagesSentCount()))
- .build();
+ .setUPDATE(toBigInteger(neighbor.getUpdateMessagesSentCount()))
+ .setNOTIFICATION(toBigInteger(neighbor.getNotificationMessagesSentCount()))
+ .build();
}
/**
- * Builds Neighbor Error Handling State
+ * Builds Neighbor Error Handling State.
*
* @param erroneousUpdateCount erroneous Update Count
* @return Error Handling State
@Nonnull
public static NeighborErrorHandlingStateAugmentation buildErrorHandlingState(final long erroneousUpdateCount) {
return new NeighborErrorHandlingStateAugmentationBuilder()
- .setErroneousUpdateMessages(erroneousUpdateCount).build();
+ .setErroneousUpdateMessages(erroneousUpdateCount).build();
}
/**
- * Build List of afi safi containing State per Afi Safi
+ * Build List of afi safi containing State per Afi Safi.
*
* @return AfiSafi List
*/
@Nonnull
public static List<AfiSafi> buildAfisSafisState(@Nonnull final BGPAfiSafiState neighbor,
- @Nonnull final BGPTableTypeRegistryConsumer bgpTableTypeRegistry) {
+ @Nonnull final BGPTableTypeRegistryConsumer bgpTableTypeRegistry) {
final Set<TablesKey> afiSafiJoin = new HashSet<>(neighbor.getAfiSafisAdvertized());
afiSafiJoin.addAll(neighbor.getAfiSafisReceived());
return afiSafiJoin.stream().map(tableKey -> buildAfiSafi(neighbor, tableKey, bgpTableTypeRegistry))
- .filter(Objects::nonNull)
- .collect(Collectors.toList());
+ .filter(Objects::nonNull)
+ .collect(Collectors.toList());
}
private static AfiSafi buildAfiSafi(@Nonnull final BGPAfiSafiState neighbor,
- @Nonnull final TablesKey tablesKey, @Nonnull final BGPTableTypeRegistryConsumer bgpTableTypeRegistry) {
+ @Nonnull final TablesKey tablesKey, @Nonnull final BGPTableTypeRegistryConsumer bgpTableTypeRegistry) {
final Optional<Class<? extends AfiSafiType>> afiSafi = bgpTableTypeRegistry.getAfiSafiType(tablesKey);
if (!afiSafi.isPresent()) {
return null;
}
return new AfiSafiBuilder().setAfiSafiName(afiSafi.get())
- .setState(buildAfiSafiState(neighbor, tablesKey, neighbor.isAfiSafiSupported(tablesKey)))
- .setGracefulRestart(buildAfiSafiGracefulRestartState(neighbor, tablesKey)).build();
+ .setState(buildAfiSafiState(neighbor, tablesKey, neighbor.isAfiSafiSupported(tablesKey)))
+ .setGracefulRestart(buildAfiSafiGracefulRestartState(neighbor, tablesKey)).build();
}
- private static org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.
- safi.list.afi.safi.State buildAfiSafiState(@Nonnull final BGPAfiSafiState neighbor,
- @Nonnull final TablesKey tablesKey, final boolean afiSafiSupported) {
+ private static org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi
+ .safi.list.afi.safi.State buildAfiSafiState(@Nonnull final BGPAfiSafiState neighbor,
+ @Nonnull final TablesKey tablesKey, final boolean afiSafiSupported) {
final NeighborAfiSafiStateAugmentationBuilder builder = new NeighborAfiSafiStateAugmentationBuilder();
builder.setActive(afiSafiSupported);
if (afiSafiSupported) {
builder.setPrefixes(new PrefixesBuilder()
- .setInstalled(neighbor.getPrefixesInstalledCount(tablesKey))
- .setReceived(neighbor.getPrefixesReceivedCount(tablesKey))
- .setSent(neighbor.getPrefixesSentCount(tablesKey)).build());
+ .setInstalled(neighbor.getPrefixesInstalledCount(tablesKey))
+ .setReceived(neighbor.getPrefixesReceivedCount(tablesKey))
+ .setSent(neighbor.getPrefixesSentCount(tablesKey)).build());
}
return new org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi
- .safi.list.afi.safi.StateBuilder().addAugmentation(NeighborAfiSafiStateAugmentation.class, builder.build()).build();
+ .safi.list.afi.safi.StateBuilder().addAugmentation(NeighborAfiSafiStateAugmentation.class,
+ builder.build()).build();
}
private static org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi
- .safi.list.afi.safi.GracefulRestart buildAfiSafiGracefulRestartState(@Nonnull final BGPGracelfulRestartState neighbor,
- @Nonnull final TablesKey tablesKey) {
+ .safi.list.afi.safi.GracefulRestart buildAfiSafiGracefulRestartState(
+ @Nonnull final BGPGracelfulRestartState neighbor, @Nonnull final TablesKey tablesKey) {
final NeighborAfiSafiGracefulRestartStateAugmentation builder =
- new NeighborAfiSafiGracefulRestartStateAugmentationBuilder()
- .setAdvertised(neighbor.isGracefulRestartAdvertized(tablesKey))
- .setReceived(neighbor.isGracefulRestartReceived(tablesKey)).build();
+ new NeighborAfiSafiGracefulRestartStateAugmentationBuilder()
+ .setAdvertised(neighbor.isGracefulRestartAdvertized(tablesKey))
+ .setReceived(neighbor.isGracefulRestartReceived(tablesKey)).build();
return new org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi
- .safi.list.afi.safi.GracefulRestartBuilder().setState(new org.opendaylight.yang.gen.v1.http.openconfig
- .net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi.list.afi.safi.graceful.restart.StateBuilder()
- .addAugmentation(NeighborAfiSafiGracefulRestartStateAugmentation.class, builder).build()).build();
+ .safi.list.afi.safi.GracefulRestartBuilder().setState(new org.opendaylight.yang.gen.v1.http.openconfig
+ .net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi.list.afi.safi.graceful.restart.StateBuilder()
+ .addAugmentation(NeighborAfiSafiGracefulRestartStateAugmentation.class, builder).build()).build();
}
/**
- * Builds List of BgpCapability supported capabilities
+ * Builds List of BgpCapability supported capabilities.
*
* @return List containing supported capabilities
*/
@Nonnull
- public static List<Class<? extends BgpCapability>> buildSupportedCapabilities(@Nonnull final BGPSessionState neighbor) {
+ public static List<Class<? extends BgpCapability>> buildSupportedCapabilities(
+ @Nonnull final BGPSessionState neighbor) {
final List<Class<? extends BgpCapability>> supportedCapabilities = new ArrayList<>();
if (neighbor.isAddPathCapabilitySupported()) {
supportedCapabilities.add(ADDPATHS.class);
}
/**
- * Build Openconfig PeerGroups containing Peer group stats from a list of BGPPeerGroupState
+ * Build Openconfig PeerGroups containing Peer group stats from a list of BGPPeerGroupState.
*
* @param bgpStateConsumer providing BGPPeerGroupState
* @return PeerGroups containing Peer group stats
@Nullable
public static PeerGroups buildPeerGroups(@Nonnull final List<BGPPeerState> bgpStateConsumer) {
final Map<String, List<BGPPeerState>> peerGroups = bgpStateConsumer.stream()
- .filter(state -> state.getGroupId() != null)
- .collect(Collectors.groupingBy(BGPPeerState::getGroupId));
+ .filter(state -> state.getGroupId() != null)
+ .collect(Collectors.groupingBy(BGPPeerState::getGroupId));
if (peerGroups.isEmpty()) {
return null;
}
final List<PeerGroup> peerGroupsList = peerGroups.entrySet().stream()
- .map(entry -> buildPeerGroupState(entry.getKey(), entry.getValue()))
- .collect(Collectors.toList());
+ .map(entry -> buildPeerGroupState(entry.getKey(), entry.getValue()))
+ .collect(Collectors.toList());
return new PeerGroupsBuilder().setPeerGroup(peerGroupsList).build();
}
/**
- * Build Openconfig PeerGroup containing Peer group stats from BGPPeerGroupState
+ * Build Openconfig PeerGroup containing Peer group stats from BGPPeerGroupState.
*
* @param groupId Peer group Id
- * @param groups providing state of the group
+ * @param groups providing state of the group
* @return PeerGroups containing Peer group stats
*/
@Nonnull
public static PeerGroup buildPeerGroupState(@Nonnull final String groupId, @Nonnull List<BGPPeerState> groups) {
final PeerGroupStateAugmentation groupState = new PeerGroupStateAugmentationBuilder()
- .setTotalPrefixes(groups.stream().mapToLong(BGPPeerState::getTotalPrefixes).sum())
- .setTotalPaths(groups.stream().mapToLong(BGPPeerState::getTotalPathsCount).sum())
- .build();
+ .setTotalPrefixes(groups.stream().mapToLong(BGPPeerState::getTotalPrefixes).sum())
+ .setTotalPaths(groups.stream().mapToLong(BGPPeerState::getTotalPathsCount).sum())
+ .build();
return new PeerGroupBuilder()
- .setPeerGroupName(groupId)
- .setState(new org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.neighbor.group.
- StateBuilder().addAugmentation(PeerGroupStateAugmentation.class, groupState).build()).build();
+ .setPeerGroupName(groupId)
+ .setState(new org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.neighbor.group
+ .StateBuilder().addAugmentation(PeerGroupStateAugmentation.class, groupState).build()).build();
}
}
private ScheduledFuture<?> scheduleTask;
public StateProviderImpl(@Nonnull final DataBroker dataBroker, final int timeout,
- @Nonnull final BGPTableTypeRegistryConsumer bgpTableTypeRegistry, @Nonnull final BGPStateConsumer stateCollector,
- @Nonnull final String networkInstanceName) {
+ @Nonnull final BGPTableTypeRegistryConsumer bgpTableTypeRegistry,
+ @Nonnull final BGPStateConsumer stateCollector,
+ @Nonnull final String networkInstanceName) {
this.dataBroker = requireNonNull(dataBroker);
this.bgpTableTypeRegistry = requireNonNull(bgpTableTypeRegistry);
this.stateCollector = requireNonNull(stateCollector);
this.networkInstanceIId = InstanceIdentifier.create(NetworkInstances.class)
- .child(NetworkInstance.class, new NetworkInstanceKey(networkInstanceName));
+ .child(NetworkInstance.class, new NetworkInstanceKey(networkInstanceName));
this.timeout = timeout;
}
this.transactionChain = this.dataBroker.createTransactionChain(this);
final TimerTask task = new TimerTask() {
@Override
+ @SuppressWarnings("checkstyle:IllegalCatch")
public void run() {
synchronized (StateProviderImpl.this) {
final WriteTransaction wTx = StateProviderImpl.this.transactionChain.newWriteOnlyTransaction();
};
this.scheduleTask = GlobalEventExecutor.INSTANCE.scheduleAtFixedRate(task, 0, this.timeout,
- TimeUnit.SECONDS);
+ TimeUnit.SECONDS);
}
- private synchronized void updateBGPStats(final WriteTransaction wTx) {
+ private synchronized void updateBGPStats(final WriteTransaction wtx) {
final Set<String> oldStats = new HashSet<>(this.instanceIdentifiersCache.keySet());
this.stateCollector.getRibStats().stream().filter(BGPRIBState::isActive).forEach(bgpStateConsumer -> {
final KeyedInstanceIdentifier<Rib, RibKey> ribId = bgpStateConsumer.getInstanceIdentifier();
final List<BGPPeerState> peerStats = this.stateCollector.getPeerStats().stream()
.filter(BGPPeerState::isActive).filter(peerState -> ribId.equals(peerState.getInstanceIdentifier()))
.collect(Collectors.toList());
- storeOperationalState(bgpStateConsumer, peerStats, ribId.getKey().getId().getValue(), wTx);
+ storeOperationalState(bgpStateConsumer, peerStats, ribId.getKey().getId().getValue(), wtx);
oldStats.remove(ribId.getKey().getId().getValue());
});
- oldStats.forEach(ribId -> removeStoredOperationalState(ribId, wTx));
+ oldStats.forEach(ribId -> removeStoredOperationalState(ribId, wtx));
}
- private synchronized void removeStoredOperationalState(final String ribId, final WriteTransaction wTx) {
+ private synchronized void removeStoredOperationalState(final String ribId, final WriteTransaction wtx) {
final InstanceIdentifier<Bgp> bgpIID = this.instanceIdentifiersCache.remove(ribId);
- wTx.delete(LogicalDatastoreType.OPERATIONAL, bgpIID);
+ wtx.delete(LogicalDatastoreType.OPERATIONAL, bgpIID);
}
private synchronized void storeOperationalState(final BGPRIBState bgpStateConsumer,
- final List<BGPPeerState> peerStats, final String ribId, final WriteTransaction wTx) {
+ final List<BGPPeerState> peerStats, final String ribId, final WriteTransaction wtx) {
final Global global = GlobalUtil.buildGlobal(bgpStateConsumer, this.bgpTableTypeRegistry);
final PeerGroups peerGroups = PeerGroupUtil.buildPeerGroups(peerStats);
final Neighbors neighbors = NeighborUtil.buildNeighbors(peerStats, this.bgpTableTypeRegistry);
InstanceIdentifier<Bgp> bgpIID = this.instanceIdentifiersCache.get(ribId);
if (bgpIID == null) {
final ProtocolKey protocolKey = new ProtocolKey(BGP.class, bgpStateConsumer.getInstanceIdentifier()
- .getKey().getId().getValue());
+ .getKey().getId().getValue());
final KeyedInstanceIdentifier<Protocol, ProtocolKey> protocolIId = this.networkInstanceIId
- .child(Protocols.class).child(Protocol.class, protocolKey);
+ .child(Protocols.class).child(Protocol.class, protocolKey);
bgpIID = protocolIId.augmentation(Protocol1.class).child(Bgp.class);
this.instanceIdentifiersCache.put(ribId, bgpIID);
}
final Bgp bgp = new BgpBuilder().setGlobal(global).setNeighbors(neighbors).setPeerGroups(peerGroups).build();
- wTx.put(LogicalDatastoreType.OPERATIONAL, bgpIID, bgp, WriteTransaction.CREATE_MISSING_PARENTS);
+ wtx.put(LogicalDatastoreType.OPERATIONAL, bgpIID, bgp, WriteTransaction.CREATE_MISSING_PARENTS);
}
@Override
@Override
public void onTransactionChainFailed(final TransactionChain<?, ?> chain, final AsyncTransaction<?, ?> transaction,
- final Throwable cause) {
+ final Throwable cause) {
LOG.error("Transaction chain failed {}.", transaction != null ? transaction.getIdentifier() : null, cause);
}
import static org.mockito.Mockito.doReturn;
import static org.opendaylight.protocol.bgp.state.StateProviderImplTest.TABLES_KEY;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
import java.util.Optional;
import org.junit.Before;
import org.junit.Test;
doReturn(Optional.empty()).when(this.tableRegistry).getAfiSafiType(Mockito.eq(TABLES_KEY));
}
- @Test(expected = UnsupportedOperationException.class)
- public void testGlobalUtilPrivateConstructor() throws Throwable {
- final Constructor<GlobalUtil> c = GlobalUtil.class.getDeclaredConstructor();
- c.setAccessible(true);
- try {
- c.newInstance();
- } catch (final InvocationTargetException e) {
- throw e.getCause();
- }
- }
-
@Test
public void testNonSupportedAfiSafi() {
assertNull(GlobalUtil.buildAfiSafi(this.ribState, TABLES_KEY, this.tableRegistry));
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.doReturn;
import static org.opendaylight.protocol.bgp.state.StateProviderImplTest.TABLES_KEY;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
import java.util.Collections;
import java.util.Optional;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
-import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryConsumer;
import org.opendaylight.protocol.bgp.rib.spi.State;
doReturn(false).when(this.sessionState).isAsn32CapabilitySupported();
doReturn(false).when(this.sessionState).isAddPathCapabilitySupported();
doReturn(this.state).when(this.sessionState).getSessionState();
- Mockito.doAnswer(invocation -> NeighborUtilTest.this.state).when(this.sessionState).getSessionState();
+ doAnswer(invocation -> NeighborUtilTest.this.state).when(this.sessionState).getSessionState();
doReturn(Collections.singleton(TABLES_KEY)).when(this.bgpAfiSafiState).getAfiSafisAdvertized();
doReturn(Collections.singleton(TABLES_KEY)).when(this.bgpAfiSafiState).getAfiSafisReceived();
- Mockito.doAnswer(invocation -> NeighborUtilTest.this.afiSafi).when(this.tableRegistry).getAfiSafiType(eq(TABLES_KEY));
+ doAnswer(invocation -> NeighborUtilTest.this.afiSafi).when(this.tableRegistry).getAfiSafiType(eq(TABLES_KEY));
doReturn(false).when(this.bgpAfiSafiState).isAfiSafiSupported(eq(TABLES_KEY));
doReturn(false).when(this.bgpAfiSafiState).isGracefulRestartAdvertized(eq(TABLES_KEY));
doReturn(false).when(this.bgpAfiSafiState).isGracefulRestartReceived(eq(TABLES_KEY));
}
- @Test(expected = UnsupportedOperationException.class)
- public void testNeighborUtilPrivateConstructor() throws Throwable {
- final Constructor<NeighborUtil> c = NeighborUtil.class.getDeclaredConstructor();
- c.setAccessible(true);
- try {
- c.newInstance();
- } catch (final InvocationTargetException e) {
- throw e.getCause();
- }
- }
-
@Test
public void testBuildCapabilityState() {
final NeighborStateAugmentationBuilder expected = new NeighborStateAugmentationBuilder()
- .setSupportedCapabilities(Collections.emptyList())
- .setSessionState(SessionState.IDLE);
+ .setSupportedCapabilities(Collections.emptyList())
+ .setSessionState(SessionState.IDLE);
assertEquals(expected.build(), NeighborUtil.buildCapabilityState(this.sessionState));
this.state = State.OPEN_CONFIRM;
@Test
public void buildAfisSafisState() {
assertEquals(Collections.emptyList(),
- NeighborUtil.buildAfisSafisState(this.bgpAfiSafiState, this.tableRegistry));
+ 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();
+ .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();
+ .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();
+ .setState(afiSafiState)
+ .setGracefulRestart(graceful).build();
assertEquals(Collections.singletonList(expected),
- NeighborUtil.buildAfisSafisState(this.bgpAfiSafiState, this.tableRegistry));
+ NeighborUtil.buildAfisSafisState(this.bgpAfiSafiState, this.tableRegistry));
}
}
\ No newline at end of file
import static org.junit.Assert.assertNull;
import static org.mockito.Mockito.doReturn;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
import java.util.Collections;
import org.junit.Before;
import org.junit.Test;
doReturn(null).when(this.bgpPeerState).getGroupId();
}
- @Test(expected = UnsupportedOperationException.class)
- public void testPeerGroupUtilPrivateConstructor() throws Throwable {
- final Constructor<PeerGroupUtil> c = PeerGroupUtil.class.getDeclaredConstructor();
- c.setAccessible(true);
- try {
- c.newInstance();
- } catch (final InvocationTargetException e) {
- throw e.getCause();
- }
- }
-
@Test
public void testNoneGroup() {
assertNull(PeerGroupUtil.buildPeerGroups(Collections.singletonList(this.bgpPeerState)));
package org.opendaylight.protocol.bgp.state;
+import static org.junit.Assert.assertEquals;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.doReturn;
import static org.opendaylight.protocol.util.CheckUtil.checkNotPresentOperational;
import static org.opendaylight.protocol.util.CheckUtil.readDataOperational;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
-import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.opendaylight.controller.md.sal.binding.test.AbstractConcurrentDataBrokerTest;
import org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryConsumer;
doReturn(this.as).when(this.bgpRibState).getAs();
doReturn(this.bgpId).when(this.bgpRibState).getRouteId();
- Mockito.doAnswer(invocation -> this.totalPathsCounter.longValue()).when(this.bgpRibState).getTotalPathsCount();
- Mockito.doAnswer(invocation -> this.totalPrefixesCounter.longValue()).when(this.bgpRibState).getTotalPrefixesCount();
- Mockito.doAnswer(invocation -> this.totalPathsCounter.longValue()).when(this.bgpRibState).getPathCount(eq(TABLES_KEY));
- Mockito.doAnswer(invocation -> this.totalPrefixesCounter.longValue()).when(this.bgpRibState).getPrefixesCount(eq(TABLES_KEY));
- Mockito.doAnswer(invocation -> Collections.singletonMap(TABLES_KEY,
+ doAnswer(invocation -> this.totalPathsCounter.longValue())
+ .when(this.bgpRibState).getTotalPathsCount();
+ doAnswer(invocation -> this.totalPrefixesCounter.longValue())
+ .when(this.bgpRibState).getTotalPrefixesCount();
+ doAnswer(invocation -> this.totalPathsCounter.longValue())
+ .when(this.bgpRibState).getPathCount(eq(TABLES_KEY));
+ doAnswer(invocation -> this.totalPrefixesCounter.longValue())
+ .when(this.bgpRibState).getPrefixesCount(eq(TABLES_KEY));
+ doAnswer(invocation -> Collections.singletonMap(TABLES_KEY,
this.totalPrefixesCounter.longValue())).when(this.bgpRibState).getPrefixesCount();
- Mockito.doAnswer(invocation -> Collections.singletonMap(TABLES_KEY,
+ doAnswer(invocation -> Collections.singletonMap(TABLES_KEY,
this.totalPathsCounter.longValue())).when(this.bgpRibState).getPathsCount();
// Mock Peer
doReturn("test-group").when(this.bgpPeerState).getGroupId();
doReturn(iid).when(this.bgpPeerState).getInstanceIdentifier();
- Mockito.doAnswer(invocation -> this.totalPrefixesCounter.longValue()).when(this.bgpPeerState).getTotalPrefixes();
- Mockito.doAnswer(invocation -> this.totalPathsCounter.longValue()).when(this.bgpPeerState).getTotalPathsCount();
+ doAnswer(invocation -> this.totalPrefixesCounter.longValue()).when(this.bgpPeerState).getTotalPrefixes();
+ doAnswer(invocation -> this.totalPathsCounter.longValue()).when(this.bgpPeerState).getTotalPathsCount();
doReturn(this.neighborAddress).when(this.bgpPeerState).getNeighborAddress();
doReturn(this.bgpSessionState).when(this.bgpPeerState).getBGPSessionState();
doReturn(this.bgpPeerMessagesState).when(this.bgpPeerState).getBGPPeerMessagesState();
this.bgpRibStates.add(this.bgpRibState);
readDataOperational(getDataBroker(), this.bgpInstanceIdentifier, bgpRib -> {
final Global global = bgpRib.getGlobal();
- Assert.assertEquals(globalExpected, global);
+ assertEquals(globalExpected, global);
return bgpRib;
});
final Global globalExpected2 = buildGlobalExpected(1);
readDataOperational(getDataBroker(), this.bgpInstanceIdentifier, bgpRib -> {
final Global global = bgpRib.getGlobal();
- Assert.assertEquals(globalExpected2, global);
+ assertEquals(globalExpected2, global);
return bgpRib;
});
final Global globalExpected3 = buildGlobalExpected(0);
readDataOperational(getDataBroker(), this.bgpInstanceIdentifier, bgpRib -> {
final Global global = bgpRib.getGlobal();
- Assert.assertEquals(globalExpected3, global);
+ assertEquals(globalExpected3, global);
Assert.assertNull(bgpRib.getNeighbors());
Assert.assertNull(bgpRib.getPeerGroups());
return bgpRib;
readDataOperational(getDataBroker(), this.bgpInstanceIdentifier, bgpRib -> {
final Neighbors neighbors = bgpRib.getNeighbors();
Assert.assertNotNull(neighbors);
- Assert.assertEquals(peerGroupExpected, bgpRib.getPeerGroups().getPeerGroup().get(0));
+ assertEquals(peerGroupExpected, bgpRib.getPeerGroups().getPeerGroup().get(0));
final Neighbor neighborResult = neighbors.getNeighbor().get(0);
- Assert.assertEquals(this.neighborAddress, neighborResult.getNeighborAddress());
- Assert.assertEquals(expectedAfiSafis, neighborResult.getAfiSafis());
- Assert.assertEquals(expectedErrorHandling, neighborResult.getErrorHandling());
- Assert.assertEquals(expectedGracefulRestart, neighborResult.getGracefulRestart());
- Assert.assertEquals(expectedTransport, neighborResult.getTransport());
- Assert.assertEquals(expectedTimers, neighborResult.getTimers());
- final org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.neighbor.group.State stateResult =
- neighborResult.getState();
- Assert.assertEquals(expectedBgpNeighborState, stateResult.getAugmentation(BgpNeighborStateAugmentation.class));
- Assert.assertEquals(BgpNeighborState.SessionState.ESTABLISHED, stateResult
+ assertEquals(this.neighborAddress, neighborResult.getNeighborAddress());
+ assertEquals(expectedAfiSafis, neighborResult.getAfiSafis());
+ assertEquals(expectedErrorHandling, neighborResult.getErrorHandling());
+ assertEquals(expectedGracefulRestart, neighborResult.getGracefulRestart());
+ assertEquals(expectedTransport, neighborResult.getTransport());
+ assertEquals(expectedTimers, neighborResult.getTimers());
+ final org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.neighbor.group
+ .State stateResult = neighborResult.getState();
+ assertEquals(expectedBgpNeighborState, stateResult.getAugmentation(BgpNeighborStateAugmentation.class));
+ assertEquals(BgpNeighborState.SessionState.ESTABLISHED, stateResult
.getAugmentation(NeighborStateAugmentation.class).getSessionState());
final List<Class<? extends BgpCapability>> supportedCapabilitiesResult = stateResult
.getAugmentation(NeighborStateAugmentation.class).getSupportedCapabilities();
private static ErrorHandling buildErrorHandling() {
final ErrorHandling errorHandling = new ErrorHandlingBuilder().setState(
- new org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.neighbor.group.error.handling.
- StateBuilder().setTreatAsWithdraw(false)
+ new org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.neighbor.group.error
+ .handling.StateBuilder().setTreatAsWithdraw(false)
.addAugmentation(NeighborErrorHandlingStateAugmentation.class,
- new NeighborErrorHandlingStateAugmentationBuilder().setErroneousUpdateMessages(1L).build()).build())
- .build();
+ new NeighborErrorHandlingStateAugmentationBuilder()
+ .setErroneousUpdateMessages(1L).build()).build()).build();
return errorHandling;
}
private static Timers buildTimers() {
- final Timers timers = new TimersBuilder().setState(new org.opendaylight.yang.gen.v1.http.openconfig.net.yang.
- bgp.rev151009.bgp.neighbor.group.timers.StateBuilder()
+ final Timers timers = new TimersBuilder().setState(new org.opendaylight.yang.gen.v1.http.openconfig.net.yang
+ .bgp.rev151009.bgp.neighbor.group.timers.StateBuilder()
.setConnectRetry(BigDecimal.valueOf(30))
.setHoldTime(BigDecimal.valueOf(90))
.setKeepaliveInterval(BigDecimal.valueOf(30))
return gracefulRestart;
}
- private Global buildGlobalExpected(final long PrefixesAndPaths) {
+ private Global buildGlobalExpected(final long prefixesAndPaths) {
return new GlobalBuilder()
- .setState(new org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.global.base.
- StateBuilder().setRouterId(new Ipv4Address(this.bgpId.getValue())).setTotalPrefixes(PrefixesAndPaths)
- .setTotalPaths(PrefixesAndPaths).setAs(this.as).build())
- .setAfiSafis(new org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.global.base.
- AfiSafisBuilder().setAfiSafi(Collections.singletonList(new AfiSafiBuilder()
- .setAfiSafiName(IPV4UNICAST.class).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(GlobalAfiSafiStateAugmentation.class, new GlobalAfiSafiStateAugmentationBuilder()
- .setTotalPaths(PrefixesAndPaths).setTotalPrefixes(PrefixesAndPaths).build()).build()).build()))
- .build()).build();
+ .setState(new org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.global.base
+ .StateBuilder().setRouterId(new Ipv4Address(this.bgpId.getValue()))
+ .setTotalPrefixes(prefixesAndPaths).setTotalPaths(prefixesAndPaths).setAs(this.as).build())
+ .setAfiSafis(new org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.global.base
+ .AfiSafisBuilder().setAfiSafi(Collections.singletonList(new AfiSafiBuilder()
+ .setAfiSafiName(IPV4UNICAST.class).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(GlobalAfiSafiStateAugmentation.class,
+ new GlobalAfiSafiStateAugmentationBuilder()
+ .setTotalPaths(prefixesAndPaths).setTotalPrefixes(prefixesAndPaths)
+ .build()).build()).build()))
+ .build()).build();
}
private static PeerGroup buildGroupExpected() {