use of org.opendaylight.netconf.api.NetconfClientSessionPreferences in project netconf by opendaylight.
the class NetconfClientSessionNegotiatorTest method createNetconfClientSessionNegotiator.
private NetconfClientSessionNegotiator createNetconfClientSessionNegotiator(final Promise<NetconfClientSession> promise, final NetconfMessage startExi) {
ChannelProgressivePromise progressivePromise = mock(ChannelProgressivePromise.class);
NetconfClientSessionPreferences preferences = new NetconfClientSessionPreferences(helloMessage, startExi);
doReturn(progressivePromise).when(promise).setFailure(any(Throwable.class));
long timeout = 10L;
NetconfClientSessionListener sessionListener = mock(NetconfClientSessionListener.class);
Timer timer = new HashedWheelTimer();
return new NetconfClientSessionNegotiator(preferences, promise, channel, timer, sessionListener, timeout);
}
use of org.opendaylight.netconf.api.NetconfClientSessionPreferences in project netconf by opendaylight.
the class NetconfClientSessionNegotiatorFactory method getSessionNegotiator.
@Override
public NetconfClientSessionNegotiator getSessionNegotiator(final NetconfSessionListenerFactory<NetconfClientSessionListener> sessionListenerFactory, final Channel channel, final Promise<NetconfClientSession> promise) {
NetconfMessage startExiMessage = NetconfStartExiMessage.create(options, START_EXI_MESSAGE_ID);
NetconfHelloMessage helloMessage = NetconfHelloMessage.createClientHello(clientCapabilities, additionalHeader);
NetconfClientSessionPreferences proposal = new NetconfClientSessionPreferences(helloMessage, startExiMessage);
return new NetconfClientSessionNegotiator(proposal, promise, channel, timer, sessionListenerFactory.getSessionListener(), connectionTimeoutMillis);
}
Aggregations