Deprecate old MD-SAL APIs for removal
[controller.git] / opendaylight / md-sal / sal-inmemory-datastore / src / main / java / org / opendaylight / controller / md / sal / dom / store / impl / InMemoryDOMDataStoreFactory.java
index 2ee8e182c255fef59d8b219fa565473e2e8f362a..8c4352d72bc03b48db65bfab94f28bddfbd621a5 100644 (file)
@@ -7,25 +7,26 @@
  */
 package org.opendaylight.controller.md.sal.dom.store.impl;
 
-import com.google.common.util.concurrent.ListeningExecutorService;
-import com.google.common.util.concurrent.MoreExecutors;
 import java.util.concurrent.ExecutorService;
-import javax.annotation.Nullable;
-import org.opendaylight.controller.sal.core.api.model.SchemaService;
+import org.eclipse.jdt.annotation.Nullable;
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.mdsal.dom.api.DOMSchemaService;
 import org.opendaylight.yangtools.util.concurrent.SpecialExecutors;
 
 /**
  * A factory for creating InMemoryDOMDataStore instances.
  *
  * @author Thomas Pantelis
+ *
+ * @deprecated Use {@link org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStoreFactory} instead.
  */
+@Deprecated(forRemoval = true)
 public final class InMemoryDOMDataStoreFactory {
 
     private InMemoryDOMDataStoreFactory() {
     }
 
-    public static InMemoryDOMDataStore create(final String name,
-            @Nullable final SchemaService schemaService) {
+    public static InMemoryDOMDataStore create(final String name, final @Nullable DOMSchemaService schemaService) {
         return create(name, schemaService, null);
     }
 
@@ -38,25 +39,25 @@ public final class InMemoryDOMDataStoreFactory {
      *                   default property values are used.
      * @return an InMemoryDOMDataStore instance
      */
-    public static InMemoryDOMDataStore create(final String name,
-            @Nullable final SchemaService schemaService,
-            @Nullable final InMemoryDOMDataStoreConfigProperties properties) {
-        return create(name, schemaService, false, properties);
+    public static InMemoryDOMDataStore create(final String name, final @Nullable DOMSchemaService schemaService,
+            final @Nullable InMemoryDOMDataStoreConfigProperties properties) {
+        return create(name, LogicalDatastoreType.OPERATIONAL, schemaService, false, 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,
-            @Nullable final SchemaService schemaService, final boolean debugTransactions,
-            @Nullable final InMemoryDOMDataStoreConfigProperties properties) {
+    public static InMemoryDOMDataStore create(final String name, final LogicalDatastoreType type,
+            final @Nullable DOMSchemaService schemaService, final boolean debugTransactions,
+            final @Nullable InMemoryDOMDataStoreConfigProperties properties) {
 
         InMemoryDOMDataStoreConfigProperties actualProperties = properties;
         if (actualProperties == null) {
@@ -71,11 +72,9 @@ public final class InMemoryDOMDataStoreFactory {
         int dclExecutorMaxPoolSize = actualProperties.getMaxDataChangeExecutorPoolSize();
 
         ExecutorService dataChangeListenerExecutor = SpecialExecutors.newBlockingBoundedFastThreadPool(
-                dclExecutorMaxPoolSize, dclExecutorMaxQueueSize, name + "-DCL" );
+                dclExecutorMaxPoolSize, dclExecutorMaxQueueSize, name + "-DCL", InMemoryDOMDataStore.class);
 
-        final ListeningExecutorService commitExecutor = MoreExecutors.sameThreadExecutor();
-        final InMemoryDOMDataStore dataStore = new InMemoryDOMDataStore(name,
-            commitExecutor, dataChangeListenerExecutor,
+        final InMemoryDOMDataStore dataStore = new InMemoryDOMDataStore(name, type, dataChangeListenerExecutor,
                 actualProperties.getMaxDataChangeListenerQueueSize(), debugTransactions);
 
         if (schemaService != null) {