Add MountPointNode and its specializations 82/82982/28
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 9 Jul 2019 20:29:38 +0000 (22:29 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 15 Jul 2019 15:20:44 +0000 (17:20 +0200)
MountPointNode is a utility construct to carry a NormalizedNode
tree with mount point content attached.

JIRA: YANGTOOLS-1010
Change-Id: Ie33cd6e566584191d20f942eeb87ce6145e30717
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 files changed:
artifacts/pom.xml
yang/pom.xml
yang/rfc8528-data-api/src/main/java/org/opendaylight/yangtools/rfc8528/data/api/InlineMountPointNode.java [new file with mode: 0644]
yang/rfc8528-data-api/src/main/java/org/opendaylight/yangtools/rfc8528/data/api/InlineMountPointSchemaResolver.java [deleted file]
yang/rfc8528-data-api/src/main/java/org/opendaylight/yangtools/rfc8528/data/api/MountPointNode.java [new file with mode: 0644]
yang/rfc8528-data-api/src/main/java/org/opendaylight/yangtools/rfc8528/data/api/MountPointNodeFactory.java [new file with mode: 0644]
yang/rfc8528-data-api/src/main/java/org/opendaylight/yangtools/rfc8528/data/api/MountPointNodeFactoryResolver.java [new file with mode: 0644]
yang/rfc8528-data-api/src/main/java/org/opendaylight/yangtools/rfc8528/data/api/SharedSchemaMountPointNode.java [new file with mode: 0644]
yang/rfc8528-data-util/pom.xml [new file with mode: 0644]
yang/rfc8528-data-util/src/main/java/org/opendaylight/yangtools/rcf8528/data/util/ImmutableMountPointNode.java [new file with mode: 0644]
yang/rfc8528-model-api/src/main/java/org/opendaylight/yangtools/rfc8528/model/api/MountPointSchemaResolver.java
yang/rfc8528-model-api/src/main/java/org/opendaylight/yangtools/rfc8528/model/api/StaticMountPointSchemaResolver.java [moved from yang/rfc8528-model-api/src/main/java/org/opendaylight/yangtools/rfc8528/model/api/StaticMountpointSchemaResolver.java with 92% similarity]
yang/yang-data-util/src/main/java/org/opendaylight/yangtools/yang/data/util/MountPointData.java

index 6a14ff584f7dac353ad9da864e40e41c0e102454..e761b8020c5a3df7a840548963e8f6022db5fd6b 100644 (file)
                 <artifactId>rfc8528-data-api</artifactId>
                 <version>3.0.3-SNAPSHOT</version>
             </dependency>
+            <dependency>
+                <groupId>org.opendaylight.yangtools</groupId>
+                <artifactId>rfc8528-data-util</artifactId>
+                <version>3.0.3-SNAPSHOT</version>
+            </dependency>
             <dependency>
                 <groupId>org.opendaylight.yangtools</groupId>
                 <artifactId>rfc8528-model-api</artifactId>
index ad0ce209746260811f0a811903e5966bf7da0375..8a6ecac37ce1609d4211a94ba1a51b7bbbec2d9c 100644 (file)
@@ -90,6 +90,7 @@
 
         <!-- RFC8528 (mount-point) metamodel support -->
         <module>rfc8528-data-api</module>
+        <module>rfc8528-data-util</module>
         <module>rfc8528-model-api</module>
         <module>rfc8528-parser-support</module>
     </modules>
diff --git a/yang/rfc8528-data-api/src/main/java/org/opendaylight/yangtools/rfc8528/data/api/InlineMountPointNode.java b/yang/rfc8528-data-api/src/main/java/org/opendaylight/yangtools/rfc8528/data/api/InlineMountPointNode.java
new file mode 100644 (file)
index 0000000..cefd4d3
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2019 PANTHEON.tech s.r.o. 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.yangtools.rfc8528.data.api;
+
+import com.google.common.annotations.Beta;
+import org.eclipse.jdt.annotation.NonNullByDefault;
+
+/**
+ * A mount point with {@code schema-ref} inline, as defined in RFC8528.
+ */
+@Beta
+@NonNullByDefault
+public interface InlineMountPointNode extends MountPointNode {
+
+}
diff --git a/yang/rfc8528-data-api/src/main/java/org/opendaylight/yangtools/rfc8528/data/api/InlineMountPointSchemaResolver.java b/yang/rfc8528-data-api/src/main/java/org/opendaylight/yangtools/rfc8528/data/api/InlineMountPointSchemaResolver.java
deleted file mode 100644 (file)
index 2b58dbe..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2019 PANTHEON.tech s.r.o. 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.yangtools.rfc8528.data.api;
-
-import com.google.common.annotations.Beta;
-import java.util.Optional;
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.jdt.annotation.NonNullByDefault;
-import org.opendaylight.yangtools.rfc8528.model.api.MountPointSchema;
-import org.opendaylight.yangtools.rfc8528.model.api.MountPointSchemaResolver;
-import org.opendaylight.yangtools.rfc8528.model.api.YangLibraryConstants.ContainerName;
-import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import org.opendaylight.yangtools.yang.model.parser.api.YangParserException;
-
-/**
- * A resolver which can resolve the SchemaContext for use with mount point data based on the
- * {@code ietf-yang-library} content of the mountpoint itself. This process requires two steps:
- * <ul>
- *   <li>{@link #findSchemaForLibrary(ContainerName)} is invoked to acquire a SchemaContext in which to interpret
- *       one of the possible {@code ietf-yang-library} top-level containers.
- *   </li>
- *   <li>The container is normalized based on the returned context by the user of this interface and then
- *       {@link LibraryContext#bindTo(ContainerNode)} is invoked to acquire the MountPointMetadata.
- *   </li>
- * </ul>
- */
-@Beta
-public interface InlineMountPointSchemaResolver extends MountPointSchemaResolver {
-    @NonNullByDefault
-    interface LibraryContext {
-        /**
-         * Return a SchemaContext capable of parsing the content of YANG Library.
-         *
-         * @return A SchemaContext instance
-         */
-        SchemaContext getLibraryContainerSchema();
-
-        /**
-         * Assemble the SchemaContext for specified normalized YANG Library top-level container.
-         *
-         * @param container Top-level YANG Library container
-         * @return An assembled SchemaContext
-         * @throws NullPointerException if container is null
-         * @throws YangParserException if the schema context cannot be assembled
-         */
-        MountPointSchema bindTo(ContainerNode container) throws YangParserException;
-    }
-
-    /**
-     * Return the schema in which YANG Library container content should be interpreted.
-     *
-     * <p>
-     * Note this schema is not guaranteed to contain any augmentations, hence parsing could fail.
-     *
-     * @param containerName Top-level YANG Library container name
-     * @return The LibraryContext to use when interpreting the specified YANG Library container, or empty
-     * @throws NullPointerException if container is null
-     */
-    Optional<LibraryContext> findSchemaForLibrary(@NonNull ContainerName containerName);
-
-}
diff --git a/yang/rfc8528-data-api/src/main/java/org/opendaylight/yangtools/rfc8528/data/api/MountPointNode.java b/yang/rfc8528-data-api/src/main/java/org/opendaylight/yangtools/rfc8528/data/api/MountPointNode.java
new file mode 100644 (file)
index 0000000..0646740
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2019 PANTHEON.tech s.r.o. 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.yangtools.rfc8528.data.api;
+
+import com.google.common.annotations.Beta;
+import java.util.Collection;
+import org.eclipse.jdt.annotation.NonNull;
+import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
+import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild;
+import org.opendaylight.yangtools.yang.data.api.schema.DataContainerNode;
+import org.opendaylight.yangtools.yang.data.api.schema.MixinNode;
+import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTree;
+import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.opendaylight.yangtools.yang.model.api.SchemaContextProvider;
+
+/**
+ * Common NormalizedNode representation of a YANG mount point. This interface is not meant to be implemented directly,
+ * but rather used through its specializations like {@link InlineMountPointNode} and {@link SharedSchemaMountPointNode}.
+ *
+ * <p>
+ * Furthermore, these nodes are not meant to be stored in a {@link DataTree} and most NormalizedNode utilities will be
+ * confused when they see them. The purpose of this interface is making data interchange between mount point-aware
+ * components more seamless.
+ */
+@Beta
+public interface MountPointNode extends SchemaContextProvider, MixinNode, DataContainerNode<MountPointIdentifier>,
+        DataContainerChild<MountPointIdentifier, Collection<DataContainerChild<? extends PathArgument, ?>>> {
+    @Override
+    default QName getNodeType() {
+        return getIdentifier().getLabel();
+    }
+
+    @Override
+    // FIXME: remove this override when SchemaContextProvider's method has sane semantics.
+    @NonNull SchemaContext getSchemaContext();
+}
diff --git a/yang/rfc8528-data-api/src/main/java/org/opendaylight/yangtools/rfc8528/data/api/MountPointNodeFactory.java b/yang/rfc8528-data-api/src/main/java/org/opendaylight/yangtools/rfc8528/data/api/MountPointNodeFactory.java
new file mode 100644 (file)
index 0000000..c13eaf1
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2019 PANTHEON.tech s.r.o. 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.yangtools.rfc8528.data.api;
+
+import com.google.common.annotations.Beta;
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.opendaylight.yangtools.rfc8528.model.api.MountPointSchema;
+import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
+
+@Beta
+@NonNullByDefault
+public interface MountPointNodeFactory extends MountPointSchema {
+
+    MountPointNode createMountPoint(ContainerNode delegate);
+}
diff --git a/yang/rfc8528-data-api/src/main/java/org/opendaylight/yangtools/rfc8528/data/api/MountPointNodeFactoryResolver.java b/yang/rfc8528-data-api/src/main/java/org/opendaylight/yangtools/rfc8528/data/api/MountPointNodeFactoryResolver.java
new file mode 100644 (file)
index 0000000..4f89197
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2019 PANTHEON.tech s.r.o. 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.yangtools.rfc8528.data.api;
+
+import com.google.common.annotations.Beta;
+import java.util.Optional;
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.opendaylight.yangtools.rfc8528.model.api.MountPointSchemaResolver;
+import org.opendaylight.yangtools.rfc8528.model.api.StaticMountPointSchemaResolver;
+import org.opendaylight.yangtools.rfc8528.model.api.YangLibraryConstants.ContainerName;
+import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
+import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.opendaylight.yangtools.yang.model.parser.api.YangParserException;
+
+@Beta
+public interface MountPointNodeFactoryResolver extends MountPointSchemaResolver {
+    /**
+     * A resolver which can resolve the SchemaContext for use with mount point data based on the
+     * {@code ietf-yang-library} content of the mountpoint itself. This process requires two steps:
+     * <ul>
+     *   <li>{@link #findSchemaForLibrary(ContainerName)} is invoked to acquire a SchemaContext in which to interpret
+     *       one of the possible {@code ietf-yang-library} top-level containers.
+     *   </li>
+     *   <li>The container is normalized based on the returned context by the user of this interface and then
+     *       {@link LibraryContext#bindTo(ContainerNode)} is invoked to acquire the MountPointMetadata.
+     *   </li>
+     * </ul>
+     */
+    public interface Inline extends MountPointNodeFactoryResolver {
+        @NonNullByDefault
+        interface LibraryContext {
+            /**
+             * Return a SchemaContext capable of parsing the content of YANG Library.
+             *
+             * @return A SchemaContext instance
+             */
+            SchemaContext getLibraryContainerSchema();
+
+            /**
+             * Assemble the SchemaContext for specified normalized YANG Library top-level container.
+             *
+             * @param container Top-level YANG Library container
+             * @return An assembled SchemaContext
+             * @throws NullPointerException if container is null
+             * @throws YangParserException if the schema context cannot be assembled
+             */
+            MountPointNodeFactory bindTo(ContainerNode container) throws YangParserException;
+        }
+
+        /**
+         * Return the schema in which YANG Library container content should be interpreted.
+         *
+         * <p>
+         * Note this schema is not guaranteed to contain any augmentations, hence parsing could fail.
+         *
+         * @param containerName Top-level YANG Library container name
+         * @return The LibraryContext to use when interpreting the specified YANG Library container, or empty
+         * @throws NullPointerException if container is null
+         */
+        Optional<LibraryContext> findSchemaForLibrary(@NonNull ContainerName containerName);
+    }
+
+    @NonNullByDefault
+    interface SharedSchema extends MountPointNodeFactoryResolver, StaticMountPointSchemaResolver {
+
+        @Override
+        MountPointNodeFactory getSchema();
+    }
+}
diff --git a/yang/rfc8528-data-api/src/main/java/org/opendaylight/yangtools/rfc8528/data/api/SharedSchemaMountPointNode.java b/yang/rfc8528-data-api/src/main/java/org/opendaylight/yangtools/rfc8528/data/api/SharedSchemaMountPointNode.java
new file mode 100644 (file)
index 0000000..806c62b
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2019 PANTHEON.tech s.r.o. 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.yangtools.rfc8528.data.api;
+
+import com.google.common.annotations.Beta;
+import org.eclipse.jdt.annotation.NonNullByDefault;
+
+/**
+ * A mount point with {@code schema-ref} shared-schema, as defined in RFC8528.
+ */
+@Beta
+@NonNullByDefault
+public interface SharedSchemaMountPointNode extends MountPointNode {
+    /*
+     * FIXME: consider whether this interface should contain some information based on 'parent-reference':
+     *        - List<YangXPathExpression.QualifiedBound> getParentReference()
+     *        - the node-set required to maintain referential integrity in the subtree of this node
+     */
+}
diff --git a/yang/rfc8528-data-util/pom.xml b/yang/rfc8528-data-util/pom.xml
new file mode 100644 (file)
index 0000000..c7084d0
--- /dev/null
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vi: set et smarttab sw=4 tabstop=4: -->
+<!--
+ Copyright (c) 2019 PANTHEON.tech, s.r.o. 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
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.opendaylight.yangtools</groupId>
+        <artifactId>bundle-parent</artifactId>
+        <version>3.0.3-SNAPSHOT</version>
+        <relativePath>../../bundle-parent</relativePath>
+    </parent>
+
+    <artifactId>rfc8528-data-util</artifactId>
+    <packaging>bundle</packaging>
+    <name>${project.artifactId}</name>
+    <description>RFC8528 data model utilities</description>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.opendaylight.yangtools</groupId>
+            <artifactId>concepts</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.yangtools</groupId>
+            <artifactId>yang-common</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.yangtools</groupId>
+            <artifactId>yang-data-util</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.yangtools</groupId>
+            <artifactId>rfc8528-data-api</artifactId>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <configuration>
+                    <instructions>
+                        <Automatic-Module-Name>org.opendaylight.yangtools.rfc8528.data.util</Automatic-Module-Name>
+                    </instructions>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-checkstyle-plugin</artifactId>
+                <configuration>
+                    <propertyExpansion>checkstyle.violationSeverity=error</propertyExpansion>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>com.github.spotbugs</groupId>
+                <artifactId>spotbugs-maven-plugin</artifactId>
+                <configuration>
+                    <failOnError>true</failOnError>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>
diff --git a/yang/rfc8528-data-util/src/main/java/org/opendaylight/yangtools/rcf8528/data/util/ImmutableMountPointNode.java b/yang/rfc8528-data-util/src/main/java/org/opendaylight/yangtools/rcf8528/data/util/ImmutableMountPointNode.java
new file mode 100644 (file)
index 0000000..667ce0b
--- /dev/null
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2019 PANTHEON.tech s.r.o. 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.yangtools.rcf8528.data.util;
+
+import static java.util.Objects.requireNonNull;
+
+import com.google.common.annotations.Beta;
+import com.google.common.base.MoreObjects.ToStringHelper;
+import java.util.Collection;
+import java.util.Optional;
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.opendaylight.yangtools.concepts.Immutable;
+import org.opendaylight.yangtools.rfc8528.data.api.InlineMountPointNode;
+import org.opendaylight.yangtools.rfc8528.data.api.MountPointIdentifier;
+import org.opendaylight.yangtools.rfc8528.data.api.MountPointNode;
+import org.opendaylight.yangtools.rfc8528.data.api.SharedSchemaMountPointNode;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
+import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
+import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild;
+import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.opendaylight.yangtools.yang.model.util.AbstractIdentifiableSchemaContextProvider;
+
+@Beta
+public abstract class ImmutableMountPointNode<M extends MountPointNode, T extends ImmutableMountPointNode<M, T>>
+        extends AbstractIdentifiableSchemaContextProvider<MountPointIdentifier> implements MountPointNode, Immutable {
+    @NonNullByDefault
+    private static final class Inline extends ImmutableMountPointNode<InlineMountPointNode, Inline>
+            implements InlineMountPointNode {
+
+        Inline(final MountPointIdentifier identifier, final SchemaContext schemaContext, final ContainerNode delegate) {
+            super(identifier, schemaContext, delegate);
+        }
+    }
+
+    @NonNullByDefault
+    private static final class SharedSchema extends ImmutableMountPointNode<SharedSchemaMountPointNode, SharedSchema>
+            implements SharedSchemaMountPointNode {
+
+        SharedSchema(final MountPointIdentifier identifier, final SchemaContext schemaContext,
+                final ContainerNode delegate) {
+            super(identifier, schemaContext, delegate);
+        }
+    }
+
+    private final @NonNull ContainerNode delegate;
+
+    ImmutableMountPointNode(final @NonNull MountPointIdentifier identifier,
+            final @NonNull SchemaContext schemaContext, final @NonNull ContainerNode delegate) {
+        super(schemaContext, identifier);
+        this.delegate = requireNonNull(delegate);
+    }
+
+    public static @NonNull InlineMountPointNode inlineOf(final @NonNull MountPointIdentifier identifier,
+            final @NonNull SchemaContext schemaContext, final @NonNull ContainerNode delegate) {
+        return new Inline(identifier, schemaContext, delegate);
+    }
+
+    public static @NonNull SharedSchemaMountPointNode sharedSchemaOf(final @NonNull MountPointIdentifier identifier,
+            final @NonNull SchemaContext schemaContext, final @NonNull ContainerNode delegate) {
+        return new SharedSchema(identifier, schemaContext, delegate);
+    }
+
+    @Override
+    public final Collection<DataContainerChild<? extends PathArgument, ?>> getValue() {
+        return delegate.getValue();
+    }
+
+    @Override
+    public final Optional<DataContainerChild<? extends PathArgument, ?>> getChild(final PathArgument child) {
+        return delegate.getChild(child);
+    }
+
+    @Override
+    protected ToStringHelper addToStringAttributes(final ToStringHelper helper) {
+        return super.addToStringAttributes(helper).add("delegate", delegate);
+    }
+}
index 3e1917615d36e8dc39dfa42073ddc80ab0a95c3d..4c7a0dd225ef79660edf5a3e70799b9d0d118a89 100644 (file)
@@ -12,7 +12,7 @@ import org.eclipse.jdt.annotation.NonNullByDefault;
 
 /**
  * An entity able to resolve the SchemaContext for embedded mount points. This interface should not be implemented
- * directly, but rather its domain specializations, like {@link StaticMountpointSchemaResolver} should be provided.
+ * directly, but rather its domain specializations, like {@link StaticMountPointSchemaResolver} should be provided.
  */
 @Beta
 @NonNullByDefault
@@ -17,7 +17,7 @@ import org.eclipse.jdt.annotation.NonNullByDefault;
  */
 @Beta
 @NonNullByDefault
-public interface StaticMountpointSchemaResolver extends MountPointSchemaResolver {
+public interface StaticMountPointSchemaResolver extends MountPointSchemaResolver {
 
     MountPointSchema getSchema();
 }
index b5389aff638db43d6627f19b9ef3033f51a3da27..c41f2fd9c3d710e2488df4b4e682b80a274048dd 100644 (file)
@@ -20,13 +20,13 @@ import java.util.Map.Entry;
 import java.util.Optional;
 import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.yangtools.concepts.AbstractIdentifiable;
-import org.opendaylight.yangtools.rfc8528.data.api.InlineMountPointSchemaResolver;
-import org.opendaylight.yangtools.rfc8528.data.api.InlineMountPointSchemaResolver.LibraryContext;
 import org.opendaylight.yangtools.rfc8528.data.api.MountPointIdentifier;
+import org.opendaylight.yangtools.rfc8528.data.api.MountPointNodeFactoryResolver.Inline;
+import org.opendaylight.yangtools.rfc8528.data.api.MountPointNodeFactoryResolver.Inline.LibraryContext;
 import org.opendaylight.yangtools.rfc8528.data.api.MountPointStreamWriter;
 import org.opendaylight.yangtools.rfc8528.model.api.MountPointSchema;
 import org.opendaylight.yangtools.rfc8528.model.api.MountPointSchemaResolver;
-import org.opendaylight.yangtools.rfc8528.model.api.StaticMountpointSchemaResolver;
+import org.opendaylight.yangtools.rfc8528.model.api.StaticMountPointSchemaResolver;
 import org.opendaylight.yangtools.rfc8528.model.api.YangLibraryConstants.ContainerName;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
@@ -74,17 +74,17 @@ public final class MountPointData extends AbstractIdentifiable<MountPointIdentif
         }
 
         final MountPointSchemaResolver resolver = optResolver.get();
-        if (resolver instanceof StaticMountpointSchemaResolver) {
-            writeTo(mountWriter, ((StaticMountpointSchemaResolver) resolver).getSchema());
-        } else if (resolver instanceof InlineMountPointSchemaResolver) {
-            writeInline(mountWriter, (InlineMountPointSchemaResolver) resolver);
+        if (resolver instanceof StaticMountPointSchemaResolver) {
+            writeTo(mountWriter, ((StaticMountPointSchemaResolver) resolver).getSchema());
+        } else if (resolver instanceof Inline) {
+            writeInline(mountWriter, (Inline) resolver);
         } else {
             throw new IOException("Unhandled resolver " + resolver);
         }
     }
 
-    private void writeInline(final @NonNull MountPointStreamWriter mountWriter,
-            final InlineMountPointSchemaResolver resolver) throws IOException {
+    private void writeInline(final @NonNull MountPointStreamWriter mountWriter, final Inline resolver)
+            throws IOException {
         for (Entry<ContainerName, MountPointChild> entry : yangLib.entrySet()) {
             final Optional<LibraryContext> optLibContext = resolver.findSchemaForLibrary(entry.getKey());
             if (!optLibContext.isPresent()) {