Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.7.0)

E13403-08

oracle.ide.webbrowser
Class ProxyOptions

java.lang.Object
  extended by oracle.javatools.data.HashStructureAdapter
      extended by oracle.ide.config.ChangeEventSource
          extended by oracle.ide.webbrowser.ProxyOptions
All Implemented Interfaces:
Copyable

public class ProxyOptions
extends ChangeEventSource
implements Copyable

Provides access to HTTP proxy options as set via Tools->Preferences->Web Browser and Proxy.

You can obtain the current settings using getProxyOptions(). You can replace the current proxy settings by instantiating a new instance of this class and calling the static method setProxyOptions( ProxyOptions ). Typically this should be avoided and a ProxyOptionsFilter should be set on the ProxyOptions instead.

While this class is not final, subclassing it is not supported, doing so may cause your extension to break in a future release of the product.


Field Summary
static java.lang.String DEFAULT_PROXY_PORT
          The default proxy port.
static java.lang.String KEY_SETTINGS
          The key for this settings object.
static java.lang.String PROPERTY_PROXY_EXCEPTIONS
          The name of the Java system proprety that stores the proxy exceptions.
static java.lang.String PROPERTY_PROXY_HOST
          The name of the Java system property that stores the proxy host.
static java.lang.String PROPERTY_PROXY_PORT
          The name of the Java system property that stores the proxy port.
 
Fields inherited from class oracle.javatools.data.HashStructureAdapter
_hash
 
Constructor Summary
  ProxyOptions()
           
protected ProxyOptions(HashStructure hash)
           
 
Method Summary
 void applyToCurrentVM()
          Applies the options stored in this object to the Java VM in which the IDE is running.
 java.lang.Object copyTo(java.lang.Object target)
          Copy support.
protected  void copyToImpl(ProxyOptions copy)
           
 void doTask(java.lang.Runnable r)
          Performs an operation, setting the VM proxy options temporarily to the settings stored in this ProxyOptions object.
 boolean equals(java.lang.Object other)
          Equals support.
 ProxyOptionsFilter getFilter()
          Gets the filter applied to the ProxyOptions This only should be used to get the filter for the IDE settings, other ProxyOptions objects will not use filters and a default filter will always be returned
static ProxyOptions getInstance(PropertyStorage prefs)
           
 boolean getIsIdeProxy()
          Gets whether the ProxyOptions object is the one taht represents the IDE settings
 java.lang.String[] getJavaProxyOptions()
          Get proxy options as command line arguments suitable for passing into java.exe.
 java.lang.String getProxyData()
          Get the encrypted password.
 java.lang.String getProxyExceptions()
          Get the list of proxy exceptions.
 java.lang.String getProxyHost()
          Get the name of the host to use as an http proxy.
static ProxyOptions getProxyOptions()
          Get the current proxy options.
 java.lang.String getProxyPassword()
          Get the password for proxy authentication.
 java.lang.String getProxyPort()
          Get the tcp port number of the proxy host.
 java.lang.String getProxyUserName()
          Get the username for proxy authentication.
 java.lang.String getUnfilteredProxyData()
          Gets the proxy data without applying any filter (should be used only be preference panels)
 java.lang.String getUnfilteredProxyExceptions()
          Gets the proxy exceptions without applying any filter (should be used only be preference panels)
 java.lang.String getUnfilteredProxyHost()
          Gets the proxy host without applying any filter (should be used only be preference panels)
 java.lang.String getUnfilteredProxyPassword()
          Gets the proxy password without applying any filter (should be used only be preference panels)
 java.lang.String getUnfilteredProxyPort()
          Gets the proxy port without applying any filter (should be used only be preference panels)
 java.lang.String getUnfilteredProxyUserName()
          Gets the proxy user name without applying any filter (should be used only be preference panels)
 java.lang.Boolean getUnfilteredUseProxy()
          Gets the use proxy setting without applying any filter (should be used only be preference panels)
 java.lang.Boolean getUnfilteredUseProxyAuthentication()
          Gets the use proxy authentication setting without applying any filter (should be used only be preference panels)
 java.lang.Boolean getUseProxy()
          Get whether an http proxy should be used.
 java.lang.Boolean getUseProxyAuthentication()
          Get whether proxy authentication should be used.
 void setFilter(ProxyOptionsFilter filter)
          Sets the filter applied to the ProxyOptions.
 void setProxyData(java.lang.String newData)
          Set the encrypted password.
 void setProxyExceptions(java.lang.String newProxyExceptions)
          Set the list of proxy exceptions.
 void setProxyHost(java.lang.String newProxyHost)
          Set the name of the host to use as an http proxy.
static void setProxyOptions(ProxyOptions proxyOptions)
          Set the current proxy options.
 void setProxyPassword(java.lang.String newProxyPassword)
          Set the password for proxy authentication.
 void setProxyPort(java.lang.String newProxyPort)
          Set the tcp port number of the proxy host.
 void setProxyUserName(java.lang.String newProxyUserName)
          Set the username for proxy authentication.
 void setUseProxy(java.lang.Boolean newUseProxy)
          Set whether an http proxy should be used.
 void setUseProxyAuthentication(java.lang.Boolean newUseProxyAuthentication)
          Set whether proxy authentication should be used.
 
Methods inherited from class oracle.ide.config.ChangeEventSource
addChangeListener, fireChangeEvent, fireChangeEvent, removeChangeListener, setUseObjectEquals
 
Methods inherited from class oracle.javatools.data.HashStructureAdapter
addStructureChangeListener, containsKey, copyToImpl, equalsImpl, findOrCreate, forcedCopyTo, getHashStructure, removeStructureChangeListener, useObjectEquals
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY_SETTINGS

public static final java.lang.String KEY_SETTINGS
The key for this settings object.

See Also:
Constant Field Values

PROPERTY_PROXY_HOST

public static final java.lang.String PROPERTY_PROXY_HOST
The name of the Java system property that stores the proxy host. As of Java 6.0, this is "http.proxyHost".

Since:
11.0
See Also:
Constant Field Values

PROPERTY_PROXY_PORT

public static final java.lang.String PROPERTY_PROXY_PORT
The name of the Java system property that stores the proxy port. As of Java 6.0, this is "http.proxyPort".

Since:
11.0
See Also:
Constant Field Values

PROPERTY_PROXY_EXCEPTIONS

public static final java.lang.String PROPERTY_PROXY_EXCEPTIONS
The name of the Java system proprety that stores the proxy exceptions. As of Java 6.0, this is "http.nonProxyHosts".

Since:
11.0
See Also:
Constant Field Values

DEFAULT_PROXY_PORT

public static final java.lang.String DEFAULT_PROXY_PORT
The default proxy port.

Since:
11.0
See Also:
Constant Field Values
Constructor Detail

ProxyOptions

public ProxyOptions()

ProxyOptions

protected ProxyOptions(HashStructure hash)
Method Detail

getInstance

public static ProxyOptions getInstance(PropertyStorage prefs)

getProxyOptions

public static final ProxyOptions getProxyOptions()
                                          throws TransientMarker
Get the current proxy options.

Returns:
the current proxy options.
Throws:
TransientMarker

getIsIdeProxy

public boolean getIsIdeProxy()
                      throws TransientMarker
Gets whether the ProxyOptions object is the one taht represents the IDE settings

Returns:
true if the object represents the IDE settings; false otherwise
Throws:
TransientMarker

getFilter

public ProxyOptionsFilter getFilter()
Gets the filter applied to the ProxyOptions This only should be used to get the filter for the IDE settings, other ProxyOptions objects will not use filters and a default filter will always be returned

Returns:
the filter applied to the ProxyOptions

setFilter

public void setFilter(ProxyOptionsFilter filter)
Sets the filter applied to the ProxyOptions. The filter is a static member; it only has meaning for the instance of ProxyOptions that should be used for the Ide as a whole and that is presented in the settings. If an attempt is made to set it on a ProxyOptions that is not the IDE settings it will be ignored

Parameters:
filter - the filter to apply to the ProxyOtpions. When null is passed the default filter will be re-applied

setProxyOptions

public static final void setProxyOptions(ProxyOptions proxyOptions)
                                  throws TransientMarker
Set the current proxy options.

Parameters:
proxyOptions - the new proxy options.
Throws:
TransientMarker

setProxyHost

public final void setProxyHost(java.lang.String newProxyHost)
Set the name of the host to use as an http proxy.

Parameters:
newProxyHost - the host to use as an http proxy.

getProxyHost

public final java.lang.String getProxyHost()
Get the name of the host to use as an http proxy.

Returns:
the name of the http proxy host.

getUnfilteredProxyHost

public final java.lang.String getUnfilteredProxyHost()
Gets the proxy host without applying any filter (should be used only be preference panels)

Returns:
the proxy host

setProxyPort

public final void setProxyPort(java.lang.String newProxyPort)
Set the tcp port number of the proxy host.

Parameters:
newProxyPort - the tcp port number of the proxy host.

getProxyPort

public final java.lang.String getProxyPort()
Get the tcp port number of the proxy host.

Returns:
the tcp port number of the proxy host.

getUnfilteredProxyPort

public final java.lang.String getUnfilteredProxyPort()
Gets the proxy port without applying any filter (should be used only be preference panels)

Returns:
the proxy port

setProxyExceptions

public final void setProxyExceptions(java.lang.String newProxyExceptions)
Set the list of proxy exceptions. A vertical bar (|) separates entries and an asterisk (*) can be used as a wildcard.

Parameters:
newProxyExceptions - host name patterns which should bypass the proxy

getProxyExceptions

public final java.lang.String getProxyExceptions()
Get the list of proxy exceptions.

Returns:
host name patterns which bypass the proxy.

getUnfilteredProxyExceptions

public final java.lang.String getUnfilteredProxyExceptions()
Gets the proxy exceptions without applying any filter (should be used only be preference panels)

Returns:
the proxy exceptions

setUseProxy

public final void setUseProxy(java.lang.Boolean newUseProxy)
Set whether an http proxy should be used.

Parameters:
newUseProxy - whether an http proxy should be used.

getUseProxy

public java.lang.Boolean getUseProxy()
Get whether an http proxy should be used.

Returns:
true if an http proxy should be used.

getUnfilteredUseProxy

public java.lang.Boolean getUnfilteredUseProxy()
Gets the use proxy setting without applying any filter (should be used only be preference panels)

Returns:
Boolean.TRUE if a proxy should be used; Boolean.FALSE otherwise

setUseProxyAuthentication

public final void setUseProxyAuthentication(java.lang.Boolean newUseProxyAuthentication)
Set whether proxy authentication should be used.

Parameters:
newUseProxyAuthentication - whether proxy authentication should be used

getUseProxyAuthentication

public java.lang.Boolean getUseProxyAuthentication()
Get whether proxy authentication should be used.

Returns:
true if proxy authentication should be used

getUnfilteredUseProxyAuthentication

public java.lang.Boolean getUnfilteredUseProxyAuthentication()
Gets the use proxy authentication setting without applying any filter (should be used only be preference panels)

Returns:
Boolean.TRUE if proxy authentication should be used; Boolean.FALSE otherwise

setProxyUserName

public final void setProxyUserName(java.lang.String newProxyUserName)
Set the username for proxy authentication.

Parameters:
newProxyUserName - the username for proxy authentication

getProxyUserName

public final java.lang.String getProxyUserName()
Get the username for proxy authentication.

Returns:
the username for proxy authentication

getUnfilteredProxyUserName

public final java.lang.String getUnfilteredProxyUserName()
Gets the proxy user name without applying any filter (should be used only be preference panels)

Returns:
the proxy user name

setProxyPassword

public final void setProxyPassword(java.lang.String newProxyPassword)
Set the password for proxy authentication. The password is encrypted before being stored.

Parameters:
newProxyPassword - the password for proxy authentication

getProxyPassword

public final java.lang.String getProxyPassword()
                                        throws TransientMarker
Get the password for proxy authentication. The password is decrypted before being returned. Callers should be very careful how they use and store the return value.

Returns:
the password for proxy authentication
Throws:
TransientMarker

getUnfilteredProxyPassword

public final java.lang.String getUnfilteredProxyPassword()
                                                  throws TransientMarker
Gets the proxy password without applying any filter (should be used only be preference panels)

Returns:
the proxy password
Throws:
TransientMarker

setProxyData

public final void setProxyData(java.lang.String newData)
Set the encrypted password.

Parameters:
newData - the new encrypted password

getProxyData

public final java.lang.String getProxyData()
Get the encrypted password.

Returns:
the encrypted password

getUnfilteredProxyData

public final java.lang.String getUnfilteredProxyData()
Gets the proxy data without applying any filter (should be used only be preference panels)

Returns:
the proxy data

getJavaProxyOptions

public java.lang.String[] getJavaProxyOptions()
Get proxy options as command line arguments suitable for passing into java.exe.

NOTE: proxy authentication is not included in these arguments, as it would not be secure to pass this in plain text over the command line. If the Java application being launched needs to make connections through a proxy that requires authentication, it will need to obtain the authentication information itself. For example, it might provide an implementation of the java.net.Authenticator interface.

Returns:
an array containing arguments to pass into a Java VM to set proxy options. For example, { "-Dhttp.proxyHost=...", "-Dhttp.proxyPort=...", "-Dhttp.nonProxyHosts=..." }. If the useProxy preference is false, or the proxyHost is null or zero length, this method will return null.

doTask

public void doTask(java.lang.Runnable r)
Performs an operation, setting the VM proxy options temporarily to the settings stored in this ProxyOptions object.

The operation is specified using a Runnable. During the lifecycle of the Runnable.run() method, the VM's proxy options will be set to those specified in the provided ProxyOptions object.

Important: the runnable is executed with a global lock held on the proxy options object. It should therefore avoid blocking for a long period of time.

Parameters:
r - a runnable to execute with the specified proxy settings. This runnable will be executed synchronously (i.e. on the calling thread).
Since:
11.0

applyToCurrentVM

public void applyToCurrentVM()
Applies the options stored in this object to the Java VM in which the IDE is running.

Extension developers should generally never call this method. It is called automatically by the IDE when the user changes proxy options on the Web Browser / Proxy page in preferences, or when proxy options are programmatically changed via the setProxyOptions(ProxyOptions) method.

Since:
11.0

equals

public final boolean equals(java.lang.Object other)
Description copied from class: HashStructureAdapter
Equals support. As long as the subclass stores all data in the HashStructureAdapter._hash, this base equals implementation should be sufficient and not need to be overridden.

Overrides:
equals in class HashStructureAdapter

copyTo

public java.lang.Object copyTo(java.lang.Object target)
Description copied from class: HashStructureAdapter
Copy support. The specified target must not be null and must be the exact same type as this instance.

Specified by:
copyTo in interface Copyable
Overrides:
copyTo in class ChangeEventSource
Parameters:
target - The target object to which the state of this object should be copied. If target is null, then the copyTo method will return a new instance of this class.
Returns:
The object to which the state of this object was copied. If the target was non-null, then the return value is the same as the target object that was passed in; otherwise, the return value is a new instance of this class.

copyToImpl

protected final void copyToImpl(ProxyOptions copy)

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.7.0)

E13403-08

Copyright © 1997, 2013, Oracle. All rights reserved.