public interface IProxyService
Clients that wish to make a connection and need to determine whether to use a
proxy or not should call either getProxyDataForHost(String)
or
getProxyDataForHost(String, String)
.
Modifier and Type | Method and Description |
---|---|
void |
addProxyChangeListener(IProxyChangeListener listener)
Registers a listener that will be notified when proxy related
information changes.
|
String[] |
getNonProxiedHosts()
Returns the list of hosts for which non proxy should be used.
|
IProxyData[] |
getProxyData()
Returns the list of know proxy types and their settings.
|
IProxyData |
getProxyData(String type)
Returns the proxy data for the proxy of the given type or
null if the proxy type is not known by this service. |
IProxyData[] |
getProxyDataForHost(String host)
Deprecated.
This method is deprecated because of its ambiguity. Use
select(URI) instead. |
IProxyData |
getProxyDataForHost(String host,
String type)
Deprecated.
This method is deprecated because of its ambiguity. Use
select(URI) instead. |
boolean |
hasSystemProxies()
Returns whether system proxy support is available.
|
boolean |
isProxiesEnabled()
Returns whether proxy support should be enabled.
|
boolean |
isSystemProxiesEnabled()
Returns whether system proxy should be used when the proxy support is
enabled.
|
void |
removeProxyChangeListener(IProxyChangeListener listener)
Removes a listener.
|
IProxyData[] |
select(URI uri)
Returns all the applicable proxy data to access the specified URI.
|
void |
setNonProxiedHosts(String[] hosts)
Sets the list of hosts for which non proxy should be used.
|
void |
setProxiesEnabled(boolean enabled)
Sets whether proxy support should be enabled.
|
void |
setProxyData(IProxyData[] proxies)
Sets the information associated with known proxy types.
|
void |
setSystemProxiesEnabled(boolean enabled)
Sets whether system proxies should be used, when the proxy support is
enabled.
|
void setProxiesEnabled(boolean enabled)
isProxiesEnabled()
before calling the getProxyData()
or
getProxyData(String)
method. However, the
getProxyDataForHost(String)
and
getProxyDataForHost(String, String)
method will check the
enablement and only return data if the service is enabled.enabled
- whether proxy support should be enabledboolean isProxiesEnabled()
Returns false
, when the system proxies support is
enabled but hasSystemProxies()
returns false
.
boolean hasSystemProxies()
void setSystemProxiesEnabled(boolean enabled)
enabled
- boolean isSystemProxiesEnabled()
IProxyData[] getProxyData()
null
.
Clients that wish to make a connection and need to determine whether to
use a proxy or not should call either
getProxyDataForHost(String)
or
getProxyDataForHost(String, String)
.
This method returns the proxies set via setProxyData(IProxyData[])
IProxyData[] select(URI uri)
Clients that wish to make a connection and need to determine whether to use a proxy should use this method.
uri
- the URI for which proxies are returnedIProxyData[] getProxyDataForHost(String host)
select(URI)
instead.Clients that wish to make a connection and need to determine whether to use a proxy should use this method.
host
- the host for which a connection is desiredIProxyData getProxyData(String type)
null
if the proxy type is not known by this service.
Clients that wish to make a connection and need to determine whether to
use a proxy or not should call either
getProxyDataForHost(String)
or
getProxyDataForHost(String, String)
.
This method returns the proxies set via setProxyData(IProxyData[])
type
- the proxy typenull
IProxyData.HTTP_PROXY_TYPE
,
IProxyData.HTTPS_PROXY_TYPE
,
IProxyData.SOCKS_PROXY_TYPE
IProxyData getProxyDataForHost(String host, String type)
select(URI)
instead.null
if the proxy type is not known by this service, the
proxy data is empty for that type or the host is in the non-proxied host
list.
Clients that wish to make a connection and need to determine whether to use a proxy should use this method.
host
- the host for which a connection is desiredtype
- the proxy typenull
IProxyData.HTTP_PROXY_TYPE
,
IProxyData.HTTPS_PROXY_TYPE
,
IProxyData.SOCKS_PROXY_TYPE
void setProxyData(IProxyData[] proxies) throws CoreException
This method affects only proxies defined in Eclipse by user and doesn't affect settings of the system proxies (being used when the system support is enabled).
proxies
- the proxy data whose information is to be set.CoreException
- if the proxy could not be setString[] getNonProxiedHosts()
Clients that wish to make a connection and need to determine whether to
use a proxy or not should call either
getProxyDataForHost(String)
or
getProxyDataForHost(String, String)
.
This method returns the hosts set via
setNonProxiedHosts(String[])
getProxyDataForHost(String)
,
getProxyDataForHost(String, String)
void setNonProxiedHosts(String[] hosts) throws CoreException
This method affects only non-proxied hosts defined in Eclipse by user and doesn't affect settings of the system proxies (being used when the system support is enabled).
hosts
- the list of hosts for which non proxy should be usedCoreException
- if the non-proxied host list could not be setvoid addProxyChangeListener(IProxyChangeListener listener)
listener
- a change listenervoid removeProxyChangeListener(IProxyChangeListener listener)
listener
- a change listener
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.