Save This Page
Home » apache-tomcat-6.0.16-src » org.apache » coyote » http11 » [javadoc | source]
    1   /*
    2    *  Licensed to the Apache Software Foundation (ASF) under one or more
    3    *  contributor license agreements.  See the NOTICE file distributed with
    4    *  this work for additional information regarding copyright ownership.
    5    *  The ASF licenses this file to You under the Apache License, Version 2.0
    6    *  (the "License"); you may not use this file except in compliance with
    7    *  the License.  You may obtain a copy of the License at
    8    *
    9    *      http://www.apache.org/licenses/LICENSE-2.0
   10    *
   11    *  Unless required by applicable law or agreed to in writing, software
   12    *  distributed under the License is distributed on an "AS IS" BASIS,
   13    *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   14    *  See the License for the specific language governing permissions and
   15    *  limitations under the License.
   16    */
   17   
   18   package org.apache.coyote.http11;
   19   
   20   import org.apache.tomcat.util.buf.ByteChunk;
   21   
   22   
   23   /**
   24    * Constants.
   25    *
   26    * @author Remy Maucherat
   27    */
   28   public final class Constants {
   29   
   30   
   31       // -------------------------------------------------------------- Constants
   32   
   33   
   34       /**
   35        * Package name.
   36        */
   37       public static final String Package = "org.apache.coyote.http11";
   38   
   39       public static final int DEFAULT_CONNECTION_LINGER = -1;
   40       public static final int DEFAULT_CONNECTION_TIMEOUT = 60000;
   41       public static final int DEFAULT_CONNECTION_UPLOAD_TIMEOUT = 300000;
   42       public static final int DEFAULT_SERVER_SOCKET_TIMEOUT = 0;
   43       public static final boolean DEFAULT_TCP_NO_DELAY = true;
   44       
   45       
   46       /**
   47        * CRLF.
   48        */
   49       public static final String CRLF = "\r\n";
   50   
   51       
   52       /**
   53        * Server string.
   54        */
   55       public static final byte[] SERVER_BYTES = 
   56           ByteChunk.convertToBytes("Server: Apache-Coyote/1.1" + CRLF);
   57   
   58       
   59       /**
   60        * CR.
   61        */
   62       public static final byte CR = (byte) '\r';
   63   
   64   
   65       /**
   66        * LF.
   67        */
   68       public static final byte LF = (byte) '\n';
   69   
   70   
   71       /**
   72        * SP.
   73        */
   74       public static final byte SP = (byte) ' ';
   75   
   76   
   77       /**
   78        * HT.
   79        */
   80       public static final byte HT = (byte) '\t';
   81   
   82   
   83       /**
   84        * COLON.
   85        */
   86       public static final byte COLON = (byte) ':';
   87       
   88       /**
   89        * SEMI_COLON.
   90        */
   91       public static final byte SEMI_COLON = (byte) ';';
   92   
   93   
   94   
   95       /**
   96        * 'A'.
   97        */
   98       public static final byte A = (byte) 'A';
   99   
  100   
  101       /**
  102        * 'a'.
  103        */
  104       public static final byte a = (byte) 'a';
  105   
  106   
  107       /**
  108        * 'Z'.
  109        */
  110       public static final byte Z = (byte) 'Z';
  111   
  112   
  113       /**
  114        * '?'.
  115        */
  116       public static final byte QUESTION = (byte) '?';
  117   
  118   
  119       /**
  120        * Lower case offset.
  121        */
  122       public static final byte LC_OFFSET = A - a;
  123   
  124   
  125       /**
  126        * Default HTTP header buffer size.
  127        */
  128       public static final int DEFAULT_HTTP_HEADER_BUFFER_SIZE = 48 * 1024;
  129   
  130   
  131       /* Various constant "strings" */
  132       public static final byte[] CRLF_BYTES = ByteChunk.convertToBytes(CRLF);
  133       public static final byte[] COLON_BYTES = ByteChunk.convertToBytes(": ");
  134       public static final String CONNECTION = "Connection";
  135       public static final String CLOSE = "close";
  136       public static final byte[] CLOSE_BYTES = 
  137           ByteChunk.convertToBytes(CLOSE);
  138       public static final String KEEPALIVE = "keep-alive";
  139       public static final byte[] KEEPALIVE_BYTES = 
  140           ByteChunk.convertToBytes(KEEPALIVE);
  141       public static final String CHUNKED = "chunked";
  142       public static final byte[] ACK_BYTES = 
  143           ByteChunk.convertToBytes("HTTP/1.1 100 Continue" + CRLF + CRLF);
  144       public static final String TRANSFERENCODING = "Transfer-Encoding";
  145       public static final byte[] _200_BYTES = 
  146           ByteChunk.convertToBytes("200");
  147       public static final byte[] _400_BYTES = 
  148           ByteChunk.convertToBytes("400");
  149       public static final byte[] _404_BYTES = 
  150           ByteChunk.convertToBytes("404");
  151       
  152   
  153       /**
  154        * Identity filters (input and output).
  155        */
  156       public static final int IDENTITY_FILTER = 0;
  157   
  158   
  159       /**
  160        * Chunked filters (input and output).
  161        */
  162       public static final int CHUNKED_FILTER = 1;
  163   
  164   
  165       /**
  166        * Void filters (input and output).
  167        */
  168       public static final int VOID_FILTER = 2;
  169   
  170   
  171       /**
  172        * GZIP filter (output).
  173        */
  174       public static final int GZIP_FILTER = 3;
  175   
  176   
  177       /**
  178        * Buffered filter (input)
  179        */
  180       public static final int BUFFERED_FILTER = 3;
  181   
  182   
  183       /**
  184        * HTTP/1.0.
  185        */
  186       public static final String HTTP_10 = "HTTP/1.0";
  187   
  188   
  189       /**
  190        * HTTP/1.1.
  191        */
  192       public static final String HTTP_11 = "HTTP/1.1";
  193       public static final byte[] HTTP_11_BYTES = 
  194           ByteChunk.convertToBytes(HTTP_11);
  195   
  196   
  197       /**
  198        * GET.
  199        */
  200       public static final String GET = "GET";
  201   
  202   
  203       /**
  204        * HEAD.
  205        */
  206       public static final String HEAD = "HEAD";
  207   
  208   
  209       /**
  210        * POST.
  211        */
  212       public static final String POST = "POST";
  213   
  214   
  215   }

Save This Page
Home » apache-tomcat-6.0.16-src » org.apache » coyote » http11 » [javadoc | source]