Retrofit DOMSchemaService into SchemaService
[controller.git] / opendaylight / md-sal / sal-inmemory-datastore / src / main / java / org / opendaylight / controller / md / sal / dom / store / impl / InMemoryDOMDataStoreFactory.java
index 6423544aad8c195fe85a59faa0fa13828627cdb2..d2297f28c9c08d87655b41043caa4d194ef0ee40 100644 (file)
@@ -11,6 +11,7 @@ import java.util.concurrent.ExecutorService;
 import javax.annotation.Nullable;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.controller.sal.core.api.model.SchemaService;
+import org.opendaylight.mdsal.dom.api.DOMSchemaService;
 import org.opendaylight.yangtools.util.concurrent.SpecialExecutors;
 
 /**
@@ -23,8 +24,17 @@ public final class InMemoryDOMDataStoreFactory {
     private InMemoryDOMDataStoreFactory() {
     }
 
+    /**
+     * @deprecated Use {@link #create(String, DOMSchemaService)} instead.
+     */
+    @Deprecated
     public static InMemoryDOMDataStore create(final String name,
             @Nullable final SchemaService schemaService) {
+        return create(name, (DOMSchemaService)schemaService);
+    }
+
+    public static InMemoryDOMDataStore create(final String name,
+            @Nullable final DOMSchemaService schemaService) {
         return create(name, schemaService, null);
     }
 
@@ -36,10 +46,28 @@ public final class InMemoryDOMDataStoreFactory {
      * @param properties configuration properties for the InMemoryDOMDataStore instance. If null,
      *                   default property values are used.
      * @return an InMemoryDOMDataStore instance
+     *
+     * @deprecated Use {@link #create(String, DOMSchemaService, InMemoryDOMDataStoreConfigProperties)} instead.
      */
+    @Deprecated
     public static InMemoryDOMDataStore create(final String name,
             @Nullable final SchemaService schemaService,
             @Nullable final InMemoryDOMDataStoreConfigProperties properties) {
+        return create(name, (DOMSchemaService) schemaService, properties);
+    }
+
+    /**
+     * Creates an InMemoryDOMDataStore instance.
+     *
+     * @param name the name of the data store
+     * @param schemaService the SchemaService to which to register the data store.
+     * @param properties configuration properties for the InMemoryDOMDataStore instance. If null,
+     *                   default property values are used.
+     * @return an InMemoryDOMDataStore instance
+     */
+    public static InMemoryDOMDataStore create(final String name,
+            @Nullable final DOMSchemaService schemaService,
+            @Nullable final InMemoryDOMDataStoreConfigProperties properties) {
         return create(name, LogicalDatastoreType.OPERATIONAL, schemaService, false, properties);
     }
 
@@ -73,10 +101,31 @@ public final class InMemoryDOMDataStoreFactory {
      * @param properties configuration properties for the InMemoryDOMDataStore instance. If null,
      *                   default property values are used.
      * @return an InMemoryDOMDataStore instance
+     *
+     * @deprecated Use {@link #create(String, LogicalDatastoreType, DOMSchemaService, boolean,
+     *                                InMemoryDOMDataStoreConfigProperties)} instead.
      */
+    @Deprecated
     public static InMemoryDOMDataStore create(final String name, final LogicalDatastoreType type,
             @Nullable final SchemaService schemaService, final boolean debugTransactions,
             @Nullable final InMemoryDOMDataStoreConfigProperties properties) {
+        return create(name, type, (DOMSchemaService) schemaService, debugTransactions, properties);
+    }
+
+    /**
+     * Creates an InMemoryDOMDataStore instance.
+     *
+     * @param name the name of the data store
+     * @param type Data store type
+     * @param schemaService the SchemaService to which to register the data store.
+     * @param debugTransactions enable transaction debugging
+     * @param properties configuration properties for the InMemoryDOMDataStore instance. If null,
+     *                   default property values are used.
+     * @return an InMemoryDOMDataStore instance
+     */
+    public static InMemoryDOMDataStore create(final String name, final LogicalDatastoreType type,
+            @Nullable final DOMSchemaService schemaService, final boolean debugTransactions,
+            @Nullable final InMemoryDOMDataStoreConfigProperties properties) {
 
         InMemoryDOMDataStoreConfigProperties actualProperties = properties;
         if (actualProperties == null) {