1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.jboss.netty.handler.codec.spdy;
17
18 import org.jboss.netty.handler.codec.http.HttpHeaders;
19 import org.jboss.netty.handler.codec.http.HttpMessage;
20
21
22
23
24
25
26 public final class SpdyHttpHeaders {
27
28
29
30
31
32 public static final class Names {
33
34
35
36 public static final String STREAM_ID = "X-SPDY-Stream-ID";
37
38
39
40 public static final String ASSOCIATED_TO_STREAM_ID = "X-SPDY-Associated-To-Stream-ID";
41
42
43
44 public static final String PRIORITY = "X-SPDY-Priority";
45
46
47
48 public static final String URL = "X-SPDY-URL";
49
50
51
52 public static final String SCHEME = "X-SPDY-Scheme";
53
54 private Names() {
55 }
56 }
57
58 private SpdyHttpHeaders() {
59 }
60
61
62
63
64 @Deprecated
65 public static void removeStreamID(HttpMessage message) {
66 removeStreamId(message);
67 }
68
69
70
71
72 public static void removeStreamId(HttpMessage message) {
73 message.removeHeader(Names.STREAM_ID);
74 }
75
76
77
78
79 @Deprecated
80 public static int getStreamID(HttpMessage message) {
81 return getStreamId(message);
82 }
83
84
85
86
87 public static int getStreamId(HttpMessage message) {
88 return HttpHeaders.getIntHeader(message, Names.STREAM_ID);
89 }
90
91
92
93
94 @Deprecated
95 public static void setStreamID(HttpMessage message, int streamId) {
96 setStreamId(message, streamId);
97 }
98
99
100
101
102 public static void setStreamId(HttpMessage message, int streamId) {
103 HttpHeaders.setIntHeader(message, Names.STREAM_ID, streamId);
104 }
105
106
107
108
109 @Deprecated
110 public static void removeAssociatedToStreamID(HttpMessage message) {
111 removeAssociatedToStreamId(message);
112 }
113
114
115
116
117 public static void removeAssociatedToStreamId(HttpMessage message) {
118 message.removeHeader(Names.ASSOCIATED_TO_STREAM_ID);
119 }
120
121
122
123
124 @Deprecated
125 public static int getAssociatedToStreamID(HttpMessage message) {
126 return getAssociatedToStreamId(message);
127 }
128
129
130
131
132
133
134
135 public static int getAssociatedToStreamId(HttpMessage message) {
136 return HttpHeaders.getIntHeader(message, Names.ASSOCIATED_TO_STREAM_ID, 0);
137 }
138
139
140
141
142 @Deprecated
143 public static void setAssociatedToStreamID(HttpMessage message, int associatedToStreamId) {
144 setAssociatedToStreamId(message, associatedToStreamId);
145 }
146
147
148
149
150 public static void setAssociatedToStreamId(HttpMessage message, int associatedToStreamId) {
151 HttpHeaders.setIntHeader(message, Names.ASSOCIATED_TO_STREAM_ID, associatedToStreamId);
152 }
153
154
155
156
157 public static void removePriority(HttpMessage message) {
158 message.removeHeader(Names.PRIORITY);
159 }
160
161
162
163
164
165
166
167 public static byte getPriority(HttpMessage message) {
168 return (byte) HttpHeaders.getIntHeader(message, Names.PRIORITY, 0);
169 }
170
171
172
173
174 public static void setPriority(HttpMessage message, byte priority) {
175 HttpHeaders.setIntHeader(message, Names.PRIORITY, priority);
176 }
177
178
179
180
181 public static void removeUrl(HttpMessage message) {
182 message.removeHeader(Names.URL);
183 }
184
185
186
187
188 public static String getUrl(HttpMessage message) {
189 return message.getHeader(Names.URL);
190 }
191
192
193
194
195 public static void setUrl(HttpMessage message, String url) {
196 message.setHeader(Names.URL, url);
197 }
198
199
200
201
202 public static void removeScheme(HttpMessage message) {
203 message.removeHeader(Names.SCHEME);
204 }
205
206
207
208
209 public static String getScheme(HttpMessage message) {
210 return message.getHeader(Names.SCHEME);
211 }
212
213
214
215
216 public static void setScheme(HttpMessage message, String scheme) {
217 message.setHeader(Names.SCHEME, scheme);
218 }
219 }