Do not use OpenflowProtocolService in ConnectionAdapter 83/107983/5
authorRuslan Kashapov <ruslan.kashapov@pantheon.tech>
Mon, 25 Sep 2023 13:31:17 +0000 (16:31 +0300)
committerRobert Varga <nite@hq.sk>
Thu, 8 Feb 2024 19:55:11 +0000 (19:55 +0000)
OpenflowProtocolService is very convenient, as it defines all the RPCs
that a connection can provide.

That interface is going away, so replicate these definitions in
ConnectionAdapter.

JIRA: OPNFLWPLUG-1125
Change-Id: Ib74c20c08c338088de2cff3ad23de83811a5bc53
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/connection/ConnectionAdapter.java

index 9a9e9a3067428f307e6da76ebd8de76d5bad69b9..a97bf46c96e378f711feda45532c0a8ef05efb9b 100644 (file)
@@ -8,20 +8,79 @@
 package org.opendaylight.openflowjava.protocol.api.connection;
 
 import com.google.common.annotations.Beta;
+import com.google.common.util.concurrent.ListenableFuture;
 import java.math.BigInteger;
 import java.net.InetSocketAddress;
 import java.security.cert.X509Certificate;
 import java.util.List;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Future;
+import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.jdt.annotation.NonNullByDefault;
 import org.eclipse.jdt.annotation.Nullable;
 import org.opendaylight.openflowjava.protocol.api.extensibility.AlienMessageListener;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.Barrier;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.Echo;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoReply;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoReplyInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoReplyOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.Experimenter;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ExperimenterInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ExperimenterOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowMod;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowModInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowModOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetAsync;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetAsyncInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetAsyncOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetConfig;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetConfigInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetConfigOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeatures;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfig;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GroupMod;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GroupModInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GroupModOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.Hello;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MeterMod;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MeterModInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MeterModOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequest;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OpenflowProtocolListener;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OpenflowProtocolService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketOut;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketOutInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketOutOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortMod;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortModInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortModOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.RoleRequest;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.RoleRequestInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.RoleRequestOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.SetAsync;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.SetAsyncInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.SetAsyncOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.SetConfig;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.SetConfigInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.SetConfigOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.TableMod;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.TableModInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.TableModOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.system.rev130927.DisconnectEvent;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.system.rev130927.SslConnectionError;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.system.rev130927.SwitchIdleEvent;
+import org.opendaylight.yangtools.yang.common.RpcResult;
 
 /**
  * Manages a switch connection.
@@ -29,7 +88,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.system.rev130927.S
  * @author mirehak
  * @author michal.polkorab
  */
-public interface ConnectionAdapter extends OpenflowProtocolService {
+public interface ConnectionAdapter {
     @NonNullByDefault
     interface SystemListener {
         void onDisconnect(DisconnectEvent disconnect);
@@ -150,4 +209,158 @@ public interface ConnectionAdapter extends OpenflowProtocolService {
      * @param executorService for all dpns
      */
     void setExecutorService(ExecutorService executorService);
+
+    // Access to individual requests one can make on a connection.
+
+    /**
+     * Invoke {@code barrier} RPC. See also {@link Barrier}.
+     *
+     * @param input of {@code barrier}
+     * @return output of {@code barrier}
+     */
+    @NonNull ListenableFuture<RpcResult<BarrierOutput>> barrier(BarrierInput input);
+
+    /**
+     * Invoke {@code echo} RPC. See also {@link Echo}.
+     *
+     * @param input of {@code echo}
+     * @return output of {@code echo}
+     */
+    @NonNull ListenableFuture<RpcResult<EchoOutput>> echo(EchoInput input);
+
+    /**
+     * Invoke {@code echo-reply} RPC. See also {@link EchoReply}.
+     *
+     * @param input of {@code echo-reply}
+     * @return output of {@code echo-reply}
+     */
+    @NonNull ListenableFuture<RpcResult<EchoReplyOutput>> echoReply(EchoReplyInput input);
+
+    /**
+     * Invoke {@code experimenter} RPC. See also {@link Experimenter}.
+     *
+     * @param input of {@code experimenter}
+     * @return output of {@code experimenter}
+     */
+    @NonNull ListenableFuture<RpcResult<ExperimenterOutput>> experimenter(ExperimenterInput input);
+
+    /**
+     * Invoke {@code flow-mod} RPC. See also {@link FlowMod}.
+     *
+     * @param input of {@code flow-mod}
+     * @return output of {@code flow-mod}
+     */
+    @NonNull ListenableFuture<RpcResult<FlowModOutput>> flowMod(FlowModInput input);
+
+    /**
+     * Invoke {@code get-async} RPC. See also {@link GetAsync}.
+     *
+     * @param input of {@code get-async}
+     * @return output of {@code get-async}
+     */
+    @NonNull ListenableFuture<RpcResult<GetAsyncOutput>> getAsync(GetAsyncInput input);
+
+    /**
+     * Invoke {@code get-config} RPC. See also {@link GetConfig}.
+     *
+     * @param input of {@code get-config}
+     * @return output of {@code get-config}
+     */
+    @NonNull ListenableFuture<RpcResult<GetConfigOutput>> getConfig(GetConfigInput input);
+
+    /**
+     * Invoke {@code get-features} RPC. See also {@link GetFeatures}.
+     *
+     * @param input of {@code get-features}
+     * @return output of {@code get-features}
+     */
+    @NonNull ListenableFuture<RpcResult<GetFeaturesOutput>> getFeatures(GetFeaturesInput input);
+
+    /**
+     * Invoke {@code get-queue-config} RPC. See also {@link GetQueueConfig}.
+     *
+     * @param input of {@code get-queue-config}
+     * @return output of {@code get-queue-config}
+     */
+    @NonNull ListenableFuture<RpcResult<GetQueueConfigOutput>> getQueueConfig(GetQueueConfigInput input);
+
+    /**
+     * Invoke {@code group-mod} RPC. See also {@link GroupMod}.
+     *
+     * @param input of {@code group-mod}
+     * @return output of {@code group-mod}
+     */
+    @NonNull ListenableFuture<RpcResult<GroupModOutput>> groupMod(GroupModInput input);
+
+    /**
+     * Invoke {@code hello} RPC. See also {@link Hello}.
+     *
+     * @param input of {@code hello}
+     * @return output of {@code hello}
+     */
+    @NonNull ListenableFuture<RpcResult<HelloOutput>> hello(HelloInput input);
+
+    /**
+     * Invoke {@code meter-mod} RPC. See also {@link MeterMod}.
+     *
+     * @param input of {@code meter-mod}
+     * @return output of {@code meter-mod}
+     */
+    @NonNull ListenableFuture<RpcResult<MeterModOutput>> meterMod(MeterModInput input);
+
+    /**
+     * Invoke {@code multipart-request} RPC. See also {@link MultipartRequest}.
+     *
+     * @param input of {@code multipart-request}
+     * @return output of {@code multipart-request}
+     */
+    @NonNull ListenableFuture<RpcResult<MultipartRequestOutput>> multipartRequest(MultipartRequestInput input);
+
+    /**
+     * Invoke {@code packet-out} RPC. See also {@link PacketOut}.
+     *
+     * @param input of {@code packet-out}
+     * @return output of {@code packet-out}
+     */
+    @NonNull ListenableFuture<RpcResult<PacketOutOutput>> packetOut(PacketOutInput input);
+
+    /**
+     * Invoke {@code port-mod} RPC. See also {@link PortMod}.
+     *
+     * @param input of {@code port-mod}
+     * @return output of {@code port-mod}
+     */
+    @NonNull ListenableFuture<RpcResult<PortModOutput>> portMod(PortModInput input);
+
+    /**
+     * Invoke {@code role-request} RPC. See also {@link RoleRequest}.
+     *
+     * @param input of {@code role-request}
+     * @return output of {@code role-request}
+     */
+    @NonNull ListenableFuture<RpcResult<RoleRequestOutput>> roleRequest(RoleRequestInput input);
+
+    /**
+     * Invoke {@code set-async} RPC. See also {@link SetAsync}.
+     *
+     * @param input of {@code set-async}
+     * @return output of {@code set-async}
+     */
+    @NonNull ListenableFuture<RpcResult<SetAsyncOutput>> setAsync(SetAsyncInput input);
+
+    /**
+     * Invoke {@code set-config} RPC. See also {@link SetConfig}.
+     *
+     * @param input of {@code set-config}
+     * @return output of {@code set-config}
+     */
+    @NonNull ListenableFuture<RpcResult<SetConfigOutput>> setConfig(SetConfigInput input);
+
+    /**
+     * Invoke {@code table-mod} RPC. See also {@link TableMod}.
+     *
+     * @param input of {@code table-mod}
+     * @return output of {@code table-mod}
+     */
+    @NonNull ListenableFuture<RpcResult<TableModOutput>> tableMod(TableModInput input);
 }