import org.opendaylight.controller.cluster.datastore.config.ConfigurationImpl;
import org.opendaylight.controller.cluster.datastore.persisted.DatastoreSnapshot;
import org.opendaylight.controller.sal.core.api.model.SchemaService;
+import org.opendaylight.mdsal.dom.api.DOMSchemaService;
import org.osgi.framework.BundleContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class DistributedDataStoreFactory {
private static final Logger LOG = LoggerFactory.getLogger(DistributedDataStoreFactory.class);
+ /**
+ * Create a data store instance.
+ *
+ * @deprecated Use {@link #createInstance(DOMSchemaService, DatastoreContext, DatastoreSnapshotRestore,
+ * ActorSystemProvider, BundleContext)} instead.
+ */
+ @Deprecated
public static AbstractDataStore createInstance(final SchemaService schemaService,
final DatastoreContext initialDatastoreContext, final DatastoreSnapshotRestore datastoreSnapshotRestore,
final ActorSystemProvider actorSystemProvider, final BundleContext bundleContext) {
+ return createInstance((DOMSchemaService) schemaService, initialDatastoreContext, datastoreSnapshotRestore,
+ actorSystemProvider, bundleContext);
+ }
+
+ public static AbstractDataStore createInstance(final DOMSchemaService schemaService,
+ final DatastoreContext initialDatastoreContext, final DatastoreSnapshotRestore datastoreSnapshotRestore,
+ final ActorSystemProvider actorSystemProvider, final BundleContext bundleContext) {
+
final String datastoreName = initialDatastoreContext.getDataStoreName();
LOG.info("Create data store instance of type : {}", datastoreName);
package org.opendaylight.controller.sal.core.api.model;
import org.opendaylight.controller.sal.core.api.BrokerService;
+import org.opendaylight.mdsal.dom.api.DOMSchemaService;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.yang.model.api.Module;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
import org.opendaylight.yangtools.yang.model.api.SchemaContextListener;
/**
- * @deprecated Use {@link org.opendaylight.mdsal.dom.api.DOMSchemaService} instead.
+ * @deprecated Use {@link DOMSchemaService} instead.
*/
@Deprecated
-public interface SchemaService extends BrokerService {
+public interface SchemaService extends BrokerService, DOMSchemaService {
/**
* Registers a YANG module to session and global context
/**
* Returns session specific YANG schema context
*/
+ @Override
SchemaContext getSessionContext();
/**
* Returns global schema context
*/
+ @Override
SchemaContext getGlobalContext();
/**
* @param listener Listener which should be registered
* @return Listener registration handle
*/
+ @Override
ListenerRegistration<SchemaContextListener> registerSchemaContextListener(SchemaContextListener listener);
}
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;
/**
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);
}
* @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);
}
* @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) {