import io.netty.channel.Channel;
import io.netty.util.Timer;
import io.netty.util.concurrent.Promise;
+import java.net.SocketAddress;
import java.util.Set;
import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
import org.opendaylight.controller.netconf.api.NetconfServerSessionPreferences;
}
return new NetconfServerSessionNegotiator(proposal, promise, channel, timer,
- getListener(Long.toString(sessionId)), connectionTimeoutMillis);
+ getListener(Long.toString(sessionId), channel.localAddress()), connectionTimeoutMillis);
}
- private NetconfServerSessionListener getListener(final String netconfSessionIdForReporting) {
- final NetconfOperationService service =
- this.aggregatedOpService.createService(netconfSessionIdForReporting);
+ private NetconfServerSessionListener getListener(final String netconfSessionIdForReporting, final SocketAddress socketAddress) {
+ final NetconfOperationService service = getOperationServiceForAddress(netconfSessionIdForReporting, socketAddress);
final NetconfOperationRouter operationRouter =
new NetconfOperationRouterImpl(service, commitNotificationProducer, monitoringService, netconfSessionIdForReporting);
return new NetconfServerSessionListener(operationRouter, monitoringService, service);
}
+ protected NetconfOperationService getOperationServiceForAddress(final String netconfSessionIdForReporting, final SocketAddress socketAddress) {
+ return this.aggregatedOpService.createService(netconfSessionIdForReporting);
+ }
+
+ protected final NetconfOperationServiceFactory getOperationServiceFactory() {
+ return aggregatedOpService;
+ }
+
private NetconfHelloMessage createHelloMessage(final long sessionId, final NetconfMonitoringService capabilityProvider) throws NetconfDocumentedException {
return NetconfHelloMessage.createServerHello(Sets.union(DefaultCommit.transformCapabilities(capabilityProvider.getCapabilities()), baseCapabilities), sessionId);
}