+++ /dev/null
-/*
- * 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;
- }
-}
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;
@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
@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
@Override
public void delete(final LogicalDatastoreType store, final YangInstanceIdentifier path) {
- delegateTx.delete(LegacyShardedDOMDataBrokerAdapterUtils.translateDataStoreType(store), path);
+ delegateTx.delete(store.toMdsal(), path);
}
@Override