From b767c3e727d51dcaa47ef41538d2201900dbb7ac Mon Sep 17 00:00:00 2001 From: Ruslan Kashapov Date: Mon, 25 Sep 2023 16:31:17 +0300 Subject: [PATCH] Do not use OpenflowProtocolService in ConnectionAdapter 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 Signed-off-by: Robert Varga --- .../api/connection/ConnectionAdapter.java | 217 +++++++++++++++++- 1 file changed, 215 insertions(+), 2 deletions(-) diff --git a/openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/connection/ConnectionAdapter.java b/openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/connection/ConnectionAdapter.java index 9a9e9a3067..a97bf46c96 100644 --- a/openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/connection/ConnectionAdapter.java +++ b/openflowjava/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/connection/ConnectionAdapter.java @@ -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> barrier(BarrierInput input); + + /** + * Invoke {@code echo} RPC. See also {@link Echo}. + * + * @param input of {@code echo} + * @return output of {@code echo} + */ + @NonNull ListenableFuture> 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> echoReply(EchoReplyInput input); + + /** + * Invoke {@code experimenter} RPC. See also {@link Experimenter}. + * + * @param input of {@code experimenter} + * @return output of {@code experimenter} + */ + @NonNull ListenableFuture> 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> 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> 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> 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> 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> 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> groupMod(GroupModInput input); + + /** + * Invoke {@code hello} RPC. See also {@link Hello}. + * + * @param input of {@code hello} + * @return output of {@code hello} + */ + @NonNull ListenableFuture> 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> 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> 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> 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> 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> 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> 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> 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> tableMod(TableModInput input); } -- 2.36.6