Merge "Bug 6931 - Fix unsupported specific type of leaf"
[netconf.git] / restconf / sal-rest-connector / src / main / java / org / opendaylight / restconf / RestConnectorProvider.java
index 50012e643b4df92fca954fa7c407fc43f384be58..846320049d4f2bbb46e47698f8cd6967e395d7f3 100644 (file)
@@ -59,6 +59,7 @@ public class RestConnectorProvider implements Provider, RestConnector, AutoClose
     private ListenerRegistration<SchemaContextListener> listenerRegistration;
     private static TransactionChainHandler transactionChainHandler;
     private static DOMDataBroker dataBroker;
+    private static DOMMountPointServiceHandler mountPointServiceHandler;
 
     @Override
     public void onSessionInitiated(final ProviderSession session) {
@@ -69,7 +70,7 @@ public class RestConnectorProvider implements Provider, RestConnector, AutoClose
         final SchemaContextHandler schemaCtxHandler = new SchemaContextHandler();
         this.listenerRegistration = schemaService.registerSchemaContextListener(schemaCtxHandler);
 
-        final DOMMountPointServiceHandler domMountPointServiceHandler = new DOMMountPointServiceHandler(
+        RestConnectorProvider.mountPointServiceHandler = new DOMMountPointServiceHandler(
                 session.getService(DOMMountPointService.class));
 
         RestConnectorProvider.dataBroker = session.getService(DOMDataBroker.class);
@@ -81,7 +82,7 @@ public class RestConnectorProvider implements Provider, RestConnector, AutoClose
         final DOMRpcService rpcService = session.getService(DOMRpcService.class);
         final RpcServiceHandler rpcServiceHandler = new RpcServiceHandler(rpcService);
 
-        wrapperServices.setHandlers(schemaCtxHandler, domMountPointServiceHandler,
+        wrapperServices.setHandlers(schemaCtxHandler, RestConnectorProvider.mountPointServiceHandler,
                 RestConnectorProvider.transactionChainHandler, brokerHandler, rpcServiceHandler);
     }
 
@@ -100,6 +101,14 @@ public class RestConnectorProvider implements Provider, RestConnector, AutoClose
         );
     }
 
+    /**
+     * Get current {@link DOMMountPointService} from {@link DOMMountPointServiceHandler}.
+     * @return {@link DOMMountPointService}
+     */
+    public static DOMMountPointService getMountPointService() {
+        return RestConnectorProvider.mountPointServiceHandler.get();
+    }
+
     @Override
     public Collection<ProviderFunctionality> getProviderFunctionality() {
         return Collections.emptySet();