1 /* 2 * Copyright [2007] [University Corporation for Advanced Internet Development, Inc.] 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package org.opensaml.ws.transport.http; 18 19 import java.util.List; 20 21 import org.opensaml.ws.transport.Transport; 22 23 /** 24 * An HTTP-based transport. 25 */ 26 public interface HTTPTransport extends Transport { 27 28 /** HTTP version identifier. */ 29 public static enum HTTP_VERSION { 30 /** HTTP version 1.0. */ 31 HTTP1_0, 32 33 /** HTTP version 1.1. */ 34 HTTP1_1, 35 }; 36 37 /** 38 * Gets the first value of the header with the given name. 39 * 40 * @param name header name 41 * 42 * @return first value of the header with the given name, or null 43 */ 44 public String getHeaderValue(String name); 45 46 /** 47 * Gets the HTTP method (POST, GET, etc) used. 48 * 49 * @return HTTP method used 50 */ 51 public String getHTTPMethod(); 52 53 /** 54 * Gets the status code of the request. 55 * 56 * @return status code of the request 57 */ 58 public int getStatusCode(); 59 60 /** 61 * Gets the first value of the named parameter. If the request is GET, this is a decoded URL parameter. 62 * If the request is POST-based, it is a parameter from the POST body. 63 * 64 * @param name parameter name 65 * 66 * @return parameter value 67 */ 68 public String getParameterValue(String name); 69 70 /** 71 * Gets the values of the named parameter. If the request is GET, this is a decoded URL parameter. 72 * If the request is POST-based, it is a parameter from the POST body. 73 * 74 * @param name parameter name 75 * 76 * @return parameter values 77 */ 78 public List<String> getParameterValues(String name); 79 80 /** 81 * Gets the HTTP version used to receive the message. 82 * 83 * @return HTTP version used to receive the message 84 */ 85 public HTTP_VERSION getVersion(); 86 }