comparison src/org/eclipse/jetty/http/HttpHeaderValues.java @ 999:74b9daf2826c

simplify Response
author Franklin Schmidt <fschmidt@gmail.com>
date Wed, 19 Oct 2016 00:59:46 -0600
parents 3428c60d7cfc
children 6be43ef1eb96
comparison
equal deleted inserted replaced
998:bf176925e00f 999:74b9daf2826c
30 * 30 *
31 * 31 *
32 */ 32 */
33 public class HttpHeaderValues extends BufferCache 33 public class HttpHeaderValues extends BufferCache
34 { 34 {
35 public final static String 35 public final static String
36 CLOSE="close", 36 CLOSE="close",
37 CHUNKED="chunked", 37 CHUNKED="chunked",
38 GZIP="gzip", 38 GZIP="gzip",
39 IDENTITY="identity", 39 IDENTITY="identity",
40 KEEP_ALIVE="keep-alive", 40 KEEP_ALIVE="keep-alive",
41 CONTINUE="100-continue", 41 CONTINUE="100-continue",
42 PROCESSING="102-processing", 42 PROCESSING="102-processing",
43 TE="TE", 43 TE="TE",
44 BYTES="bytes", 44 BYTES="bytes",
45 NO_CACHE="no-cache", 45 NO_CACHE="no-cache",
46 UPGRADE="Upgrade"; 46 UPGRADE="Upgrade";
47 47
48 public final static int 48 public final static int
49 CLOSE_ORDINAL=1, 49 CLOSE_ORDINAL=1,
50 CHUNKED_ORDINAL=2, 50 CHUNKED_ORDINAL=2,
51 GZIP_ORDINAL=3, 51 GZIP_ORDINAL=3,
52 IDENTITY_ORDINAL=4, 52 IDENTITY_ORDINAL=4,
53 KEEP_ALIVE_ORDINAL=5, 53 KEEP_ALIVE_ORDINAL=5,
54 CONTINUE_ORDINAL=6, 54 CONTINUE_ORDINAL=6,
55 PROCESSING_ORDINAL=7, 55 PROCESSING_ORDINAL=7,
56 TE_ORDINAL=8, 56 TE_ORDINAL=8,
57 BYTES_ORDINAL=9, 57 BYTES_ORDINAL=9,
58 NO_CACHE_ORDINAL=10, 58 NO_CACHE_ORDINAL=10,
59 UPGRADE_ORDINAL=11; 59 UPGRADE_ORDINAL=11;
60 60
61 public final static HttpHeaderValues CACHE= new HttpHeaderValues(); 61 public final static HttpHeaderValues CACHE = new HttpHeaderValues();
62 62
63 public final static Buffer 63 public final static Buffer
64 CLOSE_BUFFER=CACHE.add(CLOSE,CLOSE_ORDINAL), 64 CLOSE_BUFFER=CACHE.add(CLOSE,CLOSE_ORDINAL),
65 CHUNKED_BUFFER=CACHE.add(CHUNKED,CHUNKED_ORDINAL), 65 CHUNKED_BUFFER=CACHE.add(CHUNKED,CHUNKED_ORDINAL),
66 GZIP_BUFFER=CACHE.add(GZIP,GZIP_ORDINAL), 66 GZIP_BUFFER=CACHE.add(GZIP,GZIP_ORDINAL),
67 IDENTITY_BUFFER=CACHE.add(IDENTITY,IDENTITY_ORDINAL), 67 IDENTITY_BUFFER=CACHE.add(IDENTITY,IDENTITY_ORDINAL),
68 KEEP_ALIVE_BUFFER=CACHE.add(KEEP_ALIVE,KEEP_ALIVE_ORDINAL), 68 KEEP_ALIVE_BUFFER=CACHE.add(KEEP_ALIVE,KEEP_ALIVE_ORDINAL),
69 CONTINUE_BUFFER=CACHE.add(CONTINUE, CONTINUE_ORDINAL), 69 CONTINUE_BUFFER=CACHE.add(CONTINUE, CONTINUE_ORDINAL),
70 PROCESSING_BUFFER=CACHE.add(PROCESSING, PROCESSING_ORDINAL), 70 PROCESSING_BUFFER=CACHE.add(PROCESSING, PROCESSING_ORDINAL),
71 TE_BUFFER=CACHE.add(TE,TE_ORDINAL), 71 TE_BUFFER=CACHE.add(TE,TE_ORDINAL),
72 BYTES_BUFFER=CACHE.add(BYTES,BYTES_ORDINAL), 72 BYTES_BUFFER=CACHE.add(BYTES,BYTES_ORDINAL),
73 NO_CACHE_BUFFER=CACHE.add(NO_CACHE,NO_CACHE_ORDINAL), 73 NO_CACHE_BUFFER=CACHE.add(NO_CACHE,NO_CACHE_ORDINAL),
74 UPGRADE_BUFFER=CACHE.add(UPGRADE,UPGRADE_ORDINAL); 74 UPGRADE_BUFFER=CACHE.add(UPGRADE,UPGRADE_ORDINAL);
75 75
76 76
77 public static boolean hasKnownValues(int httpHeaderOrdinal) 77 public static boolean hasKnownValues(int httpHeaderOrdinal)
78 { 78 {
79 switch(httpHeaderOrdinal) 79 switch(httpHeaderOrdinal)
80 { 80 {
81 case HttpHeaders.CONNECTION_ORDINAL: 81 case HttpHeaders.CONNECTION_ORDINAL:
82 case HttpHeaders.TRANSFER_ENCODING_ORDINAL: 82 case HttpHeaders.TRANSFER_ENCODING_ORDINAL:
83 case HttpHeaders.CONTENT_ENCODING_ORDINAL: 83 case HttpHeaders.CONTENT_ENCODING_ORDINAL:
84 return true; 84 return true;
85 } 85 }
86 return false; 86 return false;
87 } 87 }
88 } 88 }