LibreOffice Module ucbhelper (master)  1
Public Member Functions | Private Attributes | List of all members
ucbhelper::InternetProxyDecider Class Reference

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>

Collaboration diagram for ucbhelper::InternetProxyDecider:
[legend]

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_Implm_xImpl
 

Detailed Description

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.

Constructor & Destructor Documentation

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.

Parameters
rxSMgris a Service Manager.

Definition at line 928 of file proxydecider.cxx.

ucbhelper::InternetProxyDecider::~InternetProxyDecider ( )

Destructor.

Definition at line 935 of file proxydecider.cxx.

References m_xImpl.

Member Function Documentation

InternetProxyServer ucbhelper::InternetProxyDecider::getProxy ( const OUString &  rProtocol,
const OUString &  rHost,
sal_Int32  nPort 
) const

Returns the proxy server to be used.

Parameters
rProtocolcontains 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.
rHostcontains 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.
nPortcontains 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).
Returns
a InternetProxyServer struct. If member aName of the InternetProxyServer is empty no proxy server is to be used.

Definition at line 953 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.

Parameters
rProtocolcontains 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.
rHostcontains 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.
nPortcontains 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).
Returns
true if a proxy server should be used, false otherwise.

Definition at line 942 of file proxydecider.cxx.

References ucbhelper::InternetProxyServer::aName, m_xImpl, and rData.

Member Data Documentation

rtl::Reference<proxydecider_impl::InternetProxyDecider_Impl> ucbhelper::InternetProxyDecider::m_xImpl
private

Definition at line 128 of file proxydecider.hxx.

Referenced by getProxy(), shouldUseProxy(), and ~InternetProxyDecider().


The documentation for this class was generated from the following files: