Require maximum chunk size to be specified 22/101922/10
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 29 Jul 2022 16:32:03 +0000 (18:32 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 3 Jul 2023 08:20:35 +0000 (10:20 +0200)
The default incoming chunk size is controlled by session negotiator,
make sure to co-locate the tuneable value there and remove deprecated
constructors for both NetconfChunkAggregator and
AbstractNetconfSessionNegotiator.

Change-Id: Iab489e35e18905c33a747a52c1698ece4e51d3ef
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/AbstractNetconfSessionNegotiator.java
netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/NetconfChunkAggregator.java

index a644150e67a6e5e374f9223379038dbcec9bf37f..65d10ffe9c801f024c7ec8ed67faa84f63293324 100644 (file)
@@ -107,14 +107,6 @@ public abstract class AbstractNetconfSessionNegotiator<S extends AbstractNetconf
         checkArgument(maximumIncomingChunkSize > 0, "Invalid maximum incoming chunk size %s", maximumIncomingChunkSize);
     }
 
-    @Deprecated(since = "4.0.1", forRemoval = true)
-    protected AbstractNetconfSessionNegotiator(final HelloMessage hello, final Promise<S> promise,
-                                               final Channel channel, final Timer timer,
-                                               final L sessionListener, final long connectionTimeoutMillis) {
-        this(hello, promise, channel, timer, sessionListener, connectionTimeoutMillis,
-            DEFAULT_MAXIMUM_INCOMING_CHUNK_SIZE);
-    }
-
     protected final @NonNull HelloMessage localHello() {
         return localHello;
     }
index 49e6a89dfd71c867f59da0087c782983d23b98f8..5e91619c5c6191329d8863d700cd1e9685e45993 100644 (file)
@@ -16,7 +16,6 @@ import io.netty.channel.ChannelHandlerContext;
 import io.netty.handler.codec.ByteToMessageDecoder;
 import java.util.List;
 import org.checkerframework.checker.index.qual.NonNegative;
-import org.opendaylight.netconf.nettyutil.AbstractNetconfSessionNegotiator;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -27,10 +26,6 @@ public class NetconfChunkAggregator extends ByteToMessageDecoder {
     private static final String GOT_PARAM_WHILE_WAITING_FOR_PARAM_PARAM_PARAM =
         "Got byte {} while waiting for {}-{}-{}";
 
-    @Deprecated(since = "4.0.1", forRemoval = true)
-    public static final @NonNegative int DEFAULT_MAXIMUM_CHUNK_SIZE =
-        AbstractNetconfSessionNegotiator.DEFAULT_MAXIMUM_INCOMING_CHUNK_SIZE;
-
     private enum State {
         HEADER_ONE, // \n
         HEADER_TWO, // #
@@ -48,16 +43,6 @@ public class NetconfChunkAggregator extends ByteToMessageDecoder {
     private long chunkSize;
     private CompositeByteBuf chunk;
 
-    /**
-     * Construct an instance with maximum chunk size set to {@link #DEFAULT_MAXIMUM_CHUNK_SIZE}.
-     *
-     * @deprecated Prefer {@link #NetconfChunkAggregator(int)} for fine-grained control.
-     */
-    @Deprecated(since = "4.0.1", forRemoval = true)
-    public NetconfChunkAggregator() {
-        this(DEFAULT_MAXIMUM_CHUNK_SIZE);
-    }
-
     /**
      * Construct an instance with specified maximum chunk size.
      *