01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: *
19: */
20: package org.safehaus.asyncweb.common;
21:
22: import java.util.List;
23: import java.util.Map;
24:
25: /**
26: * Represents a response to an <code>HttpRequest</code>.
27: *
28: * @author irvingd
29: *
30: */
31: public interface HttpResponse extends HttpMessage {
32:
33: /**
34: * Returns the value of the HTTP header with the specified name.
35: * If more than one header with the given name is associated with
36: * this response, one is selected and returned.
37: *
38: * @param name The name of the desired header
39: * @return The header value - or null if no header is found
40: * with the specified name
41: */
42: String getHeader(String name);
43:
44: /**
45: * Returns <tt>true</tt> if the HTTP header with the specified name exists in this response.
46: */
47: boolean containsHeader(String name);
48:
49: /**
50: * Returns the {@link Map} of HTTP headers whose key is a {@link String} and whose value
51: * is a {@link List} of {@link String}s.
52: */
53: Map<String, List<String>> getHeaders();
54:
55: /**
56: * Returns the Content-Type header of the response.
57: */
58: String getContentType();
59:
60: /**
61: * Returns the status of this response
62: */
63: HttpResponseStatus getStatus();
64:
65: /**
66: * Returns the reason phrase which is associated with the current status of this response.
67: */
68: String getStatusReasonPhrase();
69:
70: /**
71: * Returns the content of the response body.
72: */
73: Content getContent();
74: }
|