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

flex.messaging.services.http.HostConfigurationSettings Maven / Gradle / Ivy

There is a newer version: 4.8.0
Show newest version
/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package flex.messaging.services.http;

/**
 *
 * Collects the properties needed to create an Apache Commons HTTPClient
 * HostConfiguration. Holds all of the variables needed to describe an HTTP
 * connection to a host: remote host, port and protocol, proxy host and port,
 * local address, and virtual host.
 *  
 * @see org.apache.commons.httpclient.HostConfiguration
 */
public class HostConfigurationSettings
{

    public static final String HOST = "host";
    

    public static final String PORT = "port";
    

    public static final String PROTOCOL = "protocol";
    

    public static final String PROTOCOL_FACFORY = "protocol-factory";
    

    public static final String LOCAL_ADDRESS = "local-address";
    

    public static final String MAX_CONNECTIONS = "max-connections";
    

    public static final String PROXY = "proxy";
    

    public static final String VIRTUAL_HOST = "virtual-host";

    private String host;    
    private int port;
    private String protocol;
    private ProtocolFactory protocolFactory;
    private String localAddress;
    private int maximumConnections;
    private String proxyHost;
    private int proxyPort;
    private String virtualHost;

    /**
     * Creates a default HostConfigurationSettings instance.
     */
    public HostConfigurationSettings()
    {
        maximumConnections = HTTPConnectionManagerSettings.DEFAULT_MAX_CONNECTIONS_HOST;
    }

    /**
     * Returns the host property.
     *
     * @return The host name for the connection.
     */
    public String getHost()
    {
        return host;
    }

    /**
     * Sets the host property.
     *
     * @param host The host name for the connection.
     */
    public void setHost(String host)
    {
        this.host = host;
    }

    /**
     * Returns the local-address property.     
     *
     * @return The local address for the connection.
     */
    public String getLocalAddress()
    {
        return localAddress;
    }

    /**
     * Sets the local-address property.
     *
     * @param localAddress The local address for the connection.
     */
    public void setLocalAddress(String localAddress)
    {
        this.localAddress = localAddress;
    }

    /**
     * Returns the max-connections property.
     *
     * @return The maximum connections.
     */
    public int getMaximumConnections()
    {
        return maximumConnections;
    }

    /**
     * Sets the maximum-connections property.
     *
     * @param maximumConnections The maximum connections.
     */
    public void setMaximumConnections(int maximumConnections)
    {
        this.maximumConnections = maximumConnections;
    }

    /**
     * Returns the port property.
     *
     * @return The port for the connection.
     */
    public int getPort()
    {
        return port;
    }

    /**
     * Sets the port property.
     *
     * @param port The port for the connection.
     */
    public void setPort(int port)
    {
        this.port = port;
    }

    /**
     * Returns the protocol for the connection.
     *
     * @return The protocol for the connection.
     */
    public String getProtocol()
    {
        return protocol;
    }

    /**
     * Sets the protocol property.
     *
     * @param protocol The protocol for the connection.
     */
    public void setProtocol(String protocol)
    {
        this.protocol = protocol;
    }

    /**
     * Returns the protocol factory for the connection.
     *
     * @return The protocol factory for the connection.
     */
    public ProtocolFactory getProtocolFactory()
    {
        return protocolFactory;
    }

    /**
     * Set the protocol factory for the connection.
     *
     * @param protocolFactory The protocol factory for the connection.
     */
    public void setProtocolFactory(ProtocolFactory protocolFactory)
    {
        this.protocolFactory = protocolFactory;
    }

    /**
     * Returns the proxy host name for the connection.
     *
     * @return The proxy host name for the connection.
     */
    public String getProxyHost()
    {
        return proxyHost;
    }

    /**
     * Sets the proxy host name for the connection.
     *
     * @param proxyHost The proxy host name for the connection.
     */     
    public void setProxyHost(String proxyHost)
    {
        this.proxyHost = proxyHost;
    }

    /**
     * Returns the proxy port for the connection.
     *
     * @return The proxy port for the connection. 
     */
    public int getProxyPort()
    {
        return proxyPort;
    }

    /**
     * Sets the proxy port for the connection.
     *
     * @param proxyPort The proxy port for the connection.
     */
    public void setProxyPort(int proxyPort)
    {
        this.proxyPort = proxyPort;
    }

    /**
     * Returns the virtual host for the connection.
     *
     * @return The virtual host for the connection.
     */
    public String getVirtualHost()
    {
        return virtualHost;
    }

    /**
     * Sets the virtual host for the connection.
     *
     * @param virtualHost The virtual host for the connection.
     */
    public void setVirtualHost(String virtualHost)
    {
        this.virtualHost = virtualHost;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy