<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
private RouterIdOffsets offsets = RouterIdOffsets.EMPTY;
private MapEntryNode[] values = EMPTY_VALUES;
- private BaseBestPath bestPath;
+ private BaseBestPath bestPath = null;
private BaseBestPath removedBestPath;
- BaseRouteEntry() {
- }
-
@Override
public boolean removeRoute(final RouterId routerId, final Uint32 remotePathId) {
- final int offset = this.offsets.offsetOf(routerId);
- this.values = this.offsets.removeValue(this.values, offset, EMPTY_VALUES);
- this.offsets = this.offsets.without(routerId);
- return this.offsets.isEmpty();
+ final int offset = offsets.offsetOf(routerId);
+ values = offsets.removeValue(values, offset, EMPTY_VALUES);
+ offsets = offsets.without(routerId);
+ return offsets.isEmpty();
}
private MapEntryNode createRoute(final RIBSupport<C, S> ribSup, final String routeKey) {
- final MapEntryNode route = this.offsets.getValue(this.values, this.offsets.offsetOf(bestPath.getRouterId()));
+ final MapEntryNode route = offsets.getValue(values, offsets.offsetOf(bestPath.getRouterId()));
return ribSup.createRoute(route, ribSup.createRouteListArgument(routeKey), bestPath.getAttributes());
}
final BasePathSelector selector = new BasePathSelector(localAs);
// Select the best route.
- for (int i = 0; i < this.offsets.size(); ++i) {
- final RouterId routerId = this.offsets.getKey(i);
- final ContainerNode attributes = ribSupport.extractAttributes(this.offsets.getValue(this.values, i));
+ for (int i = 0; i < offsets.size(); ++i) {
+ final RouterId routerId = offsets.getKey(i);
+ final ContainerNode attributes = ribSupport.extractAttributes(offsets.getValue(values, i));
LOG.trace("Processing router id {} attributes {}", routerId, attributes);
selector.processPath(routerId, attributes);
}
// Get the newly-selected best path.
final BaseBestPath newBestPath = selector.result();
- final boolean modified = newBestPath == null || !newBestPath.equals(this.bestPath);
+ final boolean modified = newBestPath == null || !newBestPath.equals(bestPath);
if (modified) {
- if (this.offsets.isEmpty()) {
- this.removedBestPath = this.bestPath;
+ if (offsets.isEmpty()) {
+ removedBestPath = bestPath;
}
- LOG.trace("Previous best {}, current best {}", this.bestPath, newBestPath);
- this.bestPath = newBestPath;
+ LOG.trace("Previous best {}, current best {}", bestPath, newBestPath);
+ bestPath = newBestPath;
}
return modified;
}
@Override
public int addRoute(final RouterId routerId, final Uint32 remotePathId, final MapEntryNode route) {
- int offset = this.offsets.offsetOf(routerId);
+ int offset = offsets.offsetOf(routerId);
if (offset < 0) {
- final RouterIdOffsets newOffsets = this.offsets.with(routerId);
+ final RouterIdOffsets newOffsets = offsets.with(routerId);
offset = newOffsets.offsetOf(routerId);
- this.values = newOffsets.expand(this.offsets, this.values, offset);
- this.offsets = newOffsets;
+ values = newOffsets.expand(offsets, values, offset);
+ offsets = newOffsets;
}
- this.offsets.setValue(this.values, offset, route);
+ offsets.setValue(values, offset, route);
LOG.trace("Added route {} from {}", route, routerId);
return offset;
}
@Override
public List<AdvertizedRoute<C, S>> newBestPaths(final RIBSupport<C, S> ribSupport, final String routeKey) {
- if (this.bestPath == null) {
+ if (bestPath == null) {
return Collections.emptyList();
}
final MapEntryNode route = createRoute(ribSupport, routeKey);
- final AdvertizedRoute<C, S> adv = new AdvertizedRoute<>(ribSupport, route, this.bestPath.getAttributes(),
- this.bestPath.getPeerId(), this.bestPath.isDepreferenced());
+ final AdvertizedRoute<C, S> adv = new AdvertizedRoute<>(ribSupport, route, bestPath.getAttributes(),
+ bestPath.getPeerId(), bestPath.isDepreferenced());
LOG.trace("Selected best route {}", route);
return Collections.singletonList(adv);
}
@Override
public List<ActualBestPathRoutes<C, S>> actualBestPaths(final RIBSupport<C, S> ribSupport,
final RouteEntryInfo entryInfo) {
- if (this.bestPath == null) {
+ if (bestPath == null) {
return Collections.emptyList();
}
final MapEntryNode route = createRoute(ribSupport, entryInfo.getRouteKey());
- return Collections.singletonList(new ActualBestPathRoutes<>(ribSupport, route, this.bestPath.getPeerId(),
- this.bestPath.getAttributes(), this.bestPath.isDepreferenced()));
+ return Collections.singletonList(new ActualBestPathRoutes<>(ribSupport, route, bestPath.getPeerId(),
+ bestPath.getAttributes(), bestPath.isDepreferenced()));
}
}
\ No newline at end of file
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>binding-parent</artifactId>
- <version>12.0.3</version>
+ <version>12.0.4</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
import org.slf4j.LoggerFactory;
public final class BmpMockSession extends SimpleChannelInboundHandler<Notification<?>> implements BmpSession {
-
private static final Logger LOG = LoggerFactory.getLogger(BmpMockSession.class);
private static final Ipv4AddressNoZone NEXT_HOP = new Ipv4AddressNoZone("1.1.1.1");
private final int prePolicyRoutesCount;
private final int postPolicyRoutesCount;
- private InetSocketAddress remoteAddress;
- private Channel channel;
+ private InetSocketAddress remoteAddress = null;
+ private Channel channel = null;
public BmpMockSession(final int peersCount, final int prePolicyRoutesCount, final int postPolicyRoutesCount) {
this.peersCount = peersCount;
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>karaf4-parent</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>feature-repo-parent</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>controller-artifacts</artifactId>
- <version>8.0.3</version>
+ <version>8.0.4</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yangtools-artifacts</artifactId>
- <version>11.0.4</version>
+ <version>11.0.5</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-artifacts</artifactId>
- <version>12.0.3</version>
+ <version>12.0.4</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.opendaylight.netconf</groupId>
<artifactId>netconf-artifacts</artifactId>
- <version>6.0.5</version>
+ <version>6.0.6</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.opendaylight.infrautils</groupId>
<artifactId>infrautils-artifacts</artifactId>
- <version>6.0.4</version>
+ <version>6.0.5</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
public class TimerHandler {
private static final Logger LOG = LoggerFactory.getLogger(TimerHandler.class);
- private final int disconnectAfter;
+
private final Timer timer = new HashedWheelTimer();
- private PCCDispatcherImpl pccDispatcher;
+ private final int disconnectAfter;
private final int reconnectAfter;
private final Optional<Uint64> syncOptDBVersion;
private final PCCsBuilder pcCsBuilder;
+
+ private PCCDispatcherImpl pccDispatcher = null;
private boolean reconnectActive = false;
public TimerHandler(final PCCsBuilder pcCsBuilder, final Optional<Uint64> syncOptDBVersion,
final class DisconnectTask implements TimerTask {
@Override
public void run(final Timeout timeout) {
- LOG.debug("Disconnects PCCs, reconnect after {} seconds", TimerHandler.this.reconnectAfter);
- TimerHandler.this.pccDispatcher.close();
- if (TimerHandler.this.reconnectAfter > 0) {
- TimerHandler.this.timer.newTimeout(new ReconnectTask(),
- TimerHandler.this.reconnectAfter, TimeUnit.SECONDS);
+ LOG.debug("Disconnects PCCs, reconnect after {} seconds", reconnectAfter);
+ pccDispatcher.close();
+ if (reconnectAfter > 0) {
+ timer.newTimeout(new ReconnectTask(), reconnectAfter, TimeUnit.SECONDS);
}
}
}
@Override
public void run(final Timeout timeout) {
LOG.debug("Reconnecting PCCs}");
- TimerHandler.this.pcCsBuilder.createPCCs(TimerHandler.this.syncOptDBVersion.orElse(Uint64.ONE),
- Optional.empty());
+ pcCsBuilder.createPCCs(syncOptDBVersion.orElse(Uint64.ONE), Optional.empty());
}
}
protected void createDisconnectTask() {
- if (this.disconnectAfter > 0 && !this.reconnectActive && this.syncOptDBVersion.isPresent()) {
- this.timer.newTimeout(new DisconnectTask(), this.disconnectAfter, TimeUnit.SECONDS);
- this.reconnectActive = true;
+ if (disconnectAfter > 0 && !reconnectActive && syncOptDBVersion.isPresent()) {
+ timer.newTimeout(new DisconnectTask(), disconnectAfter, TimeUnit.SECONDS);
+ reconnectActive = true;
}
}
public void setPCCDispatcher(final PCCDispatcherImpl dispatcher) {
- this.pccDispatcher = dispatcher;
+ pccDispatcher = dispatcher;
}
}
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.SettableFuture;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import io.netty.util.Timeout;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.VarHandle;
// Manipulated via STATE
@SuppressWarnings("unused")
+ @SuppressFBWarnings(value = "URF_UNREAD_FIELD", justification = "https://github.com/spotbugs/spotbugs/issues/2749")
private volatile State state = State.UNSENT;
// Guarded by state going to State.DONE
@GuardedBy("this")
private State state;
- @GuardedBy("this")
- private SettableFuture<?> cleanupFuture;
private PCEPTopologySingleton(final PCEPTopologySingleton previous, final ListenableFuture<?> future) {
tracker = previous.tracker;
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>