com.microsoft.tfs.core
Interface TFProxyServerSettings

All Known Implementing Classes:
DefaultTFProxyServerSettings

public interface TFProxyServerSettings

TFProxyServerSettings is an interface that makes Team Foundation Proxy (aka download proxy) settings available. A TFProxyServerSettings instance is available from a TFSTeamProjectCollection.

Client notes: The return values from the isAvailable() and getURL() methods could change at any time. Clients must not assume that these values will not change. Clients should not cache these values longer than the duration of a single download. Clients should follow this pattern at the beginning of each download:

  1. Call isAvailable() - if the result is false, do not use a TF proxy for that download.
  2. If isAvailable() is true, call getURL(). If the result is null, do not use a TF proxy for that download.
  3. If the url is not null, attempt to use that url as a proxy url to perform the download.
  4. If the download fails because of the proxy, call recordFailure() so that the TFProxyServerSettings implementation can enforce a failure policy.

Implementation notes: TFProxyServerSettings implementations must be thread safe as they will be accessed from multiple threads, possibly simultaneously. Implementations are responsible for enforcing a failure policy. Implementations are notified of proxy failures through the recordFailure() method. A reasonable failure policy is to make the proxy unavailable for a short period of time (e.g. 5 minutes) in response to a failure.

See Also:
TFSTeamProjectCollection
Since:
TEE-SDK-10.1
Thread-safety:
thread-safe

Method Summary
 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.
 

Method Detail

isAvailable

boolean isAvailable()
Called first by clients to determine whether this 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.

Returns:
true if there is a TF proxy server available to be used at the time of this method call

getURL

java.lang.String getURL()
Called second by clients to determine a TF proxy server URL to use. Note that even if 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.

Returns:
a TF proxy URL or null

recordFailure

void recordFailure()
Clients must call this method if a download fails because of a TF proxy server. Calling this method gives 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.



© 2015 Microsoft. All rights reserved.