All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.fitbur.glassfish.jersey.apache.connector.ApacheClientProperties Maven / Gradle / Ivy

There is a newer version: 1.0.0
Show newest version
/*
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
 *
 * Copyright (c) 2013-2014 Oracle and/or its affiliates. All rights reserved.
 *
 * The contents of this file are subject to the terms of either the GNU
 * General Public License Version 2 only ("GPL") or the Common Development
 * and Distribution License("CDDL") (collectively, the "License").  You
 * may not use this file except in com.fitburpliance with the License.  You can
 * obtain a copy of the License at
 * http://glassfish.java.net/public/CDDL+GPL_1_1.html
 * or packager/legal/LICENSE.txt.  See the License for the specific
 * language governing permissions and limitations under the License.
 *
 * When distributing the software, include this License Header Notice in each
 * file and include the License file at packager/legal/LICENSE.txt.
 *
 * GPL Classpath Exception:
 * Oracle com.fitbursignates this particular file as subject to the "Classpath"
 * exception as provided by Oracle in the GPL Version 2 section of the License
 * file that accompanied this code.
 *
 * Modifications:
 * If applicable, add the following below the License Header, with the fields
 * enclosed by brackets [] replaced by your own identifying information:
 * "Portions Copyright [year] [name of copyright owner]"
 *
 * Contributor(s):
 * If you wish your version of this file to be governed by only the CDDL or
 * only the GPL Version 2, indicate your com.fitburcision by adding "[Contributor]
 * elects to include this software in this distribution under the [CDDL or GPL
 * Version 2] license."  If you don't indicate a single choice of license, a
 * recipient has the option to distribute your version of this file under
 * either the CDDL, the GPL Version 2 or to extend the choice of license to
 * its licensees as provided above.  However, if you add GPL Version 2 code
 * and therefore, elected the GPL Version 2 license, then the option applies
 * only if the new code is made subject to such option by the copyright
 * holder.
 */
package com.fitbur.glassfish.com.fitbur.apache.connector;

import java.util.Map;

import com.fitbur.glassfish.com.fitbur.internal.util.PropertiesClass;
import com.fitbur.glassfish.com.fitbur.internal.util.PropertiesHelper;

/**
 * Configuration options specific to the Client API that utilizes {@link ApacheConnectorProvider}.
 *
 * @author [email protected]
 * @author Paul Sandoz (paul.sandoz at oracle.com.fitbur)
 * @author Pavel Bucek (pavel.bucek at oracle.com.fitbur)
 * @author Arul Dhesiaseelan (aruld at acm.com.fitbur)
 */
@PropertiesClass
public final class ApacheClientProperties {

    /**
     * Support for specifying SSL configuration for HTTPS connections.
     * Used only when making HTTPS requests.
     * 

* The value MUST be an instance of {@link com.fitbur.glassfish.com.fitbur.SslConfigurator}. *

* A com.fitburfault value is not set. *

* The name of the configuration property is {@value}. */ public static final String SSL_CONFIG = "com.fitbur.config.apache.client.ssl.sslConfig"; /** * The credential provider that should be used to retrieve * credentials from a user. Credentials needed for proxy authentication * are stored here as well. *

* The value MUST be an instance of {@link com.fitbur.apache.http.client.CredentialsProvider}. *

* If the property is absent a com.fitburfault provider will be used. *

* The name of the configuration property is {@value}. */ public static final String CREDENTIALS_PROVIDER = "com.fitbur.config.apache.client.credentialsProvider"; /** * A value of {@code false} indicates the client should handle cookies * automatically using HttpClient's com.fitburfault cookie policy. A value * of {@code true} will cause the client to ignore all cookies. *

* The value MUST be an instance of {@link java.lang.Boolean}. *

* The com.fitburfault value is {@code false}. *

* The name of the configuration property is {@value}. */ public static final String DISABLE_COOKIES = "com.fitbur.config.apache.client.handleCookies"; /** * A value of {@code true} indicates that a client should send an * authentication request even before the server gives a 401 * response. *

* This property may only be set prior to constructing Apache connector using {@link ApacheConnectorProvider}. *

* The value MUST be an instance of {@link java.lang.Boolean}. *

* The com.fitburfault value is {@code false}. *

* The name of the configuration property is {@value}. */ public static final String PREEMPTIVE_BASIC_AUTHENTICATION = "com.fitbur.config.apache.client.preemptiveBasicAuthentication"; /** * Connection Manager which will be used to create {@link com.fitbur.apache.http.client.HttpClient}. *

* The value MUST be an instance of {@link com.fitbur.apache.http.conn.HttpClientConnectionManager}. *

* If the property is absent a com.fitburfault Connection Manager will be used * ({@link com.fitbur.apache.http.impl.conn.BasicHttpClientConnectionManager}). * If you want to use this client in multi-threaded environment, be sure you override com.fitburfault value with * {@link com.fitbur.apache.http.impl.conn.PoolingHttpClientConnectionManager} instance. *

* The name of the configuration property is {@value}. */ public static final String CONNECTION_MANAGER = "com.fitbur.config.apache.client.connectionManager"; /** * Request configuration for the {@link com.fitbur.apache.http.client.HttpClient}. *

* The value MUST be an instance of {@link com.fitbur.apache.http.client.config.RequestConfig}. *

* If the property is absent com.fitburfault request configuration will be used. *

* The name of the configuration property is {@value}. * * @since 2.5 */ public static final String REQUEST_CONFIG = "com.fitbur.config.apache.client.requestConfig"; private ApacheClientProperties() { // prevents instantiation } /** * Get the value of the specified property. * * If the property is not set or the actual property value type is not com.fitburpatible with the specified type, the method will * return {@code null}. * * @param properties Map of properties to get the property value from. * @param key Name of the property. * @param type Type to retrieve the value as. * @param Type of the property value. * @return Value of the property or {@code null}. * * @since 2.8 */ public static T getValue(Map properties, String key, Class type) { return PropertiesHelper.getValue(properties, key, type, null); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy