View Javadoc
1   /*
2    * ====================================================================
3    * Licensed to the Apache Software Foundation (ASF) under one
4    * or more contributor license agreements.  See the NOTICE file
5    * distributed with this work for additional information
6    * regarding copyright ownership.  The ASF licenses this file
7    * to you under the Apache License, Version 2.0 (the
8    * "License"); you may not use this file except in compliance
9    * with 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,
14   * software distributed under the License is distributed on an
15   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16   * KIND, either express or implied.  See the License for the
17   * specific language governing permissions and limitations
18   * under the License.
19   * ====================================================================
20   *
21   * This software consists of voluntary contributions made by many
22   * individuals on behalf of the Apache Software Foundation.  For more
23   * information on the Apache Software Foundation, please see
24   * <http://www.apache.org/>.
25   *
26   */
27  
28  package org.apache.http.client.params;
29  
30  import java.util.Collection;
31  
32  import org.apache.http.Header;
33  import org.apache.http.HttpHost;
34  import org.apache.http.params.HttpAbstractParamBean;
35  import org.apache.http.params.HttpParams;
36  
37  /**
38   * This is a Java Bean class that can be used to wrap an instance of
39   * {@link HttpParams} and manipulate HTTP client parameters using
40   * Java Beans conventions.
41   *
42   * @since 4.0
43   *
44   * @deprecated (4.3) use {@link org.apache.http.client.config.RequestConfig}.
45   */
46  @Deprecated
47  public class ClientParamBean extends HttpAbstractParamBean {
48  
49      public ClientParamBean (final HttpParams params) {
50          super(params);
51      }
52  
53      /**
54       * @deprecated (4.2)  do not use.
55       */
56      @Deprecated
57      public void setConnectionManagerFactoryClassName (final String factory) {
58          params.setParameter(ClientPNames.CONNECTION_MANAGER_FACTORY_CLASS_NAME, factory);
59      }
60  
61      public void setHandleRedirects (final boolean handle) {
62          params.setBooleanParameter(ClientPNames.HANDLE_REDIRECTS, handle);
63      }
64  
65      public void setRejectRelativeRedirect (final boolean reject) {
66          params.setBooleanParameter(ClientPNames.REJECT_RELATIVE_REDIRECT, reject);
67      }
68  
69      public void setMaxRedirects (final int maxRedirects) {
70          params.setIntParameter(ClientPNames.MAX_REDIRECTS, maxRedirects);
71      }
72  
73      public void setAllowCircularRedirects (final boolean allow) {
74          params.setBooleanParameter(ClientPNames.ALLOW_CIRCULAR_REDIRECTS, allow);
75      }
76  
77      public void setHandleAuthentication (final boolean handle) {
78          params.setBooleanParameter(ClientPNames.HANDLE_AUTHENTICATION, handle);
79      }
80  
81      public void setCookiePolicy (final String policy) {
82          params.setParameter(ClientPNames.COOKIE_POLICY, policy);
83      }
84  
85      public void setVirtualHost (final HttpHost host) {
86          params.setParameter(ClientPNames.VIRTUAL_HOST, host);
87      }
88  
89      public void setDefaultHeaders (final Collection <Header> headers) {
90          params.setParameter(ClientPNames.DEFAULT_HEADERS, headers);
91      }
92  
93      public void setDefaultHost (final HttpHost host) {
94          params.setParameter(ClientPNames.DEFAULT_HOST, host);
95      }
96  
97      /**
98       * @since 4.2
99       */
100     public void setConnectionManagerTimeout(final long timeout) {
101         params.setLongParameter(ClientPNames.CONN_MANAGER_TIMEOUT, timeout);
102     }
103 
104 }