|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.microsoft.tfs.core.config.tfproxy.DefaultTFProxyServerSettings
public class DefaultTFProxyServerSettings
A default implementation of the TFProxyServerSettings
interface.
The user can provide a custom post-failure disabled period, which, when
positive, causes the proxy to appear disabled (isAvailable()
returns
false) until a subsequent call to isAvailable()
occurs after the
configured period has elapsed.
If no disabled period is provided, DEFAULT_DISABLE_INTERVAL_MILLIS
is used.
TFProxyServerSettings
Field Summary | |
---|---|
static long |
DEFAULT_DISABLE_INTERVAL_MILLIS
The default length of the the post-failure disabled period, in milliseconds. |
Constructor Summary | |
---|---|
DefaultTFProxyServerSettings(java.lang.String url)
|
|
DefaultTFProxyServerSettings(java.lang.String url,
long disableIntervalMillis)
Creates a DefaultTFProxyServerSettings for the given URL with a
custom post-failure disabled period. |
Method Summary | |
---|---|
long |
getDisableInternalMillis()
|
java.lang.String |
getURL()
Called second by clients to determine a TF proxy server URL to use. |
boolean |
isAvailable()
Called first by clients to determine whether this TFProxyServerSettings represents a TF proxy server that is
available to be used. |
void |
recordFailure()
Clients must call this method if a download fails because of a TF proxy server. |
void |
setURL(java.lang.String url)
Sets the proxy server URL. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final long DEFAULT_DISABLE_INTERVAL_MILLIS
300000L
Constructor Detail |
---|
public DefaultTFProxyServerSettings(java.lang.String url)
public DefaultTFProxyServerSettings(java.lang.String url, long disableIntervalMillis)
DefaultTFProxyServerSettings
for the given URL with a
custom post-failure disabled period.
url
- the URL string of the proxy server (pass null to disable the proxy
server)disableIntervalMillis
- the length of the post-failure disabled period, in millisecondsMethod Detail |
---|
public void setURL(java.lang.String url)
url
- the URL string of the proxy server (pass null to disable the proxy
server)public long getDisableInternalMillis()
public void recordFailure()
TFProxyServerSettings
a chance
to enforce a failure policy. See the javadoc for this class for the
algorithm that clients should follow when using a
TFProxyServerSettings
instance.
recordFailure
in interface TFProxyServerSettings
public boolean isAvailable()
TFProxyServerSettings
represents a TF proxy server that is
available to be used. As noted above, the result of this method can
change at any time.
isAvailable
in interface TFProxyServerSettings
true
if there is a TF proxy server available to be
used at the time of this method callpublic java.lang.String getURL()
TFProxyServerSettings.isAvailable()
returns true
, clients
must still be prepared for a null
return value from this
method, which indicates that the TF proxy server became unavailable in
between method calls. A non-null
return can be used for a
single download as a TF proxy URL.
getURL
in interface TFProxyServerSettings
null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |