2 * Copyright (c) 2019 PANTHEON.tech s.r.o. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.yangtools.rfc8528.data.api;
10 import com.google.common.annotations.Beta;
11 import java.io.IOException;
12 import java.util.Optional;
13 import org.eclipse.jdt.annotation.NonNull;
14 import org.opendaylight.yangtools.rfc8528.model.api.MountPointSchema;
15 import org.opendaylight.yangtools.rfc8528.model.api.MountPointSchemaResolver;
16 import org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter;
17 import org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriterExtension;
20 * A {@link NormalizedNodeStreamWriterExtension} exposed by stream writers which can handle mount point data, notably
21 * providing the facilities to resolve a mount point schema and normalize mount point contents into a normalized
25 public interface MountPointStreamWriter extends NormalizedNodeStreamWriterExtension {
27 * Attempt to acquire a {@link MountPointSchemaResolver} to resolve schemas for the purposes of interpreting this
28 * mount point. An empty result indicates the mount point is not attached.
30 * @param label Mount point label, as defined via the use of {@code mount-point} statement
31 * @return An optional handler for mount point data
32 * @throws NullPointerException if label is null
34 Optional<MountPointSchemaResolver> findMountPoint(@NonNull MountPointIdentifier label);
37 * Start a new mount point with a specific root context.
39 * @param mountSchema Mount point schema
40 * @return A new NormalizedNodeStreamWriter
41 * @throws IOException if an error occurs
43 @NonNull NormalizedNodeStreamWriter startMountPoint(@NonNull MountPointSchema mountSchema) throws IOException;