org.apache.ratis.thirdparty.io.netty.example.spdy.server.SpdyServerHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ratis-thirdparty-misc
Show all versions of ratis-thirdparty-misc
Miscellaneous thirdparty dependencies for Apache Ratis
/*
* Copyright 2014 The Netty Project
*
* The Netty Project licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package org.apache.ratis.thirdparty.io.netty.example.spdy.server;
import org.apache.ratis.thirdparty.io.netty.buffer.ByteBuf;
import org.apache.ratis.thirdparty.io.netty.buffer.Unpooled;
import org.apache.ratis.thirdparty.io.netty.channel.ChannelFutureListener;
import org.apache.ratis.thirdparty.io.netty.channel.ChannelHandlerContext;
import org.apache.ratis.thirdparty.io.netty.channel.SimpleChannelInboundHandler;
import org.apache.ratis.thirdparty.io.netty.handler.codec.http.DefaultFullHttpResponse;
import org.apache.ratis.thirdparty.io.netty.handler.codec.http.FullHttpResponse;
import org.apache.ratis.thirdparty.io.netty.handler.codec.http.HttpRequest;
import org.apache.ratis.thirdparty.io.netty.util.CharsetUtil;
import java.util.Date;
import static org.apache.ratis.thirdparty.io.netty.handler.codec.http.HttpHeaderNames.CONNECTION;
import static org.apache.ratis.thirdparty.io.netty.handler.codec.http.HttpHeaderNames.CONTENT_LENGTH;
import static org.apache.ratis.thirdparty.io.netty.handler.codec.http.HttpHeaderNames.CONTENT_TYPE;
import static org.apache.ratis.thirdparty.io.netty.handler.codec.http.HttpHeaderValues.CLOSE;
import static org.apache.ratis.thirdparty.io.netty.handler.codec.http.HttpHeaderValues.KEEP_ALIVE;
import static org.apache.ratis.thirdparty.io.netty.handler.codec.http.HttpResponseStatus.CONTINUE;
import static org.apache.ratis.thirdparty.io.netty.handler.codec.http.HttpResponseStatus.OK;
import static org.apache.ratis.thirdparty.io.netty.handler.codec.http.HttpVersion.HTTP_1_0;
import static org.apache.ratis.thirdparty.io.netty.handler.codec.http.HttpVersion.HTTP_1_1;
import static org.apache.ratis.thirdparty.io.netty.handler.codec.http.HttpUtil.is100ContinueExpected;
import static org.apache.ratis.thirdparty.io.netty.handler.codec.http.HttpUtil.isKeepAlive;
/**
* HTTP handler that responds with a "Hello World"
*/
public class SpdyServerHandler extends SimpleChannelInboundHandler