Bug 5700 - Backwards compatibility of sharding api's with old api's
[controller.git] / opendaylight / md-sal / sal-dom-broker / src / main / java / org / opendaylight / controller / md / sal / dom / broker / impl / legacy / sharded / adapter / LegacyShardedDOMDataBrokerAdapterUtils.java
diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/legacy/sharded/adapter/LegacyShardedDOMDataBrokerAdapterUtils.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/legacy/sharded/adapter/LegacyShardedDOMDataBrokerAdapterUtils.java
new file mode 100644 (file)
index 0000000..b1779db
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.controller.md.sal.dom.broker.impl.legacy.sharded.adapter;
+
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+
+final class LegacyShardedDOMDataBrokerAdapterUtils {
+
+    private LegacyShardedDOMDataBrokerAdapterUtils() {
+        throw new AssertionError("Util class should not be instantiated");
+    }
+
+    public static org.opendaylight.mdsal.common.api.LogicalDatastoreType translateDataStoreType(final LogicalDatastoreType store) {
+        return store.equals(LogicalDatastoreType.CONFIGURATION) ?
+                org.opendaylight.mdsal.common.api.LogicalDatastoreType.CONFIGURATION :
+                org.opendaylight.mdsal.common.api.LogicalDatastoreType.OPERATIONAL;
+    }
+}