import org.opendaylight.controller.md.sal.dom.api.DOMNotificationService;
import org.opendaylight.controller.md.sal.dom.api.DOMRpcService;
import org.opendaylight.controller.sal.core.api.model.SchemaService;
+import org.opendaylight.mdsal.dom.api.DOMSchemaService;
+import org.opendaylight.mdsal.dom.api.DOMYangTextSourceProvider;
import org.opendaylight.netconf.sal.rest.api.RestConnector;
import org.opendaylight.netconf.sal.restconf.impl.jmx.Config;
import org.opendaylight.netconf.sal.restconf.impl.jmx.Delete;
private final IpAddress websocketAddress;
private final PortNumber websocketPort;
private final StatisticsRestconfServiceWrapper stats = StatisticsRestconfServiceWrapper.getInstance();
+ private final DOMSchemaService domSchemaService;
private ListenerRegistration<SchemaContextListener> listenerRegistration;
private Thread webSocketServerThread;
public RestconfProviderImpl(DOMDataBroker domDataBroker, SchemaService schemaService, DOMRpcService rpcService,
DOMNotificationService notificationService, DOMMountPointService mountPointService,
- IpAddress websocketAddress, PortNumber websocketPort) {
+ DOMSchemaService domSchemaService, IpAddress websocketAddress, PortNumber websocketPort) {
super("Draft02ProviderStatistics", "restconf-connector", null);
this.domDataBroker = Preconditions.checkNotNull(domDataBroker);
this.schemaService = Preconditions.checkNotNull(schemaService);
this.mountPointService = Preconditions.checkNotNull(mountPointService);
this.websocketAddress = Preconditions.checkNotNull(websocketAddress);
this.websocketPort = Preconditions.checkNotNull(websocketPort);
+ this.domSchemaService = Preconditions.checkNotNull(domSchemaService);
}
public void start() {
ControllerContext.getInstance().setSchemas(schemaService.getGlobalContext());
ControllerContext.getInstance().setMountService(mountPointService);
+ final DOMYangTextSourceProvider domSchemaServiceExtension =
+ (DOMYangTextSourceProvider) domSchemaService.getSupportedExtensions()
+ .get(DOMYangTextSourceProvider.class);
+ ControllerContext.getInstance().setYangTextSourceProvider(domSchemaServiceExtension);
this.webSocketServerThread = new Thread(WebSocketServer.createInstance(
new String(websocketAddress.getValue()), websocketPort.getValue()));