Specialize RestconfInvokeOperationsServiceImpl.invokeRpc()
[netconf.git] / restconf / restconf-nb / src / main / java / org / opendaylight / restconf / nb / rfc8040 / databind / StreamableOperationInput.java
1 /*
2  * Copyright (c) 2023 PANTHEON.tech, s.r.o. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.restconf.nb.rfc8040.databind;
9
10 import com.google.common.annotations.Beta;
11 import java.io.IOException;
12 import org.eclipse.jdt.annotation.NonNullByDefault;
13 import org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter;
14 import org.opendaylight.yangtools.yang.model.util.SchemaInferenceStack.Inference;
15
16 /**
17  * Access to an {code rpc}'s or an {@code action}'s input.
18  */
19 @Beta
20 @NonNullByDefault
21 @FunctionalInterface
22 public interface StreamableOperationInput {
23     /**
24      * Stream the {@code input} into a {@link NormalizedNodeStreamWriter}.
25      *
26      * @param inference An {@link Inference} of parent {@code rpc} or {@code action} statement
27      * @param writer Target writer
28      * @throws IOException when an I/O error occurs
29      */
30     // TODO: pass down DatabindContext corresponding to inference
31     void streamTo(Inference inference, NormalizedNodeStreamWriter writer) throws IOException;
32 }