* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.protocol.bgp.rib.impl.state;
import static java.util.Objects.requireNonNull;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.atomic.LongAdder;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-import javax.annotation.concurrent.GuardedBy;
+import org.checkerframework.checker.lock.qual.GuardedBy;
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
import org.opendaylight.protocol.bgp.rib.DefaultRibReference;
import org.opendaylight.protocol.bgp.rib.impl.spi.BGPMessagesListener;
import org.opendaylight.protocol.bgp.rib.impl.state.peer.PrefixesInstalledCounters;
@GuardedBy("this")
private boolean peerRestarting;
- public BGPPeerStateImpl(@Nonnull final KeyedInstanceIdentifier<Rib, RibKey> instanceIdentifier,
- @Nullable final String groupId, @Nonnull final IpAddress neighborAddress,
- @Nonnull final Set<TablesKey> afiSafisAdvertized,
- @Nonnull final Set<TablesKey> afiSafisGracefulAdvertized,
- @Nonnull final Map<TablesKey, Integer> afiSafisLlGracefulAdvertized) {
+ public BGPPeerStateImpl(final @NonNull KeyedInstanceIdentifier<Rib, RibKey> instanceIdentifier,
+ final @Nullable String groupId, final @NonNull IpAddress neighborAddress,
+ final @NonNull Set<TablesKey> afiSafisAdvertized,
+ final @NonNull Set<TablesKey> afiSafisGracefulAdvertized,
+ final @NonNull Map<TablesKey, Integer> afiSafisLlGracefulAdvertized) {
super(instanceIdentifier);
this.neighborAddress = requireNonNull(neighborAddress);
this.groupId = groupId;
}
@Override
- public final synchronized long getPrefixesSentCount(@Nonnull final TablesKey tablesKey) {
+ public final synchronized long getPrefixesSentCount(final TablesKey tablesKey) {
if (this.prefixesSent == null) {
return 0;
}
return this.peerRestarting;
}
- public final synchronized void setAfiSafiGracefulRestartState(final int peerRestartTime,
- final boolean peerRestarting, final boolean localRestarting) {
- this.peerRestartTime = peerRestartTime;
- this.peerRestarting = peerRestarting;
- this.localRestarting = localRestarting;
+ public final synchronized void setAfiSafiGracefulRestartState(final int newPeerRestartTime,
+ final boolean newPeerRestarting, final boolean newLocalRestarting) {
+ this.peerRestartTime = newPeerRestartTime;
+ this.peerRestarting = newPeerRestarting;
+ this.localRestarting = newLocalRestarting;
}
protected final synchronized void setAdvertizedGracefulRestartTableTypes(final List<TablesKey> receivedGraceful) {
this.prefixesSent.put(tablesKey, prefixesSentCounter);
}
- protected final synchronized void registerPrefixesCounters(@Nonnull final PrefixesReceivedCounters prefixesReceived,
- @Nonnull final PrefixesInstalledCounters prefixesInstalled) {
- this.prefixesReceived = prefixesReceived;
- this.prefixesInstalled = prefixesInstalled;
+ protected final synchronized void registerPrefixesCounters(
+ final @NonNull PrefixesReceivedCounters newPrefixesReceived,
+ final @NonNull PrefixesInstalledCounters newPrefixesInstalled) {
+ this.prefixesReceived = newPrefixesReceived;
+ this.prefixesInstalled = newPrefixesInstalled;
}
protected final synchronized void resetState() {
}
@Override
- public final synchronized int getLlGracefulRestartTimer(@Nonnull final TablesKey tablesKey) {
+ public final synchronized int getLlGracefulRestartTimer(final TablesKey tablesKey) {
final int timerAdvertised = isLlGracefulRestartAdvertised(tablesKey)
? this.afiSafisLlGracefulAdvertised.get(tablesKey) : 0;
final int timerReceived = isLlGracefulRestartReceived(tablesKey)