use of org.opendaylight.netconf.client.NetconfClientSessionNegotiatorFactory in project netconf by opendaylight.
the class CallHomeTlsSessionContext method doActivate.
private Promise<NetconfClientSession> doActivate(final Channel ch, final NetconfClientSessionListener listener) {
final Promise<NetconfClientSession> activationPromise = newSessionPromise();
if (activated.compareAndExchange(false, true)) {
return activationPromise.setFailure(new IllegalStateException("Session (channel) already activated."));
}
LOG.info("Activating Netconf channel for {} with {}", getRemoteAddress(), listener);
final NetconfClientSessionNegotiatorFactory negotiatorFactory = new NetconfClientSessionNegotiatorFactory(new HashedWheelTimer(), Optional.empty(), TimeUnit.SECONDS.toMillis(5));
final TlsClientChannelInitializer tlsClientChannelInitializer = new TlsClientChannelInitializer(sslHandlerFactory, negotiatorFactory, listener);
tlsClientChannelInitializer.initialize(ch, activationPromise);
return activationPromise;
}
Aggregations