X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=transport%2Ftransport-http%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fnetconf%2Ftransport%2Fhttp%2FClientHttp1RequestDispatcher.java;fp=transport%2Ftransport-http%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fnetconf%2Ftransport%2Fhttp%2FClientHttp1RequestDispatcher.java;h=e6a59f9d4f9ef5c542a93b796c6ed9ebd8f58049;hb=e55255954ebfc7ff510513bb2bff31e156a33042;hp=0000000000000000000000000000000000000000;hpb=2c347423e1684f28b9dea56b6517055294174b3a;p=netconf.git diff --git a/transport/transport-http/src/main/java/org/opendaylight/netconf/transport/http/ClientHttp1RequestDispatcher.java b/transport/transport-http/src/main/java/org/opendaylight/netconf/transport/http/ClientHttp1RequestDispatcher.java new file mode 100644 index 0000000000..e6a59f9d4f --- /dev/null +++ b/transport/transport-http/src/main/java/org/opendaylight/netconf/transport/http/ClientHttp1RequestDispatcher.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2024 PANTHEON.tech s.r.o. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.netconf.transport.http; + +import com.google.common.util.concurrent.ListenableFuture; +import com.google.common.util.concurrent.SettableFuture; +import io.netty.channel.Channel; +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.SimpleChannelInboundHandler; +import io.netty.handler.codec.http.FullHttpRequest; +import io.netty.handler.codec.http.FullHttpResponse; +import java.util.Queue; +import java.util.concurrent.ConcurrentLinkedQueue; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Client side {@link RequestDispatcher} implementation for HTTP 1.1. + * + *
+ * Serves as gateway to Netty {@link Channel}, performs sending requests to server, returns server responses associated.
+ * Uses request to response mapping via queue -- first accepted response is associated with first request sent.
+ */
+class ClientHttp1RequestDispatcher extends SimpleChannelInboundHandler