*/
@NonNull ChannelFuture createServer(@NonNull PCEPDispatcherDependencies dispatcherDependencies);
- @NonNull PCEPSessionNegotiatorFactory<?> getPCEPSessionNegotiatorFactory();
+ @NonNull PCEPSessionNegotiatorFactory getPCEPSessionNegotiatorFactory();
}
*/
Future<Void> sendMessage(Message message);
+ @Override
+ void close();
+
void close(TerminationReason reason);
/**
/**
* Factory for creating PCEP session negotiator.
- *
- * @param <S> PCEPSession implementation
*/
-public interface PCEPSessionNegotiatorFactory<S extends PCEPSession> {
+public interface PCEPSessionNegotiatorFactory {
/**
* Creates PCEPSessionNegotiator instance for income attributes.
*/
@NonNull SessionNegotiator getSessionNegotiator(
@NonNull PCEPSessionNegotiatorFactoryDependencies sessionNegotiatorDependencies,
- @NonNull Channel channel, @NonNull Promise<S> promise);
+ @NonNull Channel channel, @NonNull Promise<PCEPSession> promise);
/**
* Returns a PCEPSessionProposalFactory.
import java.util.concurrent.TimeoutException;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLEngine;
+import org.opendaylight.protocol.pcep.PCEPSession;
import org.opendaylight.protocol.pcep.impl.spi.Util;
import org.opendaylight.protocol.pcep.impl.tls.SslContextFactory;
import org.opendaylight.protocol.pcep.spi.PCEPErrors;
private Open localPrefs;
private Open remotePrefs;
- protected AbstractPCEPSessionNegotiator(final Promise<PCEPSessionImpl> promise, final Channel channel,
+ protected AbstractPCEPSessionNegotiator(final Promise<PCEPSession> promise, final Channel channel,
final PcepSessionTls tlsConfiguration) {
super(promise, channel);
this.tlsConfiguration = tlsConfiguration;
import io.netty.channel.Channel;
import io.netty.util.concurrent.Promise;
+import org.opendaylight.protocol.pcep.PCEPSession;
import org.opendaylight.protocol.pcep.PCEPSessionNegotiatorFactory;
import org.opendaylight.protocol.pcep.PCEPSessionNegotiatorFactoryDependencies;
import org.opendaylight.protocol.pcep.SessionNegotiator;
* SessionNegotiator which takes care of making sure sessions between PCEP peers are kept unique. This needs to be
* further subclassed to provide either a client or server factory.
*/
-public abstract class AbstractPCEPSessionNegotiatorFactory implements PCEPSessionNegotiatorFactory<PCEPSessionImpl> {
-
+public abstract class AbstractPCEPSessionNegotiatorFactory implements PCEPSessionNegotiatorFactory {
private static final Logger LOG = LoggerFactory.getLogger(AbstractPCEPSessionNegotiatorFactory.class);
private final PCEPPeerRegistry sessionRegistry = new PCEPPeerRegistry();
*/
protected abstract AbstractPCEPSessionNegotiator createNegotiator(
PCEPSessionNegotiatorFactoryDependencies snd,
- Promise<PCEPSessionImpl> promise,
+ Promise<PCEPSession> promise,
Channel channel, Uint8 sessionId);
@Override
public final SessionNegotiator getSessionNegotiator(final PCEPSessionNegotiatorFactoryDependencies dependencies,
- final Channel channel, final Promise<PCEPSessionImpl> promise) {
+ final Channel channel, final Promise<PCEPSession> promise) {
LOG.debug("Instantiating bootstrap negotiator for channel {}", channel);
return new PCEPSessionNegotiator(channel, promise, dependencies, this);
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.util.concurrent.Promise;
import java.util.concurrent.ExecutionException;
+import org.opendaylight.protocol.pcep.PCEPSession;
import org.opendaylight.protocol.pcep.SessionNegotiator;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Message;
import org.slf4j.Logger;
public abstract class AbstractSessionNegotiator extends ChannelInboundHandlerAdapter implements SessionNegotiator {
private static final Logger LOG = LoggerFactory.getLogger(AbstractSessionNegotiator.class);
+
protected final Channel channel;
- protected final Promise<PCEPSessionImpl> promise;
+ protected final Promise<PCEPSession> promise;
- protected AbstractSessionNegotiator(final Promise<PCEPSessionImpl> promise, final Channel channel) {
+ protected AbstractSessionNegotiator(final Promise<PCEPSession> promise, final Channel channel) {
this.promise = requireNonNull(promise);
this.channel = requireNonNull(channel);
}
protected final void negotiationSuccessful(final PCEPSessionImpl session) {
- LOG.debug("Negotiation on channel {} successful with session {}", this.channel, session);
- this.channel.pipeline().replace(this, "session", session);
- this.promise.setSuccess(session);
+ LOG.debug("Negotiation on channel {} successful with session {}", channel, session);
+ channel.pipeline().replace(this, "session", session);
+ promise.setSuccess(session);
}
protected void negotiationFailed(final Throwable cause) {
- LOG.debug("Negotiation on channel {} failed", this.channel, cause);
- this.channel.close();
- this.promise.setFailure(cause);
+ LOG.debug("Negotiation on channel {} failed", channel, cause);
+ channel.close();
+ promise.setFailure(cause);
}
protected final void sendMessage(final Message msg) {
- this.channel.writeAndFlush(msg).addListener((ChannelFutureListener) f -> {
+ channel.writeAndFlush(msg).addListener((ChannelFutureListener) f -> {
if (!f.isSuccess()) {
LOG.info("Failed to send message {}", msg, f.cause());
negotiationFailed(f.cause());
@Override
@SuppressWarnings("checkstyle:IllegalCatch")
public final void channelActive(final ChannelHandlerContext ctx) {
- LOG.debug("Starting session negotiation on channel {}", this.channel);
+ LOG.debug("Starting session negotiation on channel {}", channel);
try {
- this.startNegotiation();
+ startNegotiation();
} catch (final Exception e) {
LOG.warn("Unexpected negotiation failure", e);
- this.negotiationFailed(e);
+ negotiationFailed(e);
}
-
}
@Override
@SuppressWarnings("checkstyle:IllegalCatch")
public final void channelRead(final ChannelHandlerContext ctx, final Object msg) {
- LOG.debug("Negotiation read invoked on channel {}", this.channel);
+ LOG.debug("Negotiation read invoked on channel {}", channel);
try {
- this.handleMessage((Message) msg);
+ handleMessage((Message) msg);
} catch (Exception e) {
LOG.debug("Unexpected error while handling negotiation message {}", msg, e);
- this.negotiationFailed(e);
+ negotiationFailed(e);
}
}
@Override
public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) {
LOG.info("Unexpected error during negotiation", cause);
- this.negotiationFailed(cause);
+ negotiationFailed(cause);
}
protected abstract void startNegotiation() throws ExecutionException;
import com.google.common.annotations.VisibleForTesting;
import io.netty.channel.Channel;
import io.netty.util.concurrent.Promise;
+import org.opendaylight.protocol.pcep.PCEPSession;
import org.opendaylight.protocol.pcep.PCEPSessionListener;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.config.rev230112.PcepSessionErrorPolicy;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.config.rev230112.PcepSessionTls;
private final PcepSessionErrorPolicy errorPolicy;
private final PCEPSessionListener listener;
- public DefaultPCEPSessionNegotiator(final Promise<PCEPSessionImpl> promise, final Channel channel,
+ public DefaultPCEPSessionNegotiator(final Promise<PCEPSession> promise, final Channel channel,
final PCEPSessionListener listener, final Uint8 sessionId, final Open localPrefs,
final PcepSessionErrorPolicy errorPolicy, final PcepSessionTls tlsConfiguration) {
super(promise, channel, tlsConfiguration);
.build();
}
- public DefaultPCEPSessionNegotiator(final Promise<PCEPSessionImpl> promise, final Channel channel,
+ public DefaultPCEPSessionNegotiator(final Promise<PCEPSession> promise, final Channel channel,
final PCEPSessionListener listener, final Uint8 sessionId, final Open localPrefs,
final PcepSessionErrorPolicy errorPolicy) {
this(promise, channel, listener, sessionId, localPrefs, errorPolicy, null);
import io.netty.channel.Channel;
import io.netty.util.concurrent.Promise;
import java.net.InetSocketAddress;
+import org.opendaylight.protocol.pcep.PCEPSession;
import org.opendaylight.protocol.pcep.PCEPSessionNegotiatorFactoryDependencies;
import org.opendaylight.protocol.pcep.PCEPSessionProposalFactory;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.app.config.rev160707.PcepDispatcherConfig;
@Override
protected AbstractPCEPSessionNegotiator createNegotiator(
final PCEPSessionNegotiatorFactoryDependencies sessionNegotiatorDependencies,
- final Promise<PCEPSessionImpl> promise,
+ final Promise<PCEPSession> promise,
final Channel channel,
final Uint8 sessionId) {
import org.opendaylight.protocol.concepts.KeyMapping;
import org.opendaylight.protocol.pcep.PCEPDispatcher;
import org.opendaylight.protocol.pcep.PCEPDispatcherDependencies;
+import org.opendaylight.protocol.pcep.PCEPSession;
import org.opendaylight.protocol.pcep.PCEPSessionNegotiatorFactory;
import org.opendaylight.protocol.pcep.spi.MessageRegistry;
import org.slf4j.Logger;
private static final Logger LOG = LoggerFactory.getLogger(PCEPDispatcherImpl.class);
private static final Integer SOCKET_BACKLOG_SIZE = 128;
private static final long TIMEOUT = 10;
- private final PCEPSessionNegotiatorFactory<PCEPSessionImpl> snf;
+ private final PCEPSessionNegotiatorFactory snf;
private final PCEPHandlerFactory hf;
private final EventLoopGroup bossGroup;
private final EventLoopGroup workerGroup;
* @param workerGroup handles the traffic of accepted connection
*/
public PCEPDispatcherImpl(final @NonNull MessageRegistry registry,
- final @NonNull PCEPSessionNegotiatorFactory<PCEPSessionImpl> negotiatorFactory,
+ final @NonNull PCEPSessionNegotiatorFactory negotiatorFactory,
final @NonNull EventLoopGroup bossGroup, final @NonNull EventLoopGroup workerGroup) {
snf = requireNonNull(negotiatorFactory);
hf = new PCEPHandlerFactory(registry);
}
@Override
- public final PCEPSessionNegotiatorFactory<PCEPSessionImpl> getPCEPSessionNegotiatorFactory() {
+ public final PCEPSessionNegotiatorFactory getPCEPSessionNegotiatorFactory() {
return snf;
}
protected interface ChannelPipelineInitializer {
- void initializeChannel(SocketChannel socketChannel, Promise<PCEPSessionImpl> promise);
+ void initializeChannel(SocketChannel socketChannel, Promise<PCEPSession> promise);
}
}
import java.util.Comparator;
import java.util.Optional;
import java.util.concurrent.ExecutionException;
+import org.opendaylight.protocol.pcep.PCEPSession;
import org.opendaylight.protocol.pcep.PCEPSessionNegotiatorFactoryDependencies;
import org.opendaylight.protocol.pcep.impl.PCEPPeerRegistry.SessionReference;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Message;
import org.slf4j.LoggerFactory;
public class PCEPSessionNegotiator extends AbstractSessionNegotiator {
-
private static final Logger LOG = LoggerFactory.getLogger(PCEPSessionNegotiator.class);
private static final Comparator<byte[]> COMPARATOR = UnsignedBytes.lexicographicalComparator();
private final AbstractPCEPSessionNegotiatorFactory negFactory;
private final PCEPSessionNegotiatorFactoryDependencies nfd;
- public PCEPSessionNegotiator(final Channel channel, final Promise<PCEPSessionImpl> promise,
+ public PCEPSessionNegotiator(final Channel channel, final Promise<PCEPSession> promise,
final PCEPSessionNegotiatorFactoryDependencies dependencies,
final AbstractPCEPSessionNegotiatorFactory negFactory) {
super(promise, channel);
import org.mockito.junit.MockitoJUnitRunner;
import org.opendaylight.protocol.concepts.KeyMapping;
import org.opendaylight.protocol.pcep.PCEPDispatcherDependencies;
+import org.opendaylight.protocol.pcep.PCEPSession;
import org.opendaylight.protocol.pcep.PCEPSessionListenerFactory;
import org.opendaylight.protocol.pcep.PCEPSessionNegotiatorFactory;
import org.opendaylight.protocol.pcep.PCEPSessionProposalFactory;
doReturn(new SimpleSessionListener()).when(listenerFactory).getSessionListener();
final ChannelFuture futureChannel = dispatcher.createServer(dispatcherDependencies);
futureChannel.sync();
- final PCEPSessionImpl session1 = pccMock.createClient(clientAddr1,
- RETRY_TIMER, CONNECT_TIMEOUT, SimpleSessionListener::new).get();
- final PCEPSessionImpl session2 = pccMock.createClient(clientAddr2,
- RETRY_TIMER, CONNECT_TIMEOUT, SimpleSessionListener::new).get();
+ try (var session1 = (PCEPSessionImpl) pccMock.createClient(clientAddr1,
+ RETRY_TIMER, CONNECT_TIMEOUT, SimpleSessionListener::new).get()) {
- assertTrue(futureChannel.channel().isActive());
- assertEquals(clientAddr1.getAddress().getHostAddress(), session1.getPeerPref().getIpAddress());
- assertEquals(DEAD_TIMER.toJava(), session1.getDeadTimerValue());
- assertEquals(KEEP_ALIVE.toJava(), session1.getKeepAliveTimerValue());
+ try (var session2 = (PCEPSessionImpl) pccMock.createClient(clientAddr2,
+ RETRY_TIMER, CONNECT_TIMEOUT, SimpleSessionListener::new).get()) {
- assertEquals(clientAddr2.getAddress().getHostAddress(), session2.getPeerPref().getIpAddress());
- assertEquals(DEAD_TIMER.toJava(), session2.getDeadTimerValue());
- assertEquals(KEEP_ALIVE.toJava(), session2.getKeepAliveTimerValue());
+ assertTrue(futureChannel.channel().isActive());
+ assertEquals(clientAddr1.getAddress().getHostAddress(), session1.getPeerPref().getIpAddress());
+ assertEquals(DEAD_TIMER.toJava(), session1.getDeadTimerValue());
+ assertEquals(KEEP_ALIVE.toJava(), session1.getKeepAliveTimerValue());
- session1.close();
- session2.close();
+ assertEquals(clientAddr2.getAddress().getHostAddress(), session2.getPeerPref().getIpAddress());
+ assertEquals(DEAD_TIMER.toJava(), session2.getDeadTimerValue());
+ assertEquals(KEEP_ALIVE.toJava(), session2.getKeepAliveTimerValue());
+ }
+ }
assertTrue(futureChannel.channel().isActive());
}
doReturn(new SimpleSessionListener()).when(listenerFactory).getSessionListener();
dispatcher.createServer(dispatcherDependencies).sync();
- final Future<PCEPSessionImpl> futureClient = pccMock.createClient(clientAddr, RETRY_TIMER, CONNECT_TIMEOUT,
+ final Future<PCEPSession> futureClient = pccMock.createClient(clientAddr, RETRY_TIMER, CONNECT_TIMEOUT,
SimpleSessionListener::new);
futureClient.sync();
- try (PCEPSessionImpl ignored = futureClient.get()) {
+ try (PCEPSession ignored = futureClient.get()) {
final var cause = assertThrows(ExecutionException.class,
() -> pccMock.createClient(clientAddr, RETRY_TIMER, CONNECT_TIMEOUT, SimpleSessionListener::new).get())
.getCause();
doReturn(listenerFactory).when(dispatcherDependencies).getListenerFactory();
doReturn(new SimpleSessionListener()).when(listenerFactory).getSessionListener();
dispatcher.createServer(dispatcherDependencies).sync();
- final PCEPSessionImpl session1 = pccMock.createClient(clientAddr,
+ final PCEPSessionImpl session1 = (PCEPSessionImpl) pccMock.createClient(clientAddr,
RETRY_TIMER, CONNECT_TIMEOUT, SimpleSessionListener::new).get();
assertEquals(clientAddr.getAddress(), session1.getRemoteAddress());
assertEquals(KEEP_ALIVE.toJava(), session1.getKeepAliveTimerValue());
session1.closeChannel().sync();
- final PCEPSessionImpl session2 = pccMock.createClient(clientAddr,
- RETRY_TIMER, CONNECT_TIMEOUT, SimpleSessionListener::new).get();
+ try (var session2 = (PCEPSessionImpl) pccMock.createClient(clientAddr, RETRY_TIMER, CONNECT_TIMEOUT,
+ SimpleSessionListener::new).get()) {
- assertEquals(clientAddr.getAddress(), session1.getRemoteAddress());
- assertEquals(DEAD_TIMER.toJava(), session2.getDeadTimerValue());
- assertEquals(KEEP_ALIVE.toJava(), session2.getKeepAliveTimerValue());
-
- session2.close();
+ assertEquals(clientAddr.getAddress(), session1.getRemoteAddress());
+ assertEquals(DEAD_TIMER.toJava(), session2.getDeadTimerValue());
+ assertEquals(KEEP_ALIVE.toJava(), session2.getKeepAliveTimerValue());
+ }
}
@Test(timeout = 20000)
}
private static class PCCMock {
- private final PCEPSessionNegotiatorFactory<PCEPSessionImpl> negotiatorFactory;
+ private final PCEPSessionNegotiatorFactory negotiatorFactory;
private final PCEPHandlerFactory factory;
private final EventExecutor executor;
private final EventLoopGroup workerGroup;
- PCCMock(final PCEPSessionNegotiatorFactory<PCEPSessionImpl> negotiatorFactory,
+ PCCMock(final PCEPSessionNegotiatorFactory negotiatorFactory,
final PCEPHandlerFactory factory) {
workerGroup = new NioEventLoopGroup();
this.negotiatorFactory = requireNonNull(negotiatorFactory);
executor = requireNonNull(GlobalEventExecutor.INSTANCE);
}
- Future<PCEPSessionImpl> createClient(final InetSocketAddress address, final int retryTimer,
+ Future<PCEPSession> createClient(final InetSocketAddress address, final int retryTimer,
final int connectTimeout, final PCEPSessionListenerFactory listenerFactory) {
return createClient(address, retryTimer, connectTimeout, (ch, promise) -> {
ch.pipeline().addLast(factory.getDecoders());
});
}
- Future<PCEPSessionImpl> createClient(final InetSocketAddress address, final int retryTimer,
+ Future<PCEPSession> createClient(final InetSocketAddress address, final int retryTimer,
final int connectTimeout, final PCEPDispatcherImpl.ChannelPipelineInitializer initializer) {
final Bootstrap b = new Bootstrap();
- final PCEPProtocolSessionPromise<PCEPSessionImpl> p = new PCEPProtocolSessionPromise<>(executor,
+ final PCEPProtocolSessionPromise<PCEPSession> p = new PCEPProtocolSessionPromise<>(executor,
address, retryTimer, connectTimeout, b);
b.option(ChannelOption.SO_KEEPALIVE, Boolean.TRUE).handler(new ChannelInitializer<SocketChannel>() {
@Override
import static java.util.Objects.requireNonNull;
-import com.google.common.collect.Lists;
import com.google.common.net.InetAddresses;
import io.netty.util.HashedWheelTimer;
import io.netty.util.Timer;
import org.opendaylight.protocol.pcep.PCEPSessionNegotiatorFactory;
import org.opendaylight.protocol.pcep.impl.BasePCEPSessionProposalFactory;
import org.opendaylight.protocol.pcep.impl.DefaultPCEPSessionNegotiatorFactory;
-import org.opendaylight.protocol.pcep.impl.PCEPSessionImpl;
import org.opendaylight.protocol.pcep.pcc.mock.api.PCCTunnelManager;
import org.opendaylight.protocol.pcep.pcc.mock.protocol.MockPcepSessionErrorPolicy;
import org.opendaylight.protocol.pcep.pcc.mock.protocol.PCCDispatcherImpl;
private void createPCC(final PCCDispatcherImpl pccDispatcher, final @NonNull InetSocketAddress plocalAddress,
final PCCTunnelManager tunnelManager, final Uint64 initialDBVersion) {
- final PCEPSessionNegotiatorFactory<PCEPSessionImpl> snf = getSessionNegotiatorFactory();
+ final PCEPSessionNegotiatorFactory snf = getSessionNegotiatorFactory();
for (final InetSocketAddress pceAddress : remoteAddress) {
pccDispatcher.createClient(pceAddress, reconnectTime,
() -> new PCCSessionListener(remoteAddress.indexOf(pceAddress), tunnelManager, pcError), snf,
}
}
- private PCEPSessionNegotiatorFactory<PCEPSessionImpl> getSessionNegotiatorFactory() {
- final List<PCEPCapability> capabilities = Lists.newArrayList(pcepCapabilities);
+ private PCEPSessionNegotiatorFactory getSessionNegotiatorFactory() {
return new DefaultPCEPSessionNegotiatorFactory(new BasePCEPSessionProposalFactory(deadTimer,
- keepAlive, capabilities), MockPcepSessionErrorPolicy.ZERO);
+ keepAlive, List.of(pcepCapabilities)), MockPcepSessionErrorPolicy.ZERO);
}
}
@NonNull Future<PCEPSession> createClient(@NonNull InetSocketAddress remoteAddress,
long reconnectTime, @NonNull PCEPSessionListenerFactory listenerFactory,
- @NonNull PCEPSessionNegotiatorFactory<? extends PCEPSession> negotiatorFactory, @NonNull KeyMapping keys,
+ @NonNull PCEPSessionNegotiatorFactory negotiatorFactory, @NonNull KeyMapping keys,
@NonNull InetSocketAddress localAddress, @NonNull Uint64 dbVersion);
@NonNull Future<PCEPSession> createClient(@NonNull InetSocketAddress remoteAddress,
long reconnectTime, @NonNull PCEPSessionListenerFactory listenerFactory,
- @NonNull PCEPSessionNegotiatorFactory<? extends PCEPSession> negotiatorFactory, @NonNull KeyMapping keys,
+ @NonNull PCEPSessionNegotiatorFactory negotiatorFactory, @NonNull KeyMapping keys,
@NonNull InetSocketAddress localAddress);
}
@Override
public Future<PCEPSession> createClient(final InetSocketAddress remoteAddress, final long reconnectTime,
- final PCEPSessionListenerFactory listenerFactory,
- final PCEPSessionNegotiatorFactory<? extends PCEPSession> negotiatorFactory, final KeyMapping keys,
- final InetSocketAddress localAddress) {
+ final PCEPSessionListenerFactory listenerFactory, final PCEPSessionNegotiatorFactory negotiatorFactory,
+ final KeyMapping keys, final InetSocketAddress localAddress) {
return createClient(remoteAddress, reconnectTime, listenerFactory, negotiatorFactory, keys, localAddress,
Uint64.ONE);
}
import org.opendaylight.protocol.pcep.impl.BasePCEPSessionProposalFactory;
import org.opendaylight.protocol.pcep.impl.DefaultPCEPSessionNegotiatorFactory;
import org.opendaylight.protocol.pcep.impl.PCEPDispatcherImpl;
-import org.opendaylight.protocol.pcep.impl.PCEPSessionImpl;
import org.opendaylight.protocol.pcep.pcc.mock.api.PCCTunnelManager;
import org.opendaylight.protocol.pcep.pcc.mock.protocol.MockPcepSessionErrorPolicy;
import org.opendaylight.protocol.pcep.pcc.mock.protocol.PCCDispatcherImpl;
Future<PCEPSession> createPCCSession(final Uint64 dbVersion) {
final PCCDispatcherImpl pccDispatcher = new PCCDispatcherImpl(messageRegistry);
- final PCEPSessionNegotiatorFactory<PCEPSessionImpl> snf = getSessionNegotiatorFactory();
+ final PCEPSessionNegotiatorFactory snf = getSessionNegotiatorFactory();
final PCCTunnelManager tunnelManager = new PCCTunnelManagerImpl(3, localAddress.getAddress(),
0, -1, new HashedWheelTimer(), Optional.empty());
}, snf, KeyMapping.of(), localAddress, dbVersion);
}
- private PCEPSessionNegotiatorFactory<PCEPSessionImpl> getSessionNegotiatorFactory() {
+ private PCEPSessionNegotiatorFactory getSessionNegotiatorFactory() {
return new DefaultPCEPSessionNegotiatorFactory(new BasePCEPSessionProposalFactory(DEAD_TIMER, KEEP_ALIVE,
getCapabilities()), MockPcepSessionErrorPolicy.ZERO);
}
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.opendaylight.mdsal.binding.dom.adapter.test.AbstractConcurrentDataBrokerTest;
+import org.opendaylight.protocol.pcep.PCEPSession;
import org.opendaylight.protocol.pcep.impl.DefaultPCEPSessionNegotiator;
import org.opendaylight.protocol.pcep.impl.PCEPSessionImpl;
import org.opendaylight.protocol.util.InetSocketAddressUtil;
@Mock
private PCEPTopologyProviderDependencies topologyDependencies;
@Mock
- private Promise<PCEPSessionImpl> promise;
+ private Promise<PCEPSession> promise;
@Mock
private PcepSessionErrorPolicy errorPolicy;