Search in sources :

Example 1 with TlsClientChannelInitializer

use of org.opendaylight.netconf.client.TlsClientChannelInitializer 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;
}
Also used : TlsClientChannelInitializer(org.opendaylight.netconf.client.TlsClientChannelInitializer) HashedWheelTimer(io.netty.util.HashedWheelTimer) NetconfClientSession(org.opendaylight.netconf.client.NetconfClientSession) NetconfClientSessionNegotiatorFactory(org.opendaylight.netconf.client.NetconfClientSessionNegotiatorFactory)

Aggregations

HashedWheelTimer (io.netty.util.HashedWheelTimer)1 NetconfClientSession (org.opendaylight.netconf.client.NetconfClientSession)1 NetconfClientSessionNegotiatorFactory (org.opendaylight.netconf.client.NetconfClientSessionNegotiatorFactory)1 TlsClientChannelInitializer (org.opendaylight.netconf.client.TlsClientChannelInitializer)1