Update documentation to use ListenableFuture 76/85576/1
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 5 Nov 2019 11:07:21 +0000 (12:07 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 5 Nov 2019 11:09:12 +0000 (12:09 +0100)
RPC methods have been using ListenableFuture for quite a while now,
update the documentation to reflect that.

Change-Id: Iffbba13e87343bd655d48b8a28ab3b54306a5d18
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
docs/developer-guide/developing-apps-on-the-opendaylight-controller.rst

index dc3b9e11159eba6e425a4c91329d8683d874274d..d4e0249ab72b40d766bebb2a9958b73173091e28 100644 (file)
@@ -172,9 +172,9 @@ Defining a Simple Hello World RPC
     .. code:: java
 
         @Override
-            public void onSessionInitiated(ProviderContext session) {
-                LOG.info("HelloProvider Session Initiated");
-            }
+        public void onSessionInitiated(ProviderContext session) {
+            LOG.info("HelloProvider Session Initiated");
+        }
 
 Add a simple HelloWorld RPC API
 -------------------------------
@@ -236,7 +236,7 @@ Implement the HelloWorld RPC API
 
        package org.opendaylight.hello.impl;
 
-       import java.util.concurrent.Future;
+       import com.google.common.util.concurrent.ListenableFuture;
        import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.hello.rev150105.HelloService;
        import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.hello.rev150105.HelloWorldInput;
        import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.hello.rev150105.HelloWorldOutput;
@@ -247,7 +247,7 @@ Implement the HelloWorld RPC API
        public class HelloWorldImpl implements HelloService {
 
            @Override
-           public Future<RpcResult<HelloWorldOutput>> helloWorld(HelloWorldInput input) {
+           public ListenableFuture<RpcResult<HelloWorldOutput>> helloWorld(HelloWorldInput input) {
                HelloWorldOutputBuilder helloBuilder = new HelloWorldOutputBuilder();
                helloBuilder.setGreeting("Hello " + input.getName());
                return RpcResultBuilder.success(helloBuilder.build()).buildFuture();