summaryrefslogtreecommitdiffstats
path: root/infra/translate-impl/src/main
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2017-06-08 12:18:08 +0200
committerMarek Gradzki <mgradzki@cisco.com>2017-06-09 07:19:26 +0200
commit0380b9d1f451affec186f197189a4e0ca87336ab (patch)
tree6e0d457e07a685eb1f1f841895a3636f04bc42bd /infra/translate-impl/src/main
parentd500e65e12ce0ceaa59d30283fabde08ee3bffea (diff)
Move ordering logic out of AbstractSubtreeManagerRegistryBuilderBuilder
Introduces YangDAG that maintains topological order for yang schema nodes and can be used by other components to read additional graph edges, e.g. from file (HONEYCOMB-365). Change-Id: Ia3046d38ffb4ca222412309f6c4391afc9315bd2 Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'infra/translate-impl/src/main')
-rw-r--r--infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/registry/CompositeReaderRegistryBuilder.java11
-rw-r--r--infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/write/registry/FlatWriterRegistryBuilder.java7
2 files changed, 13 insertions, 5 deletions
diff --git a/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/registry/CompositeReaderRegistryBuilder.java b/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/registry/CompositeReaderRegistryBuilder.java
index 9163e98de..f8290f166 100644
--- a/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/registry/CompositeReaderRegistryBuilder.java
+++ b/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/registry/CompositeReaderRegistryBuilder.java
@@ -16,6 +16,8 @@
package io.fd.honeycomb.translate.impl.read.registry;
+import static com.google.common.base.Preconditions.checkArgument;
+
import com.google.common.collect.ImmutableMap;
import io.fd.honeycomb.translate.impl.read.GenericListReader;
import io.fd.honeycomb.translate.impl.read.GenericReader;
@@ -26,14 +28,13 @@ import io.fd.honeycomb.translate.read.registry.ModifiableReaderRegistryBuilder;
import io.fd.honeycomb.translate.read.registry.ReaderRegistry;
import io.fd.honeycomb.translate.read.registry.ReaderRegistryBuilder;
import io.fd.honeycomb.translate.util.AbstractSubtreeManagerRegistryBuilderBuilder;
-
+import io.fd.honeycomb.translate.util.YangDAG;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import javax.annotation.Nonnull;
import javax.annotation.concurrent.NotThreadSafe;
-
import org.opendaylight.yangtools.concepts.Builder;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.Identifiable;
@@ -42,8 +43,6 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import static com.google.common.base.Preconditions.checkArgument;
-
@NotThreadSafe
public final class CompositeReaderRegistryBuilder
extends AbstractSubtreeManagerRegistryBuilderBuilder<Reader<? extends DataObject, ? extends Builder<?>>, ReaderRegistry>
@@ -51,6 +50,10 @@ public final class CompositeReaderRegistryBuilder
private static final Logger LOG = LoggerFactory.getLogger(CompositeReaderRegistryBuilder.class);
+ public CompositeReaderRegistryBuilder(@Nonnull final YangDAG yangDAG) {
+ super(yangDAG);
+ }
+
@Override
protected Reader<? extends DataObject, ? extends Builder<?>> getSubtreeHandler(@Nonnull final Set<InstanceIdentifier<?>> handledChildren,
@Nonnull final Reader<? extends DataObject, ? extends Builder<?>> reader) {
diff --git a/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/write/registry/FlatWriterRegistryBuilder.java b/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/write/registry/FlatWriterRegistryBuilder.java
index 936aa3c1e..0c6d0a1b4 100644
--- a/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/write/registry/FlatWriterRegistryBuilder.java
+++ b/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/write/registry/FlatWriterRegistryBuilder.java
@@ -18,11 +18,12 @@ package io.fd.honeycomb.translate.impl.write.registry;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.ImmutableMap;
-import io.fd.honeycomb.translate.write.registry.WriterRegistryBuilder;
import io.fd.honeycomb.translate.util.AbstractSubtreeManagerRegistryBuilderBuilder;
+import io.fd.honeycomb.translate.util.YangDAG;
import io.fd.honeycomb.translate.write.Writer;
import io.fd.honeycomb.translate.write.registry.ModifiableWriterRegistryBuilder;
import io.fd.honeycomb.translate.write.registry.WriterRegistry;
+import io.fd.honeycomb.translate.write.registry.WriterRegistryBuilder;
import java.util.Set;
import java.util.stream.Collectors;
import javax.annotation.Nonnull;
@@ -42,6 +43,10 @@ public final class FlatWriterRegistryBuilder
private static final Logger LOG = LoggerFactory.getLogger(FlatWriterRegistryBuilder.class);
+ public FlatWriterRegistryBuilder(@Nonnull final YangDAG yangDAG) {
+ super(yangDAG);
+ }
+
@Override
protected Writer<? extends DataObject> getSubtreeHandler(final @Nonnull Set<InstanceIdentifier<?>> handledChildren,
final @Nonnull Writer<? extends DataObject> writer) {