1 /*
2 * ========================================================================
3 *
4 * Licensed to the Apache Software Foundation (ASF) under one or more
5 * contributor license agreements. See the NOTICE file distributed with
6 * this work for additional information regarding copyright ownership.
7 * The ASF licenses this file to You under the Apache License, Version 2.0
8 * (the "License"); you may not use this file except in compliance with
9 * the License. You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 *
19 * ========================================================================
20 */
21 package org.apache.cactus.internal.client.connector.http;
22
23 import java.net.HttpURLConnection;
24
25 import org.apache.cactus.spi.client.connector.ProtocolState;
26
27 /**
28 * HTTP-specific state information to be passed to the different
29 * {@link org.apache.cactus.spi.client.connector.ProtocolHandler} lifecycle
30 * methods. More specifically, we need to pass around the HTTP connection
31 * object as it is created in the lifecycle method that runs the test
32 * and the it is required in the lifecycle methods that create the
33 * response factory instance and that clean up the test (the HTTP connection
34 * is closed if need be).
35 *
36 * @version $Id: HttpProtocolState.java 238991 2004-05-22 11:34:50Z vmassol $
37 */
38 public class HttpProtocolState implements ProtocolState
39 {
40 /**
41 * HTTP connection that was used to connect to the server side to execute
42 * the test.
43 */
44 private HttpURLConnection connection;
45
46 /**
47 * @param theConnection the HTTP connection that was used to connect to the
48 * server side to execute the test.
49 */
50 public void setConnection(HttpURLConnection theConnection)
51 {
52 this.connection = theConnection;
53 }
54
55 /**
56 * @return the HTTP connection that was used to connect to the server side
57 * to execute the test.
58 */
59 public HttpURLConnection getConnection()
60 {
61 return this.connection;
62 }
63 }