Remove LegacyShardedDOMDataBrokerAdapterUtils 85/77585/4
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 7 Nov 2018 17:50:55 +0000 (18:50 +0100)
committerTom Pantelis <tompantelis@gmail.com>
Fri, 9 Nov 2018 11:55:36 +0000 (11:55 +0000)
LogicalDatastoreType.toMdsal() renders this utility class useless,
remove it.

Change-Id: I0bf6e66f83338fff7d2ab7e54be10a56398c44dc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/legacy/sharded/adapter/LegacyShardedDOMDataBrokerAdapterUtils.java [deleted file]
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/legacy/sharded/adapter/ShardedDOMDataBrokerDelegatingReadTransaction.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/legacy/sharded/adapter/ShardedDOMDataBrokerDelegatingWriteTransaction.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
deleted file mode 100644 (file)
index e4bdc42..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * 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;
-    }
-}
index d3e4d82..98c236a 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.controller.md.sal.dom.broker.impl.legacy.sharded.adapter;
 
 import static com.google.common.base.Preconditions.checkNotNull;
-import static org.opendaylight.controller.md.sal.dom.broker.impl.legacy.sharded.adapter.LegacyShardedDOMDataBrokerAdapterUtils.translateDataStoreType;
 
 import com.google.common.base.Optional;
 import com.google.common.util.concurrent.CheckedFuture;
@@ -44,16 +43,14 @@ class ShardedDOMDataBrokerDelegatingReadTransaction implements DOMDataReadOnlyTr
     @Override
     public CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> read(final LogicalDatastoreType store,
                                                                                    final YangInstanceIdentifier path) {
-        return Futures.makeChecked(delegateTx.read(translateDataStoreType(store), path).transform(
+        return Futures.makeChecked(delegateTx.read(store.toMdsal(), path).transform(
             Optional::fromJavaUtil, MoreExecutors.directExecutor()), ReadFailedException.MAPPER);
     }
 
     @Override
     public CheckedFuture<Boolean, ReadFailedException> exists(final LogicalDatastoreType store,
                                                               final YangInstanceIdentifier path) {
-        return Futures.makeChecked(
-                delegateTx.exists(LegacyShardedDOMDataBrokerAdapterUtils.translateDataStoreType(store), path),
-                ReadFailedException.MAPPER);
+        return Futures.makeChecked(delegateTx.exists(store.toMdsal(), path), ReadFailedException.MAPPER);
     }
 
     @Override
index 853aa71..b6deaea 100644 (file)
@@ -31,13 +31,13 @@ class ShardedDOMDataBrokerDelegatingWriteTransaction implements DOMDataWriteTran
     @Override
     public void put(final LogicalDatastoreType store, final YangInstanceIdentifier path,
                     final NormalizedNode<?, ?> data) {
-        delegateTx.put(LegacyShardedDOMDataBrokerAdapterUtils.translateDataStoreType(store), path, data);
+        delegateTx.put(store.toMdsal(), path, data);
     }
 
     @Override
     public void merge(final LogicalDatastoreType store, final YangInstanceIdentifier path,
                       final NormalizedNode<?, ?> data) {
-        delegateTx.merge(LegacyShardedDOMDataBrokerAdapterUtils.translateDataStoreType(store), path, data);
+        delegateTx.merge(store.toMdsal(), path, data);
     }
 
     @Override
@@ -47,7 +47,7 @@ class ShardedDOMDataBrokerDelegatingWriteTransaction implements DOMDataWriteTran
 
     @Override
     public void delete(final LogicalDatastoreType store, final YangInstanceIdentifier path) {
-        delegateTx.delete(LegacyShardedDOMDataBrokerAdapterUtils.translateDataStoreType(store), path);
+        delegateTx.delete(store.toMdsal(), path);
     }
 
     @Override

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.