Tabnine Logo
HttpVersion
Code IndexAdd Tabnine to your IDE (free)

How to use
HttpVersion
in
org.jboss.netty.handler.codec.http

Best Java code snippets using org.jboss.netty.handler.codec.http.HttpVersion (Showing top 20 results out of 315)

origin: io.netty/netty

/**
 * Returns the full protocol version text such as {@code "HTTP/1.0"}.
 */
@Override
public String toString() {
  return getText();
}
origin: io.netty/netty

@Override
public boolean equals(Object o) {
  if (!(o instanceof HttpVersion)) {
    return false;
  }
  HttpVersion that = (HttpVersion) o;
  return getMinorVersion() == that.getMinorVersion() &&
      getMajorVersion() == that.getMajorVersion() &&
      getProtocolName().equals(that.getProtocolName());
}
origin: io.netty/netty

buf.writeBytes(request.getProtocolVersion().toString().getBytes("ASCII"));
buf.writeByte(CR);
buf.writeByte(LF);
origin: org.elasticsearch.plugin/transport-netty3-client

private boolean isHttp10() {
  return nettyRequest.getProtocolVersion().equals(HttpVersion.HTTP_1_0);
}
origin: com.ning/async-http-client

@Override
public String getProtocolName() {
  return response.getProtocolVersion().getProtocolName();
}
origin: com.ning/async-http-client

@Override
public int getProtocolMajorVersion() {
  return response.getProtocolVersion().getMajorVersion();
}
origin: com.ning/async-http-client

@Override
public int getProtocolMinorVersion() {
  return response.getProtocolVersion().getMinorVersion();
}
origin: io.netty/netty

@Override
protected HttpMessage createMessage(String[] initialLine) throws Exception {
  return new DefaultHttpRequest(
      HttpVersion.valueOf(initialLine[2]), HttpMethod.valueOf(initialLine[0]), initialLine[1]);
}
origin: io.netty/netty

/**
 * Returns {@code true} if and only if the connection can remain open and
 * thus 'kept alive'.  This methods respects the value of the
 * {@code "Connection"} header first and then the return value of
 * {@link HttpVersion#isKeepAliveDefault()}.
 */
public static boolean isKeepAlive(HttpMessage message) {
  String connection = message.headers().get(Names.CONNECTION);
  boolean close = Values.CLOSE.equalsIgnoreCase(connection);
  if (close) {
    return false;
  }
  if (message.getProtocolVersion().isKeepAliveDefault()) {
    return !close;
  } else {
    return Values.KEEP_ALIVE.equalsIgnoreCase(connection);
  }
}
origin: gncloud/fastcatsearch

@Override
public void close() {
  boolean http10 = request.getProtocolVersion().equals(HttpVersion.HTTP_1_0);
  boolean close = HttpHeaders.Values.CLOSE.equalsIgnoreCase(request.getHeader(HttpHeaders.Names.CONNECTION))
      || (http10 && !HttpHeaders.Values.KEEP_ALIVE.equalsIgnoreCase(request.getHeader(HttpHeaders.Names.CONNECTION)));
  logger.debug("netty http close = {}", close);
  
  if (close) {
    channel.close();
  }
}
origin: org.asynchttpclient/async-http-client-netty3

@Override
public String getProtocolName() {
  return response.getProtocolVersion().getProtocolName();
}
origin: org.asynchttpclient/async-http-client-netty3

@Override
public int getProtocolMajorVersion() {
  return response.getProtocolVersion().getMajorVersion();
}
origin: org.asynchttpclient/async-http-client-netty3

@Override
public int getProtocolMinorVersion() {
  return response.getProtocolVersion().getMinorVersion();
}
origin: io.netty/netty

/**
 * Returns the {@link HttpVersion} represented by the HTTP version header.
 */
public static HttpVersion getVersion(int spdyVersion, SpdyHeadersFrame frame) {
  try {
    return HttpVersion.valueOf(frame.headers().get(HttpNames.VERSION));
  } catch (Exception e) {
    return null;
  }
}
origin: io.netty/netty

if (message.getProtocolVersion().isKeepAliveDefault()) {
  if (keepAlive) {
    h.remove(Names.CONNECTION);
origin: io.netty/netty

  public int compareTo(HttpVersion o) {
    int v = getProtocolName().compareTo(o.getProtocolName());
    if (v != 0) {
      return v;
    }

    v = getMajorVersion() - o.getMajorVersion();
    if (v != 0) {
      return v;
    }

    return getMinorVersion() - o.getMinorVersion();
  }
}
origin: com.google.code.maven-play-plugin.org.playframework/play

public static boolean isKeepAlive(HttpMessage message) {
  return HttpHeaders.isKeepAlive(message) && message.getProtocolVersion().equals(HttpVersion.HTTP_1_1);
}
origin: io.netty/netty

@Override
public String toString() {
  StringBuilder buf = new StringBuilder();
  buf.append(getClass().getSimpleName());
  buf.append("(version: ");
  buf.append(getProtocolVersion().getText());
  buf.append(", keepAlive: ");
  buf.append(HttpHeaders.isKeepAlive(this));
  buf.append(", chunked: ");
  buf.append(isChunked());
  buf.append(')');
  buf.append(StringUtil.NEWLINE);
  appendHeaders(buf);
  // Remove the last newline.
  buf.setLength(buf.length() - StringUtil.NEWLINE.length());
  return buf.toString();
}
origin: io.netty/netty

  @Override
  protected void encodeInitialLine(ChannelBuffer buf, HttpMessage message)
      throws Exception {
    HttpResponse response = (HttpResponse) message;
    buf.writeBytes(response.getProtocolVersion().toString().getBytes("ASCII"));
    buf.writeByte((byte) ' ');
    buf.writeBytes(String.valueOf(response.getStatus().getCode()).getBytes("ASCII"));
    buf.writeByte((byte) ' ');
    buf.writeBytes(String.valueOf(response.getStatus().getReasonPhrase()).getBytes("ASCII"));
    buf.writeByte((byte) '\r');
    buf.writeByte((byte) '\n');
  }
}
origin: io.gatling/async-http-client

@Override
public String getProtocolName() {
  return response.getProtocolVersion().getProtocolName();
}
org.jboss.netty.handler.codec.httpHttpVersion

Javadoc

The version of HTTP or its derived protocols, such as RTSP and ICAP.

Most used methods

  • equals
  • getText
    Returns the full protocol version text such as "HTTP/1.0".
  • getMajorVersion
    Returns the name of the protocol such as 1 in "HTTP/1.0".
  • getMinorVersion
    Returns the name of the protocol such as 0 in "HTTP/1.0".
  • getProtocolName
    Returns the name of the protocol such as "HTTP" in "HTTP/1.0".
  • toString
    Returns the full protocol version text such as "HTTP/1.0".
  • isKeepAliveDefault
    Returns true if and only if the connection is kept alive unless the "Connection" header is set to "c
  • valueOf
    Returns an existing or new HttpVersion instance which matches to the specified protocol version stri
  • <init>
    Creates a new HTTP version with the specified version string. You will not need to create a new inst
  • compareTo

Popular in Java

  • Making http post requests using okhttp
  • onCreateOptionsMenu (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • setRequestProperty (URLConnection)
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now