Example usage for io.netty.handler.codec.http HttpVersion protocolName

List of usage examples for io.netty.handler.codec.http HttpVersion protocolName

Introduction

In this page you can find the example usage for io.netty.handler.codec.http HttpVersion protocolName.

Prototype

String protocolName

To view the source code for io.netty.handler.codec.http HttpVersion protocolName.

Click Source Link

Usage

From source file:com.titilink.camel.rest.common.AdapterRestletUtil.java

License:LGPL

protected static Protocol parseToRestletProtocol(HttpVersion protocol) {
    if (null == protocol) {
        LOGGER.error("protocol=null");
        return null;
    }//from  w  w  w.j a  v a2 s . co  m
    final String schemeName = protocol.protocolName();
    Protocol restletProtocol = new Protocol(schemeName, schemeName.toUpperCase(),
            schemeName.toUpperCase() + " Protocol", "", Protocol.UNKNOWN_PORT, false,
            getProtocolVersion(protocol));
    return restletProtocol;
}

From source file:reactor.io.net.impl.netty.http.NettyHttpChannel.java

License:Open Source License

@Override
public Protocol protocol() {
    HttpVersion version = this.nettyRequest.getProtocolVersion();
    if (version.equals(HttpVersion.HTTP_1_0)) {
        return Protocol.HTTP_1_0;
    } else if (version.equals(HttpVersion.HTTP_1_1)) {
        return Protocol.HTTP_1_1;
    }//w  ww  . ja  v  a  2s.  co  m
    throw new IllegalStateException(version.protocolName() + " not supported");
}

From source file:reactor.ipc.netty.http.client.HttpClientOperations.java

License:Open Source License

@Override
public final HttpVersion version() {
    HttpVersion version = this.nettyRequest.protocolVersion();
    if (version.equals(HttpVersion.HTTP_1_0)) {
        return HttpVersion.HTTP_1_0;
    } else if (version.equals(HttpVersion.HTTP_1_1)) {
        return HttpVersion.HTTP_1_1;
    }//from  ww  w  .  j  av a  2s . c  o  m
    throw new IllegalStateException(version.protocolName() + " not supported");
}

From source file:rxweb.engine.server.netty.NettyServerRequestAdapter.java

License:Apache License

@Override
public Protocol getProtocol() {
    HttpVersion version = this.nettyRequest.getProtocolVersion();
    if (version.equals(HttpVersion.HTTP_1_0)) {
        return Protocol.HTTP_1_0;
    } else if (version.equals(HttpVersion.HTTP_1_1)) {
        return Protocol.HTTP_2_0;
    }/*from ww  w.  j a  v a 2 s  .c o  m*/
    throw new IllegalStateException(version.protocolName() + " not supported");
}