import java.util.stream.Collectors;
import javax.annotation.Nonnull;
import org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryConsumer;
-import org.opendaylight.protocol.bgp.rib.spi.state.BGPRIBState;
+import org.opendaylight.protocol.bgp.rib.spi.state.BGPRibState;
import org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi.list.AfiSafi;
import org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi.list.AfiSafiBuilder;
import org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi.list.afi.safi.State;
* @return Global containing state
*/
@Nonnull
- public static Global buildGlobal(final BGPRIBState ribState,
+ public static Global buildGlobal(final BGPRibState ribState,
final BGPTableTypeRegistryConsumer bgpTableTypeRegistry) {
return new GlobalBuilder().setState(buildState(ribState))
.setAfiSafis(new AfiSafisBuilder().setAfiSafi(buildAfisSafis(ribState, bgpTableTypeRegistry)).build())
* @param bgpTableTypeRegistry BGP TableType Registry
* @return List containing per afi/safi operational state
*/
- public static List<AfiSafi> buildAfisSafis(final BGPRIBState ribState,
+ public static List<AfiSafi> buildAfisSafis(final BGPRibState ribState,
final BGPTableTypeRegistryConsumer bgpTableTypeRegistry) {
return ribState.getPathsCount().keySet().stream()
.map(tk -> buildAfiSafi(ribState, tk, bgpTableTypeRegistry))
* @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) {
+ .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())
* @param bgpTableTypeRegistry BGP TableType Registry
* @return Afi Safi Operational State
*/
- public static AfiSafi buildAfiSafi(final BGPRIBState ribState, final TablesKey tablesKey,
+ public static AfiSafi buildAfiSafi(final BGPRibState ribState, final TablesKey tablesKey,
final BGPTableTypeRegistryConsumer bgpTableTypeRegistry) {
final Optional<Class<? extends AfiSafiType>> optAfiSafi = bgpTableTypeRegistry.getAfiSafiType(tablesKey);
if (!optAfiSafi.isPresent()) {
import org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener;
import org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryConsumer;
import org.opendaylight.protocol.bgp.rib.spi.state.BGPPeerState;
-import org.opendaylight.protocol.bgp.rib.spi.state.BGPRIBState;
+import org.opendaylight.protocol.bgp.rib.spi.state.BGPRibState;
import org.opendaylight.protocol.bgp.rib.spi.state.BGPStateConsumer;
import org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.top.Bgp;
import org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.top.BgpBuilder;
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 -> {
+ 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()))
wtx.delete(LogicalDatastoreType.OPERATIONAL, bgpIID);
}
- private synchronized void storeOperationalState(final BGPRIBState bgpStateConsumer,
+ private synchronized void storeOperationalState(final BGPRibState bgpStateConsumer,
final List<BGPPeerState> peerStats, final String ribId, final WriteTransaction wtx) {
final Global global = GlobalUtil.buildGlobal(bgpStateConsumer, this.bgpTableTypeRegistry);
final PeerGroups peerGroups = PeerGroupUtil.buildPeerGroups(peerStats);
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryConsumer;
-import org.opendaylight.protocol.bgp.rib.spi.state.BGPRIBState;
+import org.opendaylight.protocol.bgp.rib.spi.state.BGPRibState;
public class GlobalUtilTest {
@Mock
- private BGPRIBState ribState;
+ private BGPRibState ribState;
@Mock
private BGPTableTypeRegistryConsumer tableRegistry;
import org.opendaylight.protocol.bgp.rib.spi.state.BGPGracelfulRestartState;
import org.opendaylight.protocol.bgp.rib.spi.state.BGPPeerMessagesState;
import org.opendaylight.protocol.bgp.rib.spi.state.BGPPeerState;
-import org.opendaylight.protocol.bgp.rib.spi.state.BGPRIBState;
+import org.opendaylight.protocol.bgp.rib.spi.state.BGPRibState;
import org.opendaylight.protocol.bgp.rib.spi.state.BGPSessionState;
import org.opendaylight.protocol.bgp.rib.spi.state.BGPStateConsumer;
import org.opendaylight.protocol.bgp.rib.spi.state.BGPTimersState;
@Mock
private BGPTableTypeRegistryConsumer tableTypeRegistry;
@Mock
- private BGPRIBState bgpRibState;
+ private BGPRibState bgpRibState;
@Mock
private BGPPeerState bgpPeerState;
@Mock
private BGPAfiSafiState bgpAfiSafiState;
private final List<BGPPeerState> bgpPeerStates = new ArrayList<>();
- private final List<BGPRIBState> bgpRibStates = new ArrayList<>();
+ private final List<BGPRibState> bgpRibStates = new ArrayList<>();
@Before
public void setUp() throws Exception {
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();
+ this.totalPrefixesCounter.longValue())).when(this.bgpRibState).getTablesPrefixesCount();
doAnswer(invocation -> Collections.singletonMap(TABLES_KEY,
this.totalPathsCounter.longValue())).when(this.bgpRibState).getPathsCount();
import org.opendaylight.protocol.bgp.rib.spi.BGPPeerTracker;
import org.opendaylight.protocol.bgp.rib.spi.RIBExtensionConsumerContext;
import org.opendaylight.protocol.bgp.rib.spi.policy.BGPRibRoutingPolicy;
-import org.opendaylight.protocol.bgp.rib.spi.state.BGPRIBState;
-import org.opendaylight.protocol.bgp.rib.spi.state.BGPRIBStateConsumer;
+import org.opendaylight.protocol.bgp.rib.spi.state.BGPRibState;
+import org.opendaylight.protocol.bgp.rib.spi.state.BGPRibStateConsumer;
import org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi.list.AfiSafi;
import org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.global.base.Config;
import org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.top.bgp.Global;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public final class RibImpl implements RIB, BGPRIBStateConsumer, AutoCloseable {
+public final class RibImpl implements RIB, BGPRibStateConsumer, AutoCloseable {
private static final Logger LOG = LoggerFactory.getLogger(RibImpl.class);
}
@Override
- public BGPRIBState getRIBState() {
+ public BGPRibState getRIBState() {
return this.ribImpl.getRIBState();
}
import java.util.stream.Collectors;
import org.opendaylight.protocol.bgp.rib.RibReference;
import org.opendaylight.protocol.bgp.rib.spi.state.BGPPeerStateConsumer;
-import org.opendaylight.protocol.bgp.rib.spi.state.BGPRIBStateConsumer;
+import org.opendaylight.protocol.bgp.rib.spi.state.BGPRibStateConsumer;
public enum InstanceType {
- RIB("ribImpl", ImmutableList.of(RIB.class, RibReference.class, BGPRIBStateConsumer.class)),
+ RIB("ribImpl", ImmutableList.of(RIB.class, RibReference.class, BGPRibStateConsumer.class)),
PEER("bgpPeer", ImmutableList.of(BGPPeerStateConsumer.class)),
import org.opendaylight.protocol.bgp.rib.DefaultRibReference;
import org.opendaylight.protocol.bgp.rib.impl.state.rib.TotalPathsCounter;
import org.opendaylight.protocol.bgp.rib.impl.state.rib.TotalPrefixesCounter;
-import org.opendaylight.protocol.bgp.rib.spi.state.BGPRIBState;
-import org.opendaylight.protocol.bgp.rib.spi.state.BGPRIBStateConsumer;
+import org.opendaylight.protocol.bgp.rib.spi.state.BGPRibState;
+import org.opendaylight.protocol.bgp.rib.spi.state.BGPRibStateConsumer;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.AsNumber;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.bgp.rib.Rib;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.bgp.rib.RibKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.BgpId;
import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
-public class BGPRIBStateImpl extends DefaultRibReference implements BGPRIBState, BGPRIBStateConsumer {
+public class BGPRIBStateImpl extends DefaultRibReference implements BGPRibState, BGPRibStateConsumer {
private final BgpId routeId;
private final AsNumber localAs;
@GuardedBy("this")
}
@Override
- public final synchronized Map<TablesKey, Long> getPrefixesCount() {
+ public final synchronized Map<TablesKey, Long> getTablesPrefixesCount() {
return this.totalPrefixes.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey,
(entry) -> entry.getValue().getPrefixesCount()));
}
}
@Override
- public final BGPRIBState getRIBState() {
+ public final BGPRibState getRIBState() {
return this;
}
}
import javax.annotation.concurrent.ThreadSafe;
import org.opendaylight.protocol.bgp.rib.spi.state.BGPPeerState;
import org.opendaylight.protocol.bgp.rib.spi.state.BGPPeerStateConsumer;
-import org.opendaylight.protocol.bgp.rib.spi.state.BGPRIBState;
-import org.opendaylight.protocol.bgp.rib.spi.state.BGPRIBStateConsumer;
+import org.opendaylight.protocol.bgp.rib.spi.state.BGPRibState;
+import org.opendaylight.protocol.bgp.rib.spi.state.BGPRibStateConsumer;
import org.opendaylight.protocol.bgp.rib.spi.state.BGPStateConsumer;
import org.opendaylight.protocol.bgp.rib.spi.state.BGPStateProvider;
@ThreadSafe
public class BGPStateCollectorImpl implements BGPStateProvider, BGPStateConsumer {
@GuardedBy("this")
- private final List<BGPRIBStateConsumer> bgpRibStates = new ArrayList<>();
+ private final List<BGPRibStateConsumer> bgpRibStates = new ArrayList<>();
@GuardedBy("this")
private final List<BGPPeerStateConsumer> bgpPeerStates = new ArrayList<>();
@Override
- public List<BGPRIBState> getRibStats() {
+ public List<BGPRibState> getRibStats() {
synchronized (this.bgpRibStates) {
return ImmutableList.copyOf(this.bgpRibStates
.stream()
- .map(BGPRIBStateConsumer::getRIBState)
+ .map(BGPRibStateConsumer::getRIBState)
.filter(Objects::nonNull)
.collect(Collectors.toList()));
}
}
@Override
- public void bind(final BGPRIBStateConsumer bgpState) {
+ public void bind(final BGPRibStateConsumer bgpState) {
if (bgpState == null) {
return;
}
}
@Override
- public void unbind(final BGPRIBStateConsumer bgpState) {
+ public void unbind(final BGPRibStateConsumer bgpState) {
if (bgpState == null) {
return;
}
<bean id="bgpStateCollector" class="org.opendaylight.protocol.bgp.rib.impl.state.BGPStateCollectorImpl"/>
<service ref="bgpStateCollector" interface="org.opendaylight.protocol.bgp.rib.spi.state.BGPStateConsumer"/>
- <reference-list id="ribStatsListener" interface="org.opendaylight.protocol.bgp.rib.spi.state.BGPRIBStateConsumer"
+ <reference-list id="ribStatsListener" interface="org.opendaylight.protocol.bgp.rib.spi.state.BGPRibStateConsumer"
availability="optional">
<reference-listener bind-method="bind" unbind-method="unbind">
<ref component-id="bgpStateCollector"/>
import org.opendaylight.protocol.bgp.rib.spi.state.BGPGracelfulRestartState;
import org.opendaylight.protocol.bgp.rib.spi.state.BGPPeerMessagesState;
import org.opendaylight.protocol.bgp.rib.spi.state.BGPPeerState;
-import org.opendaylight.protocol.bgp.rib.spi.state.BGPRIBState;
+import org.opendaylight.protocol.bgp.rib.spi.state.BGPRibState;
import org.opendaylight.protocol.bgp.rib.spi.state.BGPSessionState;
import org.opendaylight.protocol.bgp.rib.spi.state.BGPTimersState;
import org.opendaylight.protocol.bgp.rib.spi.state.BGPTransportState;
assertFalse(afiSafiStatePeer1.isPeerRestarting());
assertTrue(afiSafiStatePeer1.isAfiSafiSupported(TABLES_KEY));
- final BGPRIBState ribState = this.ribImpl.getRIBState();
+ final BGPRibState ribState = this.ribImpl.getRIBState();
assertEquals(1, ribState.getPathsCount().size());
- assertEquals(1L, ribState.getPrefixesCount().size());
+ assertEquals(1L, ribState.getTablesPrefixesCount().size());
assertEquals(BGP_ID, ribState.getRouteId());
assertEquals(AS_NUMBER, ribState.getAs());
assertEquals(1L, ribState.getPathCount(TABLES_KEY));
import org.mockito.MockitoAnnotations;
import org.opendaylight.protocol.bgp.rib.spi.state.BGPPeerState;
import org.opendaylight.protocol.bgp.rib.spi.state.BGPPeerStateConsumer;
-import org.opendaylight.protocol.bgp.rib.spi.state.BGPRIBState;
-import org.opendaylight.protocol.bgp.rib.spi.state.BGPRIBStateConsumer;
+import org.opendaylight.protocol.bgp.rib.spi.state.BGPRibState;
+import org.opendaylight.protocol.bgp.rib.spi.state.BGPRibStateConsumer;
public class BGPStateCollectorImplTest {
@Mock
- private BGPRIBStateConsumer bgpribStateConsumer;
+ private BGPRibStateConsumer bgpribStateConsumer;
@Mock
private BGPPeerStateConsumer bgpPeerStateConsumer;
@Test
public void getRibStatsTest() throws Exception {
doReturn(mock(BGPPeerState.class)).when(this.bgpPeerStateConsumer).getPeerState();
- doReturn(mock(BGPRIBState.class)).when(this.bgpribStateConsumer).getRIBState();
+ doReturn(mock(BGPRibState.class)).when(this.bgpribStateConsumer).getRIBState();
final BGPStateCollectorImpl collector = new BGPStateCollectorImpl();
- final BGPRIBStateConsumer ribStateConsumerNull = null;
+ final BGPRibStateConsumer ribStateConsumerNull = null;
collector.bind(ribStateConsumerNull);
assertTrue(collector.getRibStats().isEmpty());
@Test
public void getRibStatsEmptyPeerTest() throws Exception {
- doReturn(mock(BGPRIBState.class)).when(this.bgpribStateConsumer).getRIBState();
+ doReturn(mock(BGPRibState.class)).when(this.bgpribStateConsumer).getRIBState();
doReturn(null).when(this.bgpPeerStateConsumer).getPeerState();
final BGPStateCollectorImpl collector = new BGPStateCollectorImpl();
- final BGPRIBStateConsumer ribStateConsumerNull = null;
+ final BGPRibStateConsumer ribStateConsumerNull = null;
collector.bind(ribStateConsumerNull);
assertTrue(collector.getRibStats().isEmpty());
doReturn(null).when(this.bgpribStateConsumer).getRIBState();
doReturn(null).when(this.bgpPeerStateConsumer).getPeerState();
final BGPStateCollectorImpl collector = new BGPStateCollectorImpl();
- final BGPRIBStateConsumer ribStateConsumerNull = null;
+ final BGPRibStateConsumer ribStateConsumerNull = null;
collector.bind(ribStateConsumerNull);
assertTrue(collector.getRibStats().isEmpty());
</execution>
</executions>
</plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-checkstyle-plugin</artifactId>
- <configuration>
- <propertyExpansion>checkstyle.violationSeverity=warning</propertyExpansion>
- </configuration>
- </plugin>
</plugins>
</build>
this.listClass = requireNonNull(listClass);
this.routeQname = QName.create(qname, BindingReflections.findQName(listClass).intern().getLocalName());
this.routesListIdentifier = new NodeIdentifier(this.routeQname);
- this.emptyRoutes = Builders.choiceBuilder().withNodeIdentifier(ROUTES).addChild(Builders.containerBuilder()
- .withNodeIdentifier(routesContainerIdentifier()).withChild(ImmutableNodes.mapNodeBuilder(this.routeQname)
- .build()).build()).build();
+ this.emptyRoutes = Builders.choiceBuilder().withNodeIdentifier(ROUTES)
+ .addChild(Builders.containerBuilder()
+ .withNodeIdentifier(routesContainerIdentifier())
+ .withChild(ImmutableNodes.mapNodeBuilder(this.routeQname).build()).build()).build();
this.afiClass = afiClass;
this.safiClass = safiClass;
this.destinationNid = new NodeIdentifier(destinationQname);
/**
* Given the destination as ContainerNode, implementation needs to parse the DOM model
* from this point onward:
- * <p>
+ *
* {@code /bgp-mp:mp-unreach-nlri/bgp-mp:withdrawn-routes/bgp-mp:destination-type}
* and delete the routes from its RIBs.
*
/**
* Given the destination as ContainerNode, implementation needs to parse the DOM model
* from this point onward:
- * <p>
+ *
* {@code /bgp-mp:mp-reach-nlri/bgp-mp:advertized-routes/bgp-mp:destination-type}
* and put the routes to its RIBs.
*
package org.opendaylight.protocol.bgp.rib.spi;
import java.util.List;
-import java.util.Map;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.opendaylight.protocol.concepts.AbstractRegistration;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.PeerId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.PeerRole;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.rib.TablesKey;
/**
* Tracks Peers under RIB.
AbstractRegistration registerPeer(@Nonnull Peer peer);
/**
- * Returns Peer
+ * Returns Peer.
*
* @param peerId peer ID
* @return Peer
}
@Override
- public boolean equals(final Object o) {
- return (o instanceof BGPTerminationReason) &&
- Objects.equals(this.error, ((BGPTerminationReason) o).error);
+ public boolean equals(final Object terminationReason) {
+ return (terminationReason instanceof BGPTerminationReason)
+ && Objects.equals(this.error, ((BGPTerminationReason) terminationReason).error);
}
@Override
public interface PeerTrackerInformation {
/**
- * Returns PeerID
+ * Returns Peer id.
*
* @return PeerID
*/
* @param routeKey routeKey Path Argument
* @return new route Key
*/
- default @Nonnull
- NodeIdentifierWithPredicates createRouteKeyPathArgument(@Nonnull NodeIdentifierWithPredicates routeKey) {
+ @Nonnull
+ default NodeIdentifierWithPredicates createRouteKeyPathArgument(@Nonnull NodeIdentifierWithPredicates routeKey) {
return routeKey;
}
}
import javax.annotation.Nonnull;
import org.opendaylight.protocol.bgp.rib.spi.Peer;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.PeerId;
import org.opendaylight.yangtools.yang.binding.Identifier;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
/**
* RouteEntryInfo wrapper contains all related information from new best path.
package org.opendaylight.protocol.bgp.rib.spi.policy;
import javax.annotation.Nonnull;
-import org.opendaylight.protocol.bgp.rib.spi.Peer;
-import org.opendaylight.protocol.bgp.rib.spi.entry.RouteEntryKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.PeerId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.PeerRole;
-import org.opendaylight.yangtools.yang.binding.Identifier;
/**
* Contains Peer destiny information for import route entry.
package org.opendaylight.protocol.bgp.rib.spi.state;
-
import java.util.Map;
import javax.annotation.Nonnull;
import org.opendaylight.protocol.bgp.rib.RibReference;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.BgpId;
/**
- * Representing RIB Operational State information
+ * Representing RIB Operational State information.
* -PeerGroup States.
* Total Paths / Total Prefixes counters, representing the paths / prefixes installed on Loc-rib
*/
-public interface BGPRIBState extends RibReference {
+public interface BGPRibState extends RibReference {
/**
- * Indicates whether this instance is being actively managed and updated
+ * Indicates whether this instance is being actively managed and updated.
*
* @return active
*/
boolean isActive();
/**
- * Prefixes count per tablesKey Type
+ * Prefixes count per tablesKey Type.
*
* @return Prefixes count
*/
@Nonnull
- Map<TablesKey, Long> getPrefixesCount();
+ Map<TablesKey, Long> getTablesPrefixesCount();
/**
- * Mapped Total Paths Count per TableKey
+ * Mapped Total Paths Count per TableKey.
*
* @return Prefixes count
*/
Map<TablesKey, Long> getPathsCount();
/**
- * Total Paths Installed
+ * Total Paths Installed.
*
* @return count
*/
long getTotalPathsCount();
/**
- * Total Prefixes Installed
+ * Total Prefixes Installed.
*
* @return count
*/
long getTotalPrefixesCount();
/**
- * Total Path Installed per specific TableKey
+ * Total Path Installed per specific TableKey.
*
* @param tablesKey table key
* @return count
long getPathCount(TablesKey tablesKey);
/**
- * Total Prefixes Installed per specific TableKey
+ * Total Prefixes Installed per specific TableKey.
*
* @param tablesKey table key
* @return count
long getPrefixesCount(TablesKey tablesKey);
/**
- * AS
+ * AS.
*
* @return as
*/
AsNumber getAs();
/**
- * BGP identifier
+ * BGP identifier.
+ *
* @return BGP identifier
*/
@Nonnull
import javax.annotation.Nonnull;
/**
- * Interface for acquiring BGP RIB State
+ * Interface for acquiring BGP RIB State.
*/
-public interface BGPRIBStateConsumer {
+public interface BGPRibStateConsumer {
/**
- * Returns RIB Operational State
+ * Returns RIB Operational State.
+ *
* @return BGP RIB State
*/
@Nonnull
- BGPRIBState getRIBState();
+ BGPRibState getRIBState();
}
* @return ribs stats
*/
@Nonnull
- List<BGPRIBState> getRibStats();
+ List<BGPRibState> getRibStats();
/**
* List of Registered BGP Peer State.
*
* @param bgpState rib State
*/
- void bind(@Nonnull BGPRIBStateConsumer bgpState);
+ void bind(@Nonnull BGPRibStateConsumer bgpState);
/**
* Unregister Rib state.
*
* @param bgpState Rib/Peer State
*/
- void unbind(@Nonnull BGPRIBStateConsumer bgpState);
+ void unbind(@Nonnull BGPRibStateConsumer bgpState);
/**
* registerRib/Peer state.
private DataTreeCandidateNode subTree;
private DOMDataWriteTransaction tx;
private ContainerNode nlri;
- private Map<YangInstanceIdentifier, NormalizedNode<?, ?>> routes;
+ private Map<YangInstanceIdentifier, NormalizedNode<?, ?>> routesMap;
private ContainerNode attributes;
private MapEntryNode mapEntryNode;
@Before
public void setUp() {
- this.routes = new HashMap<>();
+ this.routesMap = new HashMap<>();
MockitoAnnotations.initMocks(this);
this.emptyTree = Mockito.mock(DataTreeCandidateNode.class);
this.emptySubTree = Mockito.mock(DataTreeCandidateNode.class);
doAnswer(invocation -> {
final Object[] args = invocation.getArguments();
- MultiPathAbstractRIBSupportTest.this.routes.remove(args[1]);
+ MultiPathAbstractRIBSupportTest.this.routesMap.remove(args[1]);
return args[1];
}).when(this.tx).delete(Mockito.eq(LogicalDatastoreType.OPERATIONAL), any(YangInstanceIdentifier.class));
doAnswer(invocation -> {
final Object[] args = invocation.getArguments();
final NormalizedNode<?, ?> node1 = (NormalizedNode<?, ?>) args[2];
- MultiPathAbstractRIBSupportTest.this.routes.put((YangInstanceIdentifier) args[1], node1);
+ MultiPathAbstractRIBSupportTest.this.routesMap.put((YangInstanceIdentifier) args[1], node1);
return args[1];
}).when(this.tx).put(Mockito.eq(LogicalDatastoreType.OPERATIONAL), any(YangInstanceIdentifier.class),
any(NormalizedNode.class));
@Test
public void putRoutes() {
MULTI_PATH_ABSTRACT_TEST.putRoutes(this.tx, LOC_RIB_TARGET, this.nlri, this.attributes);
- assertFalse(this.routes.isEmpty());
+ assertFalse(this.routesMap.isEmpty());
}
@Test
public void deleteRoutes() {
MULTI_PATH_ABSTRACT_TEST.deleteRoutes(this.tx, LOC_RIB_TARGET, this.nlri);
- assertTrue(this.routes.isEmpty());
+ assertTrue(this.routesMap.isEmpty());
}
and is available at http://www.eclipse.org/legal/epl-v10.html
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.opendaylight.mdsal</groupId>
<configuration>
<propertyExpansion>checkstyle.violationSeverity=error</propertyExpansion>
</configuration> -->
- <dependencies>
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>checkstyle-logging</artifactId>
- <version>2.0.2</version>
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>checkstyle-logging</artifactId>
+ <version>2.0.2</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>checkstyle-logging</artifactId>
+ <!-- FIXME: remove this declaration when bumping to 2.0.2 -->
+ <version>2.0.1</version>
+ </dependency>
+ </dependencies>
<configuration>
<propertyExpansion>checkstyle.violationSeverity=error</propertyExpansion>
</configuration>