View Javadoc
1   /*
2    * Copyright 2015 The Netty Project
3    *
4    * The Netty Project licenses this file to you under the Apache License, version 2.0 (the
5    * "License"); you may not use this file except in compliance with the License. You may obtain a
6    * copy of the License at:
7    *
8    * http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software distributed under the License
11   * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12   * or implied. See the License for the specific language governing permissions and limitations under
13   * the License.
14   */
15  package io.netty.handler.codec.http2;
16  
17  import io.netty.util.internal.UnstableApi;
18  
19  /**
20   * Builds an {@link InboundHttp2ToHttpAdapter}.
21   */
22  @UnstableApi
23  public final class InboundHttp2ToHttpAdapterBuilder
24          extends AbstractInboundHttp2ToHttpAdapterBuilder<InboundHttp2ToHttpAdapter, InboundHttp2ToHttpAdapterBuilder> {
25  
26      /**
27       * Creates a new {@link InboundHttp2ToHttpAdapter} builder for the specified {@link Http2Connection}.
28       *
29       * @param connection the object which will provide connection notification events
30       *                   for the current connection
31       */
32      public InboundHttp2ToHttpAdapterBuilder(Http2Connection connection) {
33          super(connection);
34      }
35  
36      @Override
37      public InboundHttp2ToHttpAdapterBuilder maxContentLength(int maxContentLength) {
38          return super.maxContentLength(maxContentLength);
39      }
40  
41      @Override
42      public InboundHttp2ToHttpAdapterBuilder validateHttpHeaders(boolean validate) {
43          return super.validateHttpHeaders(validate);
44      }
45  
46      @Override
47      public InboundHttp2ToHttpAdapterBuilder propagateSettings(boolean propagate) {
48          return super.propagateSettings(propagate);
49      }
50  
51      @Override
52      public InboundHttp2ToHttpAdapter build() {
53          return super.build();
54      }
55  
56      @Override
57      protected InboundHttp2ToHttpAdapter build(Http2Connection connection,
58                                                int maxContentLength,
59                                                boolean validateHttpHeaders,
60                                                boolean propagateSettings) throws Exception {
61  
62          return new InboundHttp2ToHttpAdapter(connection, maxContentLength,
63                                               validateHttpHeaders, propagateSettings);
64      }
65  }