|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.alee.managers.proxy.ProxyManager
public final class ProxyManager
This manager allows you to quickly manage application's global proxy settings. When activated this manager might cause a proxy chooser or an authentification popup to pop. That will happen in case it will detect that your proxy settings does not match system proxy settings.
Field Summary | |
---|---|
static java.lang.String |
ALWAYS_USE_SYSTEM_SETTINGS
Settings key for system proxy settings usage option. |
static java.lang.String |
AUTO_SETTINGS_ON
Settings key for automated proxy settings option. |
static java.lang.String |
PROXY_SETTINGS
Settings key for proxy settings. |
static java.lang.String |
SAVE_SETTINGS
Settings key for proxy settings save option. |
static java.lang.String |
SETTINGS_GROUP
Settings group key for proxy settings. |
Constructor Summary | |
---|---|
ProxyManager()
|
Method Summary | |
---|---|
static java.net.Authenticator |
getAuthenticator()
Returns current proxy authenticator. |
static ProxySettings |
getProxySettings()
Returns current proxy settings or default proxy settings if none installed. |
static SystemProxyConfirmationSupport |
getSystemProxyConfirmationSupport()
Returns system proxy settings confirmation dialog support. |
static ProxySettings |
getSystemProxySettings()
Returns single system proxy settings object. |
static java.net.URLConnection |
getURLConnection(java.net.URL url)
Opens URL connection with current proxy settings. |
static void |
initialize()
Initializes manager if it wasn't already initialized. |
static boolean |
isAlwaysUseSystemSettings()
Returns whether system proxy settings usage is enabled or not. |
static boolean |
isAutoDetectionEnabled()
Returns whether automatic proxy detection is enabled or not. |
static boolean |
isAutoSettingsInitialization()
Returns whether auto initialization of proxy settings is enabled or not. |
static void |
setAlwaysUseSystemSettings(boolean useSystem)
Sets whether enable system proxy settings usage or not. |
static void |
setAuthenticator(java.net.Authenticator authenticator)
Changes current proxy authenticator to the specified one. |
static void |
setAutoDetectionEnabled(boolean enabled)
Sets whether automatic proxy detection is enabled or not. |
static void |
setAutoSettingsInitialization(boolean enabled)
Sets whether enable auto initialization of proxy settings or not. |
static void |
setEmptyProxySettings()
Installs empty proxy settings. |
static void |
setProxySettings()
Installs saved or system proxy settings. |
static void |
setProxySettings(ProxySettings setttings)
Installs proxy settings with specified host, port and proxy login and password. |
static void |
setProxySettings(ProxySettings setttings,
boolean save)
Installs proxy settings with specified host, port and proxy login and password. |
static void |
setProxySettings(java.lang.String host,
java.lang.String port)
Installs proxy settings with specified host and port. |
static void |
setProxySettings(java.lang.String host,
java.lang.String port,
java.lang.String login,
java.lang.String password)
Installs proxy settings with specified host, port and proxy login and password. |
static void |
setSystemProxyConfirmationSupport(SystemProxyConfirmationSupport support)
Sets system proxy settings confirmation dialog support. |
static ProxySettings |
setSystemProxySettings()
Installs system proxy settings. |
static void |
setupProxy(java.net.URLConnection urlConnection)
Installs current proxy settings to URL connection. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String SETTINGS_GROUP
public static java.lang.String PROXY_SETTINGS
public static java.lang.String AUTO_SETTINGS_ON
public static java.lang.String ALWAYS_USE_SYSTEM_SETTINGS
public static java.lang.String SAVE_SETTINGS
Constructor Detail |
---|
public ProxyManager()
Method Detail |
---|
public static void initialize()
public static boolean isAutoDetectionEnabled()
public static void setAutoDetectionEnabled(boolean enabled)
enabled
- whether automatic proxy detection is enabled or notpublic static java.net.Authenticator getAuthenticator()
public static void setAuthenticator(java.net.Authenticator authenticator)
authenticator
- new proxy authenticatorpublic static void setAutoSettingsInitialization(boolean enabled)
enabled
- whether enable auto initialization of proxy settings or notpublic static boolean isAutoSettingsInitialization()
public static void setAlwaysUseSystemSettings(boolean useSystem)
useSystem
- whether enable system proxy settings usage or notpublic static boolean isAlwaysUseSystemSettings()
public static ProxySettings getProxySettings()
public static void setProxySettings()
public static void setEmptyProxySettings()
public static ProxySettings setSystemProxySettings()
public static void setProxySettings(java.lang.String host, java.lang.String port)
host
- proxy hostport
- proxy portpublic static void setProxySettings(java.lang.String host, java.lang.String port, java.lang.String login, java.lang.String password)
host
- proxy hostport
- proxy portlogin
- proxy loginpassword
- proxy passwordpublic static void setProxySettings(ProxySettings setttings)
setttings
- single proxy settings objectpublic static void setProxySettings(ProxySettings setttings, boolean save)
setttings
- single proxy settings objectsave
- whether save these settings or notpublic static java.net.URLConnection getURLConnection(java.net.URL url) throws java.io.IOException
url
- url to process
java.io.IOException
public static void setupProxy(java.net.URLConnection urlConnection)
urlConnection
- URL connection to modifypublic static ProxySettings getSystemProxySettings()
public static SystemProxyConfirmationSupport getSystemProxyConfirmationSupport()
public static void setSystemProxyConfirmationSupport(SystemProxyConfirmationSupport support)
support
- system proxy settings confirmation dialog support
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |