LibreOffice Module ucbhelper (master) 1
|
This class is able to decide whether and which internet proxy server is to be used to access a given URI. More...
#include <proxydecider.hxx>
Public Member Functions | |
InternetProxyDecider (const css::uno::Reference< css::uno::XComponentContext > &rxContext) | |
Constructor. More... | |
~InternetProxyDecider () | |
Destructor. More... | |
bool | shouldUseProxy (const OUString &rProtocol, const OUString &rHost, sal_Int32 nPort) const |
Informs whether a proxy server should be used. More... | |
InternetProxyServer | getProxy (const OUString &rProtocol, const OUString &rHost, sal_Int32 nPort) const |
Returns the proxy server to be used. More... | |
Private Attributes | |
rtl::Reference< proxydecider_impl::InternetProxyDecider_Impl > | m_xImpl |
This class is able to decide whether and which internet proxy server is to be used to access a given URI.
The implementation reads the internet proxy settings from Office configuration. It listens for configuration changes and adapts itself accordingly. Because configuration data can change during runtime clients should not cache results obtained from InternetProxyDecider instances. One instance should be kept to be queried multiple times instead.
Definition at line 66 of file proxydecider.hxx.
ucbhelper::InternetProxyDecider::InternetProxyDecider | ( | const css::uno::Reference< css::uno::XComponentContext > & | rxContext | ) |
Constructor.
Note: Every instance should be held alive as long as possible because because construction is quite expensive.
rxSMgr | is a Service Manager. |
Definition at line 914 of file proxydecider.cxx.
ucbhelper::InternetProxyDecider::~InternetProxyDecider | ( | ) |
InternetProxyServer ucbhelper::InternetProxyDecider::getProxy | ( | const OUString & | rProtocol, |
const OUString & | rHost, | ||
sal_Int32 | nPort | ||
) | const |
Returns the proxy server to be used.
rProtocol | contains the internet protocol to be used to access the server (i.e. "ftp", "http"). The protocol string is handled case-insensitive and must not be empty. |
rHost | contains the name of the server that should be accessed. This parameter might be left empty. In this case the implementation will return the proxy that is configured for the given protocol. |
nPort | contains the port of the server that should be accessed. If host is not empty this parameter must always contain a valid port number, for instance the default port for the requested protocol(i.e. 80 or http). |
Definition at line 939 of file proxydecider.cxx.
References m_xImpl.
bool ucbhelper::InternetProxyDecider::shouldUseProxy | ( | const OUString & | rProtocol, |
const OUString & | rHost, | ||
sal_Int32 | nPort | ||
) | const |
Informs whether a proxy server should be used.
rProtocol | contains the internet protocol to be used to access the server (i.e. "ftp", "http"). The protocol string is handled case-insensitive and must not be empty. |
rHost | contains the name of the server that should be accessed. This parameter might be left empty. In this case the implementation will return whether a proxy is configured for the given protocol. |
nPort | contains the port of the server that should be accessed. If host is not empty this parameter must always contain a valid port number, for instance the default port for the requested protocol(i.e. 80 or http). |
Definition at line 928 of file proxydecider.cxx.
References ucbhelper::InternetProxyServer::aName, and m_xImpl.
|
private |
Definition at line 128 of file proxydecider.hxx.
Referenced by getProxy(), shouldUseProxy(), and ~InternetProxyDecider().