[MDSAL-773] Generate Rpc specializations Created: 04/Oct/22  Updated: 13/Oct/22  Resolved: 13/Oct/22

Status: Resolved
Project: mdsal
Component/s: Binding codegen, Binding Spec
Affects Version/s: None
Fix Version/s: 11.0.0

Type: Task Priority: Highest
Reporter: Robert Varga Assignee: Robert Varga
Resolution: Done Votes: 0
Labels: pt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Blocks
blocks MDSAL-777 Support single-RPC interfaces in RpcC... Resolved
is blocked by MDSAL-666 Reserve class namespace for RPC defin... Resolved

 Description   

Define a replace for RpcService in a similar vain to what we do for Action, e.g.:

 

@FunctionalInterface
public interface Rpc<I extends RpcInput, O extends RpcOutput> {
    /**
     * Invoke the Rpc.
     *
     * @param input Input argument
     * @return Future result of invocation
     * @throws NullPointerException if any of the arguments are null
     */
    @CheckReturnValue
    @NonNull ListenableFuture<@NonNull RpcResult<@NonNull O>> invoke(@NonNull I input);
} 

And generate its specializations (just like we do for Actions):

@FunctionalInterface
public interface Foo extends Rpc<FooInput, FooOutput> {
    // perhaps private with qname() method?
   public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("foo-act");
} 

 


Generated at Wed Feb 07 20:10:56 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.