/*  Copyright (c) 2000, 2002 by Oracle Corporation. All Rights Reserved. */

package oracle.portal.provider.v1.http; 

/**
 * <p>Class containing Proxy information such as proxy host, proxy port and the
 * URLProvider uses this information for extracting cookies from
 * login URL and URLRenderer for getting URL content from page URL.
 *
 * @see oracle.portal.provider.v1.http.URLProvider
 */
public class ProxyInformation 
{ 
    private String mHttpProxyHost = null; 
    private int mHttpProxyPort = 80;
    private String mHttpsProxyHost = null; 
    private int mHttpsProxyPort = 443; 
    private String mProxyUser = null; 
    private String mProxyPassword = null; 
    private String mProxyRealm = null; 
    
    /**
     * Get method for httpProxyHost tag in provider.xml
     * @return proxyHost proxy host to be used in HTTP connections.
     *
     */
    public String getHttpProxyHost() 
    { 
        return mHttpProxyHost; 
    } 
    
    /**
     * Get method for httpsProxyHost tag in provider.xml
     * @return proxyHost to be used in Https connections.
     *
     */
    public String getHttpsProxyHost() 
    { 
        return mHttpsProxyHost; 
    } 
    
    /**
     * Set method for httpProxyHost tag in provider.xml
     * @param proxyHost proxyHost to be used in Http connections.
     *
     */
    public void setHttpProxyHost(String proxyHost) 
    { 
        mHttpProxyHost = proxyHost; 
    } 
    
    /**
     * Set method for httpsProxyHost tag in provider.xml
     * @param proxyHost proxyHost to be used in Https connections.
     *
     */
    public void setHttpsProxyHost(String proxyHost) 
    { 
        mHttpsProxyHost = proxyHost; 
    } 
    
    /**
     * Get method for httpProxyPort tag in provider.xml
     * @return value of proxyPort tag.
     *
     */
    public int getHttpProxyPort() 
    { 
        return mHttpProxyPort; 
    } 
    
    /**
     * Set method for httpProxyPort tag in provider.xml
     * @param proxyPort value of proxyPort tag.
     *
     */
    public void setHttpProxyPort(String proxyPort) 
    { 
        mHttpProxyPort = Integer.parseInt(proxyPort.trim()); 
    } 
    
    /**
     * Get method for httpsProxyPort tag in provider.xml
     * @return value of httpsProxyPort tag.
     *
     */
    public int getHttpsProxyPort() 
    { 
        return mHttpsProxyPort; 
    } 
    
    /**
     * Set method for httpsProxyPort tag in provider.xml
     * @param proxyPort proxy port to be used in Https connections.
     *
     */
    public void setHttpsProxyPort(String proxyPort) 
    { 
        mHttpsProxyPort = Integer.parseInt(proxyPort.trim()); 
    } 
    
    /**
     * Sets the proxy user name. Will be useful in situation where user has
     * to get authenticated at proxy level also.
     * @param proxyUser Authorized user name for this proxy.
     *
     */
    public void setProxyUser(String proxyUser) 
    { 
        mProxyUser = proxyUser; 
    } 
    
    /**
     * Returns the authorized proxy user name
     * @return String proxy user name.
     *
     */
    public String getProxyUser() 
    { 
        return mProxyUser; 
    } 
    
    /**
     * Sets the proxy user's password. Will be useful in situation where user has
     * to get authenticated at proxy level also.
     * @param proxyPassword Password for authorized user for this proxy.
     *
     */
    public void setProxyPassword(String proxyPassword) 
    { 
        mProxyPassword = proxyPassword; 
    } 
    
    /**
     * Returns the authorized proxy user's password
     * @return String Proxy user's password.
     *
     */
    public String getProxyPassword() 
    { 
        return mProxyPassword; 
    } 
    
    /**
     * Sets the proxy realm. Will be useful in situation where user has
     * to get authenticated at proxy level also.
     * @param proxyRealm Realm of the proxy.
     * <p>The realm is server specified string which groups various URLs under
     * a given server together and which is used to select the correct info when
     * a server issues an auth challenge.</p>
     *
     */
    public void setProxyRealm(String proxyRealm) 
    { 
        mProxyRealm = proxyRealm; 
    } 
    
    /**
     * Returns the server specific realm for this user.
     * @return realm proxy realm.
     *
     */
    public String getProxyRealm() 
    { 
        return mProxyRealm; 
    } 
} 