+++ /dev/null
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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.controller.config.reconnectstrategy.util;
-
-import io.netty.util.concurrent.Future;
-
-import org.opendaylight.protocol.framework.ReconnectStrategy;
-
-public final class ReconnectStrategyCloseable implements ReconnectStrategy,
-AutoCloseable {
-
- private final ReconnectStrategy inner;
-
- public ReconnectStrategyCloseable(final ReconnectStrategy inner) {
- this.inner = inner;
- }
-
- @Override
- public void close() {
-
- }
-
- @Override
- public int getConnectTimeout() throws Exception {
- return this.inner.getConnectTimeout();
- }
-
- @Override
- public Future<Void> scheduleReconnect(final Throwable cause) {
- return this.inner.scheduleReconnect(cause);
- }
-
- @Override
- public void reconnectSuccessful() {
- this.inner.reconnectSuccessful();
- }
-}
import org.opendaylight.controller.config.api.JmxAttributeValidationException;
import org.opendaylight.protocol.bgp.rib.impl.RIBImpl;
-import org.opendaylight.protocol.framework.ReconnectStrategy;
-import org.opendaylight.protocol.framework.ReconnectStrategyFactory;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.AsNumber;
/**
@Override
public java.lang.AutoCloseable createInstance() {
return new RIBImpl(getRibId(), new AsNumber(getLocalAs()), getBgpId(), getExtensionsDependency(),
- getBgpDispatcherDependency(), new ReconnectStrategyFactory() {
- @Override
- public ReconnectStrategy createReconnectStrategy() {
- return getTcpReconnectStrategyDependency();
- }
- }, getSessionReconnectStrategyDependency(), getDataProviderDependency(), getLocalTableDependency());
+ getBgpDispatcherDependency(), getTcpReconnectStrategyDependency()
+ , getSessionReconnectStrategyDependency(), getDataProviderDependency(), getLocalTableDependency());
}
}
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
/**
-* Generated file
+ * Generated file
-* Generated from: yang module name: reconnect-strategy yang module local name: never-reconnect-strategy
-* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
-* Generated at: Tue Nov 12 13:27:18 CET 2013
-*
-* Do not modify this file unless it is present under src/main directory
-*/
+ * Generated from: yang module name: reconnect-strategy yang module local name: never-reconnect-strategy
+ * Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
+ * Generated at: Tue Nov 12 13:27:18 CET 2013
+ *
+ * Do not modify this file unless it is present under src/main directory
+ */
package org.opendaylight.controller.config.yang.reconnectstrategy;
+import io.netty.util.concurrent.EventExecutor;
+
import org.opendaylight.controller.config.api.JmxAttributeValidationException;
-import org.opendaylight.controller.config.reconnectstrategy.util.ReconnectStrategyCloseable;
import org.opendaylight.protocol.framework.NeverReconnectStrategy;
import org.opendaylight.protocol.framework.ReconnectStrategy;
+import org.opendaylight.protocol.framework.ReconnectStrategyFactory;
/**
*
*/
-public final class NeverReconnectStrategyModule extends org.opendaylight.controller.config.yang.reconnectstrategy.AbstractNeverReconnectStrategyModule
-{
+public final class NeverReconnectStrategyModule extends
+ org.opendaylight.controller.config.yang.reconnectstrategy.AbstractNeverReconnectStrategyModule {
- public NeverReconnectStrategyModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
+ public NeverReconnectStrategyModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,
+ org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
super(identifier, dependencyResolver);
}
- public NeverReconnectStrategyModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, NeverReconnectStrategyModule oldModule, java.lang.AutoCloseable oldInstance) {
+ public NeverReconnectStrategyModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,
+ org.opendaylight.controller.config.api.DependencyResolver dependencyResolver,
+ NeverReconnectStrategyModule oldModule, java.lang.AutoCloseable oldInstance) {
super(identifier, dependencyResolver, oldModule, oldInstance);
}
@Override
- public void validate(){
- super.validate();
- JmxAttributeValidationException.checkNotNull(getTimeout(),
- "value is not set.", timeoutJmxAttribute);
- JmxAttributeValidationException.checkCondition(getTimeout() >= 0,
- "value " + getTimeout() + " is less than 0",
- timeoutJmxAttribute);
+ public void validate() {
+ super.validate();
+ JmxAttributeValidationException.checkNotNull(getTimeout(), "value is not set.", timeoutJmxAttribute);
+ JmxAttributeValidationException.checkCondition(getTimeout() >= 0, "value " + getTimeout() + " is less than 0",
+ timeoutJmxAttribute);
}
@Override
public java.lang.AutoCloseable createInstance() {
- ReconnectStrategy reconnectStrategy = new NeverReconnectStrategy(getExecutorDependency(), getTimeout());
- return new ReconnectStrategyCloseable(reconnectStrategy);
- }
+ return new NeverReconnectStrategyFactory(getExecutorDependency(), getTimeout());
+ }
+
+ private static final class NeverReconnectStrategyFactory implements ReconnectStrategyFactory, AutoCloseable {
+
+ private final EventExecutor executor;
+ private final int timeout;
+
+ public NeverReconnectStrategyFactory(final EventExecutor executor, final int timeout) {
+ this.executor = executor;
+ this.timeout = timeout;
+ }
+
+ @Override
+ public void close() throws Exception {
+ // no-op
+ }
+
+ @Override
+ public ReconnectStrategy createReconnectStrategy() {
+ return new NeverReconnectStrategy(this.executor, this.timeout);
+ }
+
+ }
}
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
/**
-* Generated file
+ * Generated file
-* Generated from: yang module name: reconnect-strategy yang module local name: reconnect-immediately-strategy
-* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
-* Generated at: Tue Nov 12 13:27:18 CET 2013
-*
-* Do not modify this file unless it is present under src/main directory
-*/
+ * Generated from: yang module name: reconnect-strategy yang module local name: reconnect-immediately-strategy
+ * Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
+ * Generated at: Tue Nov 12 13:27:18 CET 2013
+ *
+ * Do not modify this file unless it is present under src/main directory
+ */
package org.opendaylight.controller.config.yang.reconnectstrategy;
+import io.netty.util.concurrent.EventExecutor;
+
import org.opendaylight.controller.config.api.JmxAttributeValidationException;
-import org.opendaylight.controller.config.reconnectstrategy.util.ReconnectStrategyCloseable;
import org.opendaylight.protocol.framework.ReconnectImmediatelyStrategy;
import org.opendaylight.protocol.framework.ReconnectStrategy;
+import org.opendaylight.protocol.framework.ReconnectStrategyFactory;
/**
*
*/
-public final class ReconnectImmediatelyStrategyModule extends org.opendaylight.controller.config.yang.reconnectstrategy.AbstractReconnectImmediatelyStrategyModule
-{
+public final class ReconnectImmediatelyStrategyModule extends
+ org.opendaylight.controller.config.yang.reconnectstrategy.AbstractReconnectImmediatelyStrategyModule {
- public ReconnectImmediatelyStrategyModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
+ public ReconnectImmediatelyStrategyModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,
+ org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
super(identifier, dependencyResolver);
}
- public ReconnectImmediatelyStrategyModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, ReconnectImmediatelyStrategyModule oldModule, java.lang.AutoCloseable oldInstance) {
+ public ReconnectImmediatelyStrategyModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,
+ org.opendaylight.controller.config.api.DependencyResolver dependencyResolver,
+ ReconnectImmediatelyStrategyModule oldModule, java.lang.AutoCloseable oldInstance) {
super(identifier, dependencyResolver, oldModule, oldInstance);
}
@Override
- public void validate(){
- super.validate();
- JmxAttributeValidationException.checkNotNull(getTimeout(),
- "value is not set.", timeoutJmxAttribute);
- JmxAttributeValidationException.checkCondition(getTimeout() >= 0,
- "value " + getTimeout() + " is less than 0",
- timeoutJmxAttribute);
+ public void validate() {
+ super.validate();
+ JmxAttributeValidationException.checkNotNull(getTimeout(), "value is not set.", timeoutJmxAttribute);
+ JmxAttributeValidationException.checkCondition(getTimeout() >= 0, "value " + getTimeout() + " is less than 0",
+ timeoutJmxAttribute);
}
@Override
public java.lang.AutoCloseable createInstance() {
- final ReconnectStrategy reconnectStrategy = new ReconnectImmediatelyStrategy(getExecutorDependency(), getTimeout());
- return new ReconnectStrategyCloseable(reconnectStrategy);
- }
+ return new ReconnectImmediatelyStrategyFactory(getExecutorDependency(), getTimeout());
+ }
+
+ private static final class ReconnectImmediatelyStrategyFactory implements ReconnectStrategyFactory, AutoCloseable {
+
+ private final EventExecutor executor;
+ private final int timeout;
+
+ public ReconnectImmediatelyStrategyFactory(final EventExecutor executor, final int timeout) {
+ this.executor = executor;
+ this.timeout = timeout;
+ }
+
+ @Override
+ public void close() throws Exception {
+ // no-op
+ }
+
+ @Override
+ public ReconnectStrategy createReconnectStrategy() {
+ return new ReconnectImmediatelyStrategy(this.executor, this.timeout);
+ }
+
+ }
}
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
/**
-* Generated file
+ * Generated file
-* Generated from: yang module name: reconnect-strategy yang module local name: timed-reconnect-strategy
-* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
-* Generated at: Tue Nov 12 13:27:18 CET 2013
-*
-* Do not modify this file unless it is present under src/main directory
-*/
+ * Generated from: yang module name: reconnect-strategy yang module local name: timed-reconnect-strategy
+ * Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
+ * Generated at: Tue Nov 12 13:27:18 CET 2013
+ *
+ * Do not modify this file unless it is present under src/main directory
+ */
package org.opendaylight.controller.config.yang.reconnectstrategy;
+import io.netty.util.concurrent.EventExecutor;
+
import org.opendaylight.controller.config.api.JmxAttributeValidationException;
-import org.opendaylight.controller.config.reconnectstrategy.util.ReconnectStrategyCloseable;
import org.opendaylight.protocol.framework.ReconnectStrategy;
+import org.opendaylight.protocol.framework.ReconnectStrategyFactory;
import org.opendaylight.protocol.framework.TimedReconnectStrategy;
+import com.google.common.base.Preconditions;
+
/**
*
*/
-public final class TimedReconnectStrategyModule extends org.opendaylight.controller.config.yang.reconnectstrategy.AbstractTimedReconnectStrategyModule
-{
+public final class TimedReconnectStrategyModule extends
+ org.opendaylight.controller.config.yang.reconnectstrategy.AbstractTimedReconnectStrategyModule {
- public TimedReconnectStrategyModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
+ public TimedReconnectStrategyModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,
+ org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
super(identifier, dependencyResolver);
}
- public TimedReconnectStrategyModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, TimedReconnectStrategyModule oldModule, java.lang.AutoCloseable oldInstance) {
+ public TimedReconnectStrategyModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,
+ org.opendaylight.controller.config.api.DependencyResolver dependencyResolver,
+ TimedReconnectStrategyModule oldModule, java.lang.AutoCloseable oldInstance) {
super(identifier, dependencyResolver, oldModule, oldInstance);
}
@Override
- public void validate(){
- super.validate();
- JmxAttributeValidationException.checkNotNull(getSleepFactor(),
- "value is not set.", sleepFactorJmxAttribute);
- JmxAttributeValidationException.checkCondition(getSleepFactor()
- .doubleValue() >= 1,
- "value " + getSleepFactor() + " is less than 1",
- sleepFactorJmxAttribute);
-
- JmxAttributeValidationException.checkNotNull(getConnectTime(),
- "value is not set.", connectTimeJmxAttribute);
- JmxAttributeValidationException.checkCondition(getConnectTime() >= 0,
- "value " + getConnectTime() + " is less than 0",
- connectTimeJmxAttribute);
-
- JmxAttributeValidationException.checkNotNull(getMinSleep(),
- "value is not set.", minSleepJmxAttribute);
- JmxAttributeValidationException.checkCondition(
- getMaxSleep() == null || getMinSleep() <= getMaxSleep(),
- "value " + getMinSleep() + " is greter than MaxSleep " + getMaxSleep(),
- minSleepJmxAttribute);
+ public void validate() {
+ super.validate();
+ JmxAttributeValidationException.checkNotNull(getSleepFactor(), "value is not set.", sleepFactorJmxAttribute);
+ JmxAttributeValidationException.checkCondition(getSleepFactor().doubleValue() >= 1, "value " + getSleepFactor()
+ + " is less than 1", sleepFactorJmxAttribute);
+
+ JmxAttributeValidationException.checkNotNull(getConnectTime(), "value is not set.", connectTimeJmxAttribute);
+ JmxAttributeValidationException.checkCondition(getConnectTime() >= 0, "value " + getConnectTime()
+ + " is less than 0", connectTimeJmxAttribute);
+
+ JmxAttributeValidationException.checkNotNull(getMinSleep(), "value is not set.", minSleepJmxAttribute);
+ JmxAttributeValidationException.checkCondition(getMaxSleep() == null || getMinSleep() <= getMaxSleep(),
+ "value " + getMinSleep() + " is greter than MaxSleep " + getMaxSleep(), minSleepJmxAttribute);
}
@Override
public java.lang.AutoCloseable createInstance() {
- ReconnectStrategy reconnectStrategy = new TimedReconnectStrategy(
- getExecutorDependency(), getConnectTime(), getMinSleep(),
- getSleepFactor().doubleValue(), getMaxSleep(),
- getMaxAttempts(), getDeadline());
- return new ReconnectStrategyCloseable(reconnectStrategy);
- }
+ return new TimedReconnectStrategyFactory(getExecutorDependency(),
+ getConnectTime(), getMinSleep(), getSleepFactor().doubleValue(), getMaxSleep(), getMaxAttempts(),
+ getDeadline());
+ }
+
+ private static final class TimedReconnectStrategyFactory implements ReconnectStrategyFactory, AutoCloseable {
+
+ private final EventExecutor executor;
+ private final long deadline, maxAttempts, maxSleep;
+ private final double sleepFactor;
+ private final int connectTime;
+ private final long minSleep;
+
+ public TimedReconnectStrategyFactory(final EventExecutor executor, final int connectTime, final long minSleep, final double sleepFactor,
+ final Long maxSleep, final Long maxAttempts, final Long deadline) {
+ Preconditions.checkArgument(maxSleep == null || minSleep <= maxSleep);
+ Preconditions.checkArgument(sleepFactor >= 1);
+ Preconditions.checkArgument(connectTime >= 0);
+ this.executor = Preconditions.checkNotNull(executor);
+ this.deadline = deadline;
+ this.maxAttempts = maxAttempts;
+ this.minSleep = minSleep;
+ this.maxSleep = maxSleep;
+ this.sleepFactor = sleepFactor;
+ this.connectTime = connectTime;
+ }
+
+ @Override
+ public void close() throws Exception {
+ // no-op
+ }
+
+ @Override
+ public ReconnectStrategy createReconnectStrategy() {
+ return new TimedReconnectStrategy(this.executor,
+ this.connectTime, this.minSleep, this.sleepFactor, this.maxSleep, this.maxAttempts,
+ this.deadline);
+ }
+
+ }
}
"Service representing a reconnect strategy.";
base "config:service-type";
- config:java-class "org.opendaylight.protocol.framework.ReconnectStrategy";
+ config:java-class "org.opendaylight.protocol.framework.ReconnectStrategyFactory";
}
identity never-reconnect-strategy {
return super.createClient(address, strategy, new PipelineInitializer<BGPSessionImpl>() {
@Override
public void initializeChannel(final SocketChannel ch, final Promise<BGPSessionImpl> promise) {
- ch.pipeline().addLast(hf.getDecoders());
+ ch.pipeline().addLast(BGPDispatcherImpl.this.hf.getDecoders());
ch.pipeline().addLast("negotiator", snf.getSessionNegotiator(slf, ch, promise));
- ch.pipeline().addLast(hf.getEncoders());
+ ch.pipeline().addLast(BGPDispatcherImpl.this.hf.getEncoders());
}
});
}
public Future<Void> createReconnectingClient(final InetSocketAddress address,
final BGPSessionPreferences preferences, final AsNumber remoteAs,
final BGPSessionListener listener, final ReconnectStrategyFactory connectStrategyFactory,
- final ReconnectStrategy reestablishStrategy) {
+ final ReconnectStrategyFactory reestablishStrategyFactory) {
final BGPSessionNegotiatorFactory snf = new BGPSessionNegotiatorFactory(this.timer, preferences, remoteAs);
final SessionListenerFactory<BGPSessionListener> slf = new SessionListenerFactory<BGPSessionListener>() {
@Override
}
};
- return super.createReconnectingClient(address, connectStrategyFactory, reestablishStrategy, new PipelineInitializer<BGPSessionImpl>() {
+ return super.createReconnectingClient(address, connectStrategyFactory, reestablishStrategyFactory.createReconnectStrategy(), new PipelineInitializer<BGPSessionImpl>() {
@Override
public void initializeChannel(final SocketChannel ch, final Promise<BGPSessionImpl> promise) {
- ch.pipeline().addLast(hf.getDecoders());
+ ch.pipeline().addLast(BGPDispatcherImpl.this.hf.getDecoders());
ch.pipeline().addLast("negotiator", snf.getSessionNegotiator(slf, ch, promise));
- ch.pipeline().addLast(hf.getEncoders());
+ ch.pipeline().addLast(BGPDispatcherImpl.this.hf.getEncoders());
}
});
}
final AsNumber remoteAs, final RIB rib) {
this.rib = Preconditions.checkNotNull(rib);
this.name = Preconditions.checkNotNull(name);
- cf = rib.getDispatcher().createReconnectingClient(address, prefs, remoteAs, this, rib.getTcpStrategyFactory(), rib.getSessionStrategy());
+ this.cf = rib.getDispatcher().createReconnectingClient(address, prefs, remoteAs, this, rib.getTcpStrategyFactory(), rib.getSessionStrategyFactory());
}
@Override
public synchronized void close() {
- if (cf != null) {
- cf.cancel(true);
- if (session != null) {
- session.close();
- session = null;
+ if (this.cf != null) {
+ this.cf.cancel(true);
+ if (this.session != null) {
+ this.session.close();
+ this.session = null;
}
- cf = null;
+ this.cf = null;
}
}
LOG.info("Session with peer {} went up with tables: {}", this.name, session.getAdvertisedTableTypes());
this.session = session;
- this.comparator = new BGPObjectComparator(rib.getLocalAs(), rib.getBgpIdentifier(), session.getBgpId());
+ this.comparator = new BGPObjectComparator(this.rib.getLocalAs(), this.rib.getBgpIdentifier(), session.getBgpId());
for (final BgpTableType t : session.getAdvertisedTableTypes()) {
final TablesKey key = new TablesKey(t.getAfi(), t.getSafi());
@Override
public String getName() {
- return name;
+ return this.name;
}
@Override
import org.opendaylight.protocol.bgp.rib.spi.AdjRIBsIn;
import org.opendaylight.protocol.bgp.rib.spi.Peer;
import org.opendaylight.protocol.bgp.rib.spi.RIBExtensionConsumerContext;
-import org.opendaylight.protocol.framework.ReconnectStrategy;
import org.opendaylight.protocol.framework.ReconnectStrategyFactory;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.AsNumber;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
private static final Update EOR = new UpdateBuilder().build();
private static final TablesKey IPV4_UNICAST_TABLE = new TablesKey(Ipv4AddressFamily.class, UnicastSubsequentAddressFamily.class);
private final ReconnectStrategyFactory tcpStrategyFactory;
- private final ReconnectStrategy sessionStrategy;
+ private final ReconnectStrategyFactory sessionStrategyFactory;
private final BGPDispatcher dispatcher;
private final DataProviderService dps;
private final AsNumber localAs;
private final RIBTables tables;
public RIBImpl(final RibId ribId, final AsNumber localAs, final Ipv4Address localBgpId, final RIBExtensionConsumerContext extensions,
- final BGPDispatcher dispatcher, final ReconnectStrategyFactory tcpStrategyFactory, final ReconnectStrategy sessionStrategy,
+ final BGPDispatcher dispatcher, final ReconnectStrategyFactory tcpStrategyFactory, final ReconnectStrategyFactory sessionStrategyFactory,
final DataProviderService dps, final List<BgpTableType> localTables) {
super(InstanceIdentifier.builder(BgpRib.class).child(Rib.class, new RibKey(Preconditions.checkNotNull(ribId))).toInstance());
this.dps = Preconditions.checkNotNull(dps);
this.localAs = Preconditions.checkNotNull(localAs);
this.bgpIdentifier = Preconditions.checkNotNull(localBgpId);
this.dispatcher = Preconditions.checkNotNull(dispatcher);
- this.sessionStrategy = Preconditions.checkNotNull(sessionStrategy);
+ this.sessionStrategyFactory = Preconditions.checkNotNull(sessionStrategyFactory);
this.tcpStrategyFactory = Preconditions.checkNotNull(tcpStrategyFactory);
this.localTables = ImmutableList.copyOf(localTables);
this.tables = new RIBTables(extensions);
for (BgpTableType t : localTables) {
final TablesKey key = new TablesKey(t.getAfi(), t.getSafi());
- if (tables.create(trans, this, key) == null) {
+ if (this.tables.create(trans, this, key) == null) {
LOG.debug("Did not create local table for unhandled table type {}", t);
}
}
@Override
public AsNumber getLocalAs() {
- return localAs;
+ return this.localAs;
}
@Override
public Ipv4Address getBgpIdentifier() {
- return bgpIdentifier;
+ return this.bgpIdentifier;
}
@Override
public List<? extends BgpTableType> getLocalTables() {
- return localTables;
+ return this.localTables;
}
@Override
public ReconnectStrategyFactory getTcpStrategyFactory() {
- return tcpStrategyFactory;
+ return this.tcpStrategyFactory;
}
@Override
- public ReconnectStrategy getSessionStrategy() {
- return sessionStrategy;
+ public ReconnectStrategyFactory getSessionStrategyFactory() {
+ return this.sessionStrategyFactory;
}
@Override
public BGPDispatcher getDispatcher() {
- return dispatcher;
+ return this.dispatcher;
}
@Override
BGPSessionListener listener, ReconnectStrategy strategy);
Future<Void> createReconnectingClient(InetSocketAddress address, BGPSessionPreferences preferences, AsNumber remoteAs,
- BGPSessionListener listener, ReconnectStrategyFactory connectStrategyFactory, ReconnectStrategy reestablishStrategy);
+ BGPSessionListener listener, ReconnectStrategyFactory connectStrategyFactory, ReconnectStrategyFactory reestablishStrategyFactory);
}
import java.util.List;
import org.opendaylight.protocol.bgp.rib.spi.Peer;
-import org.opendaylight.protocol.framework.ReconnectStrategy;
import org.opendaylight.protocol.framework.ReconnectStrategyFactory;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.AsNumber;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
BGPDispatcher getDispatcher();
ReconnectStrategyFactory getTcpStrategyFactory();
- ReconnectStrategy getSessionStrategy();
+ ReconnectStrategyFactory getSessionStrategyFactory();
}
import org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderContext;
import org.opendaylight.protocol.bgp.rib.spi.SimpleRIBExtensionProviderContext;
import org.opendaylight.protocol.bgp.util.HexDumpBGPFileParser;
-import org.opendaylight.protocol.framework.ReconnectStrategy;
import org.opendaylight.protocol.framework.ReconnectStrategyFactory;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.AsNumber;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
ReconnectStrategyFactory tcpStrategyFactory;
@Mock
- ReconnectStrategy sessionStrategy;
+ ReconnectStrategyFactory sessionStrategy;
@Before
public void setUp() throws Exception {
}).when(this.mockedTransaction).readOperationalData(Matchers.any(InstanceIdentifier.class));
- Mockito.doReturn(GlobalEventExecutor.INSTANCE.newSucceededFuture(null)).when(dispatcher).
+ Mockito.doReturn(GlobalEventExecutor.INSTANCE.newSucceededFuture(null)).when(this.dispatcher).
createReconnectingClient(Mockito.any(InetSocketAddress.class), Mockito.any(BGPSessionPreferences.class), Mockito.any(AsNumber.class),
- Mockito.any(BGPSessionListener.class), Mockito.eq(tcpStrategyFactory), Mockito.eq(sessionStrategy));
+ Mockito.any(BGPSessionListener.class), Mockito.eq(this.tcpStrategyFactory), Mockito.eq(this.sessionStrategy));
- ext = new SimpleRIBExtensionProviderContext();
- baseact = new RIBActivator();
- lsact = new org.opendaylight.protocol.bgp.linkstate.RIBActivator();
+ this.ext = new SimpleRIBExtensionProviderContext();
+ this.baseact = new RIBActivator();
+ this.lsact = new org.opendaylight.protocol.bgp.linkstate.RIBActivator();
- baseact.startRIBExtensionProvider(ext);
- lsact.startRIBExtensionProvider(ext);
+ this.baseact.startRIBExtensionProvider(this.ext);
+ this.lsact.startRIBExtensionProvider(this.ext);
}
@After
public void tearDown() {
- lsact.close();
- baseact.close();
+ this.lsact.close();
+ this.baseact.close();
}
private void runTestWithTables(final List<BgpTableType> tables) {
- final RIBImpl rib = new RIBImpl(new RibId("testRib"), new AsNumber(72L), new Ipv4Address("127.0.0.1"), ext,
+ final RIBImpl rib = new RIBImpl(new RibId("testRib"), new AsNumber(72L), new Ipv4Address("127.0.0.1"), this.ext,
this.dispatcher, this.tcpStrategyFactory, this.sessionStrategy, this.providerService, tables);
final BGPPeer peer = new BGPPeer("peer-" + this.mock.toString(), null, null, rib.getLocalAs(), rib);