diff options
author | Maros Marsalek <mmarsale@cisco.com> | 2016-04-12 10:13:25 +0200 |
---|---|---|
committer | Maros Marsalek <mmarsale@cisco.com> | 2016-04-12 10:13:25 +0200 |
commit | abd7814ef36ed9135c6e80b79ece76238d50a39c (patch) | |
tree | 5bc2762890fde439c7896fcf39a70841897968f5 /v3po/data-impl/src/main/java/io | |
parent | 5970b9ec4f014869118026001e933c9847da2509 (diff) |
HONEYCOMB-8: Remove references to VPP from data layer
Change-Id: Ia8ceb1f6e16c5148514ee2add55ff78533d8fe1e
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
Diffstat (limited to 'v3po/data-impl/src/main/java/io')
-rw-r--r-- | v3po/data-impl/src/main/java/io/fd/honeycomb/v3po/data/impl/ConfigDataTree.java (renamed from v3po/data-impl/src/main/java/io/fd/honeycomb/v3po/data/impl/VppConfigDataTree.java) | 43 | ||||
-rw-r--r-- | v3po/data-impl/src/main/java/io/fd/honeycomb/v3po/data/impl/DataBroker.java (renamed from v3po/data-impl/src/main/java/io/fd/honeycomb/v3po/data/impl/VppDataBroker.java) | 35 | ||||
-rw-r--r-- | v3po/data-impl/src/main/java/io/fd/honeycomb/v3po/data/impl/DataTreeUtils.java | 2 | ||||
-rw-r--r-- | v3po/data-impl/src/main/java/io/fd/honeycomb/v3po/data/impl/OperationalDataTree.java (renamed from v3po/data-impl/src/main/java/io/fd/honeycomb/v3po/data/impl/VppOperationalDataTree.java) | 24 | ||||
-rw-r--r-- | v3po/data-impl/src/main/java/io/fd/honeycomb/v3po/data/impl/ReadOnlyTransaction.java (renamed from v3po/data-impl/src/main/java/io/fd/honeycomb/v3po/data/impl/VppReadOnlyTransaction.java) | 20 | ||||
-rw-r--r-- | v3po/data-impl/src/main/java/io/fd/honeycomb/v3po/data/impl/WriteTransaction.java (renamed from v3po/data-impl/src/main/java/io/fd/honeycomb/v3po/data/impl/VppWriteTransaction.java) | 30 |
6 files changed, 77 insertions, 77 deletions
diff --git a/v3po/data-impl/src/main/java/io/fd/honeycomb/v3po/data/impl/VppConfigDataTree.java b/v3po/data-impl/src/main/java/io/fd/honeycomb/v3po/data/impl/ConfigDataTree.java index 6e01306b0..84a1d27e3 100644 --- a/v3po/data-impl/src/main/java/io/fd/honeycomb/v3po/data/impl/VppConfigDataTree.java +++ b/v3po/data-impl/src/main/java/io/fd/honeycomb/v3po/data/impl/ConfigDataTree.java @@ -22,9 +22,9 @@ import static io.fd.honeycomb.v3po.data.impl.DataTreeUtils.childrenFromNormalize import com.google.common.base.Optional; import com.google.common.util.concurrent.CheckedFuture; import com.google.common.util.concurrent.Futures; -import io.fd.honeycomb.v3po.data.ReadableVppDataTree; -import io.fd.honeycomb.v3po.data.VppDataTree; -import io.fd.honeycomb.v3po.data.VppDataTreeSnapshot; +import io.fd.honeycomb.v3po.data.DataTreeSnapshot; +import io.fd.honeycomb.v3po.data.ModifiableDataTree; +import io.fd.honeycomb.v3po.data.ReadableDataTree; import io.fd.honeycomb.v3po.translate.TranslationException; import io.fd.honeycomb.v3po.translate.util.write.TransactionWriteContext; import io.fd.honeycomb.v3po.translate.write.WriteContext; @@ -44,22 +44,21 @@ import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTree; import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidate; import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidateNode; import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeModification; -import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeSnapshot; import org.opendaylight.yangtools.yang.data.api.schema.tree.DataValidationFailedException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** - * VppDataTree implementation for configuration data. + * DataTree implementation for configuration data. */ -public final class VppConfigDataTree implements VppDataTree { +public final class ConfigDataTree implements ModifiableDataTree { - private static final Logger LOG = LoggerFactory.getLogger(VppConfigDataTree.class); + private static final Logger LOG = LoggerFactory.getLogger(ConfigDataTree.class); private final BindingNormalizedNodeSerializer serializer; private final DataTree dataTree; private final WriterRegistry writer; - public static final ReadableVppDataTree EMPTY_OPERATIONAL = new ReadableVppDataTree() { + public static final ReadableDataTree EMPTY_OPERATIONAL = new ReadableDataTree() { @Override public CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> read( @Nonnull final YangInstanceIdentifier path) { @@ -73,22 +72,22 @@ public final class VppConfigDataTree implements VppDataTree { * @param serializer service for serialization between Java Binding Data representation and NormalizedNode * representation. * @param dataTree data tree for configuration data representation - * @param vppWriter service for translation between Java Binding Data and Vpp. + * @param writer service for translation between Java Binding Data and data provider. */ - public VppConfigDataTree(@Nonnull final BindingNormalizedNodeSerializer serializer, - @Nonnull final DataTree dataTree, @Nonnull final WriterRegistry vppWriter) { + public ConfigDataTree(@Nonnull final BindingNormalizedNodeSerializer serializer, + @Nonnull final DataTree dataTree, @Nonnull final WriterRegistry writer) { this.serializer = checkNotNull(serializer, "serializer should not be null"); this.dataTree = checkNotNull(dataTree, "dataTree should not be null"); - this.writer = checkNotNull(vppWriter, "vppWriter should not be null"); + this.writer = checkNotNull(writer, "writer should not be null"); } @Override - public VppDataTreeSnapshot takeSnapshot() { + public DataTreeSnapshot takeSnapshot() { return new ConfigSnapshot(dataTree.takeSnapshot()); } @Override - public void commit(final DataTreeModification modification) + public void modify(final DataTreeModification modification) throws DataValidationFailedException, TranslationException { dataTree.validate(modification); @@ -98,19 +97,19 @@ public final class VppConfigDataTree implements VppDataTree { final YangInstanceIdentifier rootPath = candidate.getRootPath(); final Optional<NormalizedNode<?, ?>> normalizedDataBefore = rootNode.getDataBefore(); final Optional<NormalizedNode<?, ?>> normalizedDataAfter = rootNode.getDataAfter(); - LOG.debug("VppConfigDataTree.commit() rootPath={}, rootNode={}, dataBefore={}, dataAfter={}", + LOG.debug("ConfigDataTree.modify() rootPath={}, rootNode={}, dataBefore={}, dataAfter={}", rootPath, rootNode, normalizedDataBefore, normalizedDataAfter); final Map<InstanceIdentifier<?>, DataObject> nodesBefore = extractNetconfData(normalizedDataBefore); - LOG.debug("VppConfigDataTree.commit() extracted nodesBefore={}", nodesBefore.keySet()); + LOG.debug("ConfigDataTree.modify() extracted nodesBefore={}", nodesBefore.keySet()); final Map<InstanceIdentifier<?>, DataObject> nodesAfter = extractNetconfData(normalizedDataAfter); - LOG.debug("VppConfigDataTree.commit() extracted nodesAfter={}", nodesAfter.keySet()); + LOG.debug("ConfigDataTree.modify() extracted nodesAfter={}", nodesAfter.keySet()); - final DOMDataReadOnlyTransaction beforeTx = new VppReadOnlyTransaction(EMPTY_OPERATIONAL, takeSnapshot()); + final DOMDataReadOnlyTransaction beforeTx = new ReadOnlyTransaction(EMPTY_OPERATIONAL, takeSnapshot()); final ConfigSnapshot modificationSnapshot = new ConfigSnapshot(modification); - final DOMDataReadOnlyTransaction afterTx = new VppReadOnlyTransaction(EMPTY_OPERATIONAL, modificationSnapshot); + final DOMDataReadOnlyTransaction afterTx = new ReadOnlyTransaction(EMPTY_OPERATIONAL, modificationSnapshot); try(final WriteContext ctx = new TransactionWriteContext(serializer, beforeTx, afterTx)) { writer.update(nodesBefore, nodesAfter, ctx); } catch (io.fd.honeycomb.v3po.translate.write.WriterRegistry.BulkUpdateException e) { @@ -144,10 +143,10 @@ public final class VppConfigDataTree implements VppDataTree { return Collections.emptyMap(); } - private final static class ConfigSnapshot implements VppDataTreeSnapshot { - private final DataTreeSnapshot snapshot; + private final static class ConfigSnapshot implements DataTreeSnapshot { + private final org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeSnapshot snapshot; - ConfigSnapshot(@Nonnull final DataTreeSnapshot snapshot) { + ConfigSnapshot(@Nonnull final org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeSnapshot snapshot) { this.snapshot = snapshot; } diff --git a/v3po/data-impl/src/main/java/io/fd/honeycomb/v3po/data/impl/VppDataBroker.java b/v3po/data-impl/src/main/java/io/fd/honeycomb/v3po/data/impl/DataBroker.java index 5c5248cea..7b4d93baa 100644 --- a/v3po/data-impl/src/main/java/io/fd/honeycomb/v3po/data/impl/VppDataBroker.java +++ b/v3po/data-impl/src/main/java/io/fd/honeycomb/v3po/data/impl/DataBroker.java @@ -17,9 +17,9 @@ package io.fd.honeycomb.v3po.data.impl; import com.google.common.base.Preconditions; -import io.fd.honeycomb.v3po.data.ReadableVppDataTree; -import io.fd.honeycomb.v3po.data.VppDataTree; -import io.fd.honeycomb.v3po.data.VppDataTreeSnapshot; +import io.fd.honeycomb.v3po.data.ReadableDataTree; +import io.fd.honeycomb.v3po.data.ModifiableDataTree; +import io.fd.honeycomb.v3po.data.DataTreeSnapshot; import java.util.Collections; import java.util.Map; import javax.annotation.Nonnull; @@ -37,42 +37,43 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; /** - * Data Broker which provides data transaction functionality for VPP using {@link NormalizedNode} data format. + * Data Broker which provides data transaction functionality for YANG capable data provider + * using {@link NormalizedNode} data format. */ -public class VppDataBroker implements DOMDataBroker { +public class DataBroker implements DOMDataBroker { - private final ReadableVppDataTree operationalData; - private final VppDataTree configDataTree; + private final ReadableDataTree operationalData; + private final ModifiableDataTree configDataTree; /** - * Creates VppDataBroker instance. + * Creates DataBroker instance. * - * @param operationalData VPP operational data - * @param configDataTree VPP configuration data + * @param operationalData operational data + * @param configDataTree configuration data */ - public VppDataBroker(@Nonnull final ReadableVppDataTree operationalData, - @Nonnull final VppDataTree configDataTree) { + public DataBroker(@Nonnull final ReadableDataTree operationalData, + @Nonnull final ModifiableDataTree configDataTree) { this.operationalData = Preconditions.checkNotNull(operationalData, "operationalData should not be null"); this.configDataTree = Preconditions.checkNotNull(configDataTree, "configDataProxy should not be null"); } @Override public DOMDataReadOnlyTransaction newReadOnlyTransaction() { - return new VppReadOnlyTransaction(operationalData, configDataTree.takeSnapshot()); + return new ReadOnlyTransaction(operationalData, configDataTree.takeSnapshot()); } @Override public DOMDataReadWriteTransaction newReadWriteTransaction() { // todo use the same snapshot - final VppDataTreeSnapshot configSnapshot = configDataTree.takeSnapshot(); - final DOMDataReadOnlyTransaction readOnlyTx = new VppReadOnlyTransaction(operationalData, configSnapshot); - final DOMDataWriteTransaction writeOnlyTx = new VppWriteTransaction(configDataTree, configSnapshot); + final DataTreeSnapshot configSnapshot = configDataTree.takeSnapshot(); + final DOMDataReadOnlyTransaction readOnlyTx = new ReadOnlyTransaction(operationalData, configSnapshot); + final DOMDataWriteTransaction writeOnlyTx = new WriteTransaction(configDataTree, configSnapshot); return new ReadWriteTransaction(readOnlyTx, writeOnlyTx); } @Override public DOMDataWriteTransaction newWriteOnlyTransaction() { - return new VppWriteTransaction(configDataTree); + return new WriteTransaction(configDataTree); } @Override diff --git a/v3po/data-impl/src/main/java/io/fd/honeycomb/v3po/data/impl/DataTreeUtils.java b/v3po/data-impl/src/main/java/io/fd/honeycomb/v3po/data/impl/DataTreeUtils.java index 83ed0f263..39e841f9a 100644 --- a/v3po/data-impl/src/main/java/io/fd/honeycomb/v3po/data/impl/DataTreeUtils.java +++ b/v3po/data-impl/src/main/java/io/fd/honeycomb/v3po/data/impl/DataTreeUtils.java @@ -62,7 +62,7 @@ final class DataTreeUtils { for (final DataContainerChild<? extends YangInstanceIdentifier.PathArgument, ?> child : children) { final YangInstanceIdentifier.PathArgument pathArgument = child.getIdentifier(); final YangInstanceIdentifier identifier = YangInstanceIdentifier.create(pathArgument); - LOG.debug("VppConfigDataProxy.extractDataObject() child={}, pathArgument={}, identifier={}", child, + LOG.debug("DataTreeUtils.childrenFromNormalized() child={}, pathArgument={}, identifier={}", child, pathArgument, identifier); final Map.Entry<InstanceIdentifier<?>, DataObject> entry = serializer.fromNormalizedNode(identifier, child); diff --git a/v3po/data-impl/src/main/java/io/fd/honeycomb/v3po/data/impl/VppOperationalDataTree.java b/v3po/data-impl/src/main/java/io/fd/honeycomb/v3po/data/impl/OperationalDataTree.java index fc13606e6..21672b48b 100644 --- a/v3po/data-impl/src/main/java/io/fd/honeycomb/v3po/data/impl/VppOperationalDataTree.java +++ b/v3po/data-impl/src/main/java/io/fd/honeycomb/v3po/data/impl/OperationalDataTree.java @@ -26,7 +26,7 @@ import com.google.common.collect.Collections2; import com.google.common.collect.Multimap; import com.google.common.util.concurrent.CheckedFuture; import com.google.common.util.concurrent.Futures; -import io.fd.honeycomb.v3po.data.ReadableVppDataTree; +import io.fd.honeycomb.v3po.data.ReadableDataTree; import io.fd.honeycomb.v3po.translate.Context; import io.fd.honeycomb.v3po.translate.read.ReadContext; import io.fd.honeycomb.v3po.translate.read.ReadFailedException; @@ -56,10 +56,10 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** - * ReadableVppDataTree implementation for operational data. + * ReadableDataTree implementation for operational data. */ -public final class VppOperationalDataTree implements ReadableVppDataTree { - private static final Logger LOG = LoggerFactory.getLogger(VppOperationalDataTree.class); +public final class OperationalDataTree implements ReadableDataTree { + private static final Logger LOG = LoggerFactory.getLogger(OperationalDataTree.class); private final BindingNormalizedNodeSerializer serializer; private final ReaderRegistry readerRegistry; @@ -71,10 +71,10 @@ public final class VppOperationalDataTree implements ReadableVppDataTree { * @param serializer service for serialization between Java Binding Data representation and NormalizedNode * representation. * @param globalContext service for obtaining top level context data from all yang modules. - * @param readerRegistry service responsible for translation between DataObjects and VPP APIs. + * @param readerRegistry service responsible for translation between DataObjects and data provider. */ - public VppOperationalDataTree(@Nonnull BindingNormalizedNodeSerializer serializer, - @Nonnull final SchemaContext globalContext, @Nonnull ReaderRegistry readerRegistry) { + public OperationalDataTree(@Nonnull BindingNormalizedNodeSerializer serializer, + @Nonnull final SchemaContext globalContext, @Nonnull ReaderRegistry readerRegistry) { this.globalContext = checkNotNull(globalContext, "serializer should not be null"); this.serializer = checkNotNull(serializer, "serializer should not be null"); this.readerRegistry = checkNotNull(readerRegistry, "reader should not be null"); @@ -101,10 +101,10 @@ public final class VppOperationalDataTree implements ReadableVppDataTree { private Optional<NormalizedNode<?, ?>> readNode(final YangInstanceIdentifier yangInstanceIdentifier, final ReadContext ctx) throws ReadFailedException { - LOG.debug("VppOperationalDataTree.readNode(), yangInstanceIdentifier={}", yangInstanceIdentifier); + LOG.debug("OperationalDataTree.readNode(), yangInstanceIdentifier={}", yangInstanceIdentifier); final InstanceIdentifier<?> path = serializer.fromYangInstanceIdentifier(yangInstanceIdentifier); checkNotNull(path, "Invalid instance identifier %s. Cannot create BA equivalent.", yangInstanceIdentifier); - LOG.debug("VppOperationalDataTree.readNode(), path={}", path); + LOG.debug("OperationalDataTree.readNode(), path={}", path); final Optional<? extends DataObject> dataObject; @@ -118,7 +118,7 @@ public final class VppOperationalDataTree implements ReadableVppDataTree { } private Optional<NormalizedNode<?, ?>> readRoot(final ReadContext ctx) throws ReadFailedException { - LOG.debug("VppOperationalDataTree.readRoot()"); + LOG.debug("OperationalDataTree.readRoot()"); final DataContainerNodeAttrBuilder<YangInstanceIdentifier.NodeIdentifier, ContainerNode> dataNodeBuilder = Builders.containerBuilder() @@ -182,11 +182,11 @@ public final class VppOperationalDataTree implements ReadableVppDataTree { return new Function<DataObject, NormalizedNode<?, ?>>() { @Override public NormalizedNode<?, ?> apply(@Nullable final DataObject dataObject) { - LOG.trace("VppOperationalDataTree.toNormalizedNode(), path={}, dataObject={}", path, dataObject); + LOG.trace("OperationalDataTree.toNormalizedNode(), path={}, dataObject={}", path, dataObject); final Map.Entry<YangInstanceIdentifier, NormalizedNode<?, ?>> entry = serializer.toNormalizedNode(path, dataObject); - LOG.trace("VppOperationalDataTree.toNormalizedNode(), normalizedNodeEntry={}", entry); + LOG.trace("OperationalDataTree.toNormalizedNode(), normalizedNodeEntry={}", entry); return entry.getValue(); } }; diff --git a/v3po/data-impl/src/main/java/io/fd/honeycomb/v3po/data/impl/VppReadOnlyTransaction.java b/v3po/data-impl/src/main/java/io/fd/honeycomb/v3po/data/impl/ReadOnlyTransaction.java index db01591b9..83c9e30bd 100644 --- a/v3po/data-impl/src/main/java/io/fd/honeycomb/v3po/data/impl/VppReadOnlyTransaction.java +++ b/v3po/data-impl/src/main/java/io/fd/honeycomb/v3po/data/impl/ReadOnlyTransaction.java @@ -22,8 +22,8 @@ import com.google.common.base.Preconditions; import com.google.common.util.concurrent.CheckedFuture; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; -import io.fd.honeycomb.v3po.data.ReadableVppDataTree; -import io.fd.honeycomb.v3po.data.VppDataTreeSnapshot; +import io.fd.honeycomb.v3po.data.ReadableDataTree; +import io.fd.honeycomb.v3po.data.DataTreeSnapshot; import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType; @@ -34,14 +34,14 @@ import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -final class VppReadOnlyTransaction implements DOMDataReadOnlyTransaction { +final class ReadOnlyTransaction implements DOMDataReadOnlyTransaction { - private static final Logger LOG = LoggerFactory.getLogger(VppReadOnlyTransaction.class); - private volatile ReadableVppDataTree operationalData; - private volatile VppDataTreeSnapshot configSnapshot; + private static final Logger LOG = LoggerFactory.getLogger(ReadOnlyTransaction.class); + private volatile ReadableDataTree operationalData; + private volatile DataTreeSnapshot configSnapshot; - VppReadOnlyTransaction(@Nonnull final ReadableVppDataTree operationalData, - @Nonnull final VppDataTreeSnapshot configSnapshot) { + ReadOnlyTransaction(@Nonnull final ReadableDataTree operationalData, + @Nonnull final DataTreeSnapshot configSnapshot) { this.operationalData = Preconditions.checkNotNull(operationalData, "operationalData should not be null"); this.configSnapshot = Preconditions.checkNotNull(configSnapshot, "config should not be null"); } @@ -56,7 +56,7 @@ final class VppReadOnlyTransaction implements DOMDataReadOnlyTransaction { public CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> read( final LogicalDatastoreType store, final YangInstanceIdentifier path) { - LOG.debug("VppReadOnlyTransaction.read(), store={}, path={}", store, path); + LOG.debug("ReadOnlyTransaction.read(), store={}, path={}", store, path); Preconditions.checkState(configSnapshot != null, "Transaction was closed"); @@ -70,7 +70,7 @@ final class VppReadOnlyTransaction implements DOMDataReadOnlyTransaction { @Override public CheckedFuture<Boolean, ReadFailedException> exists(final LogicalDatastoreType store, final YangInstanceIdentifier path) { - LOG.debug("VppReadOnlyTransaction.exists() store={}, path={}", store, path); + LOG.debug("ReadOnlyTransaction.exists() store={}, path={}", store, path); ListenableFuture<Boolean> listenableFuture = Futures.transform(read(store, path), IS_NODE_PRESENT); diff --git a/v3po/data-impl/src/main/java/io/fd/honeycomb/v3po/data/impl/VppWriteTransaction.java b/v3po/data-impl/src/main/java/io/fd/honeycomb/v3po/data/impl/WriteTransaction.java index c9766eb21..fbeba7e07 100644 --- a/v3po/data-impl/src/main/java/io/fd/honeycomb/v3po/data/impl/VppWriteTransaction.java +++ b/v3po/data-impl/src/main/java/io/fd/honeycomb/v3po/data/impl/WriteTransaction.java @@ -26,8 +26,8 @@ import com.google.common.base.Preconditions; import com.google.common.util.concurrent.CheckedFuture; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; -import io.fd.honeycomb.v3po.data.VppDataTree; -import io.fd.honeycomb.v3po.data.VppDataTreeSnapshot; +import io.fd.honeycomb.v3po.data.ModifiableDataTree; +import io.fd.honeycomb.v3po.data.DataTreeSnapshot; import io.fd.honeycomb.v3po.translate.TranslationException; import javax.annotation.Nonnull; import javax.annotation.concurrent.NotThreadSafe; @@ -44,15 +44,15 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; @NotThreadSafe -final class VppWriteTransaction implements DOMDataWriteTransaction { +final class WriteTransaction implements DOMDataWriteTransaction { - private static final Logger LOG = LoggerFactory.getLogger(VppWriteTransaction.class); - private final VppDataTree configDataTree; + private static final Logger LOG = LoggerFactory.getLogger(WriteTransaction.class); + private final ModifiableDataTree configDataTree; private DataTreeModification modification; private TransactionStatus status; - VppWriteTransaction(@Nonnull final VppDataTree configDataTree, - @Nonnull final VppDataTreeSnapshot configSnapshot) { + WriteTransaction(@Nonnull final ModifiableDataTree configDataTree, + @Nonnull final DataTreeSnapshot configSnapshot) { this.configDataTree = Preconditions.checkNotNull(configDataTree, "configDataTree should not be null"); Preconditions.checkNotNull(configSnapshot, "configSnapshot should not be null"); // initialize transaction state: @@ -60,7 +60,7 @@ final class VppWriteTransaction implements DOMDataWriteTransaction { status = NEW; } - VppWriteTransaction(@Nonnull final VppDataTree configDataTree) { + WriteTransaction(@Nonnull final ModifiableDataTree configDataTree) { this(configDataTree, configDataTree.takeSnapshot()); } @@ -70,13 +70,13 @@ final class VppWriteTransaction implements DOMDataWriteTransaction { private void checkIsNew() { Preconditions.checkState(status == NEW, "Transaction was submitted or canceled"); - Preconditions.checkState(modification != null, "VPPDataTree modification should not be null"); + Preconditions.checkState(modification != null, "DataTree modification should not be null"); } @Override public void put(final LogicalDatastoreType store, final YangInstanceIdentifier path, final NormalizedNode<?, ?> data) { - LOG.debug("VppWriteTransaction.put() store={}, path={}, data={}", store, path, data); + LOG.debug("WriteTransaction.put() store={}, path={}, data={}", store, path, data); checkIsNew(); checkConfigurationWrite(store); modification.write(path, data); @@ -85,7 +85,7 @@ final class VppWriteTransaction implements DOMDataWriteTransaction { @Override public void merge(final LogicalDatastoreType store, final YangInstanceIdentifier path, final NormalizedNode<?, ?> data) { - LOG.debug("VppWriteTransaction.merge() store={}, path={}, data={}", store, path, data); + LOG.debug("WriteTransaction.merge() store={}, path={}, data={}", store, path, data); checkIsNew(); checkConfigurationWrite(store); modification.merge(path, data); @@ -105,7 +105,7 @@ final class VppWriteTransaction implements DOMDataWriteTransaction { @Override public void delete(LogicalDatastoreType store, final YangInstanceIdentifier path) { - LOG.debug("VppWriteTransaction.delete() store={}, path={}", store, path); + LOG.debug("WriteTransaction.delete() store={}, path={}", store, path); checkIsNew(); checkConfigurationWrite(store); modification.delete(path); @@ -113,7 +113,7 @@ final class VppWriteTransaction implements DOMDataWriteTransaction { @Override public CheckedFuture<Void, TransactionCommitFailedException> submit() { - LOG.debug("VppWriteTransaction.submit()"); + LOG.debug("WriteTransaction.submit()"); checkIsNew(); // seal transaction: @@ -121,11 +121,11 @@ final class VppWriteTransaction implements DOMDataWriteTransaction { status = SUBMITED; try { - configDataTree.commit(modification); + configDataTree.modify(modification); status = COMMITED; } catch (DataValidationFailedException | TranslationException e) { status = FAILED; - LOG.error("Failed to commit VPP state modification", e); + LOG.error("Failed modify data tree", e); return Futures.immediateFailedCheckedFuture( new TransactionCommitFailedException("Failed to validate DataTreeModification", e)); } finally { |