osdep.cache
Class CacheProxySource

java.lang.Object
  extended by osdep.cache.CacheProxySource
All Implemented Interfaces:
IProxySource

public class CacheProxySource
extends java.lang.Object
implements IProxySource

It happens that the proxy host and port are checked more than once in this library. This means that ConsoleProxySource asks these information to the user more than once, which is not acceptable. Putting an instance of this class in the middle, the values are cached and so they are asked only once.

Author:
SHZ Mar 10, 2008

Constructor Summary
CacheProxySource(IProxySource source)
           
 
Method Summary
 java.lang.String getProxyHost()
          The proxy host, expressed as a http link
 int getProxyPort()
          The proxy port (normally 8080 or 8000)
 boolean needsProxy()
          Do we need a proxy, or the connection is direct
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheProxySource

public CacheProxySource(IProxySource source)
Parameters:
source -
Method Detail

getProxyHost

public java.lang.String getProxyHost()
Description copied from interface: IProxySource
The proxy host, expressed as a http link

Specified by:
getProxyHost in interface IProxySource
Returns:
the proxy link

getProxyPort

public int getProxyPort()
Description copied from interface: IProxySource
The proxy port (normally 8080 or 8000)

Specified by:
getProxyPort in interface IProxySource
Returns:
the proxy port

needsProxy

public boolean needsProxy()
Description copied from interface: IProxySource
Do we need a proxy, or the connection is direct

Specified by:
needsProxy in interface IProxySource
Returns:
true is a proxy is needed to connect to the internet, false otherwise